Skip to content

Commit

Permalink
Fix: throw error message
Browse files Browse the repository at this point in the history
  • Loading branch information
robertSt7 committed Dec 14, 2023
1 parent 2530a31 commit 4f4672e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/GraphQL/DataObjectInputProcessor/ManyToManyRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ElementIdentificationTrait;
use Pimcore\Model\DataObject\Concrete;
use Pimcore\Model\DataObject\Fieldcollection\Data\AbstractData;
use Pimcore\Model\Exception\NotFoundException;

class ManyToManyRelation extends Base
{
Expand All @@ -45,6 +46,10 @@ public function process($object, $newValue, $args, $context, ResolveInfo $info)

if ($element) {
$result[] = $element;
} else {
throw new NotFoundException(
"Doesn't found element: " . $newValueItemValue['fullpath'] ?? $newValueItemValue['id']

Check failure on line 51 in src/GraphQL/DataObjectInputProcessor/ManyToManyRelation.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.0, lowest, false)

Expression on left side of ?? is not nullable.

Check failure on line 51 in src/GraphQL/DataObjectInputProcessor/ManyToManyRelation.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.1, highest, true)

Expression on left side of ?? is not nullable.

Check failure on line 51 in src/GraphQL/DataObjectInputProcessor/ManyToManyRelation.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2, highest, true)

Expression on left side of ?? is not nullable.

Check failure on line 51 in src/GraphQL/DataObjectInputProcessor/ManyToManyRelation.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2, highest, 11.x-dev as 11.0.0, true, true)

Expression on left side of ?? is not nullable.
);
}
}
}
Expand Down

0 comments on commit 4f4672e

Please sign in to comment.