Skip to content

Commit

Permalink
IBX-7055: Allowed to return null when content is not deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
mikadamczyk committed Nov 24, 2023
1 parent 2708c2e commit d1da7ce
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6220,11 +6220,6 @@ parameters:
count: 1
path: src/contracts/Repository/Events/Trash/BeforeRecoverEvent.php

-
message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Events\\\\Trash\\\\BeforeTrashEvent\\:\\:getResult\\(\\) should return Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\TrashItem but returns Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\TrashItem\\|null\\.$#"
count: 1
path: src/contracts/Repository/Events/Trash/BeforeTrashEvent.php

-
message: "#^Property Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Events\\\\Trash\\\\RecoverEvent\\:\\:\\$newParentLocation \\(Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location\\) does not accept Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location\\|null\\.$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/Repository/Events/Trash/BeforeTrashEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getLocation(): Location
return $this->location;
}

public function getResult(): TrashItem
public function getResult(): ?TrashItem
{
if (!$this->isResultSet()) {
throw new UnexpectedValueException(sprintf('Return value is not set or not of type %s (or null). Check isResultSet() or set it using setResult() before you call the getter.', TrashItem::class));
Expand Down

0 comments on commit d1da7ce

Please sign in to comment.