Skip to content

Commit

Permalink
removed php stan baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
rliebi committed Mar 27, 2024
1 parent 6d20b01 commit a7387e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
parameters:
ignoreErrors:
-
message: "#^Method Valantic\\\\ElasticaBridgeBundle\\\\EventListener\\\\Pimcore\\\\ChangeListener\\:\\:getFreshElement\\(\\) should return TElement of Pimcore\\\\Model\\\\Asset\\|Pimcore\\\\Model\\\\DataObject\\\\AbstractObject\\|Pimcore\\\\Model\\\\Document but returns Pimcore\\\\Model\\\\Asset\\|Pimcore\\\\Model\\\\DataObject\\\\AbstractObject\\|Pimcore\\\\Model\\\\Document\\.$#"
count: 1
path: src/EventListener/Pimcore/ChangeListener.php

-
message: "#^Call to function is_subclass_of\\(\\) with Pimcore\\\\Model\\\\Element\\\\AbstractElement and mixed will always evaluate to true\\.$#"
count: 1
Expand Down
2 changes: 2 additions & 0 deletions src/EventListener/Pimcore/ChangeListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,15 @@ private function prepareHandle(AssetEvent|DataObjectEvent|DocumentEvent $event):
*/
private function getFreshElement(AbstractElement $element): AbstractElement
{
/** @var class-string<TElement> $elementClass */
$elementClass = $element::class;
$e = new PimcoreElementNotFoundException($element->getId(), $elementClass);

if ($element->getId() === null) {
throw $e;
}

/** @var TElement */
return $elementClass::getById($element->getId(), ['force' => true]) ?? throw $e;
}

Expand Down

0 comments on commit a7387e5

Please sign in to comment.