Skip to content

Commit 132c789

Browse files
authored
IBX-9727: Add missing type hints to PAPI events (#557)
* IBX-9727: Changed Ibexa\Contracts\Core\Repository\ContentService::deleteContent return type to array * IBX-9727: Changed \Ibexa\Contracts\Core\Repository\UserService::{deleteUser, deleteUserGroup} return type to array * IBX-9727: Added missing type hints to events
1 parent 7844072 commit 132c789

213 files changed

Lines changed: 819 additions & 2092 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

phpstan-baseline.neon

Lines changed: 174 additions & 1158 deletions
Large diffs are not rendered by default.

src/contracts/Repository/ContentService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public function updateContentMetadata(ContentInfo $contentInfo, ContentMetadataU
223223
*
224224
* @return array<int, int> Affected Location IDs (List of Location IDs of the Content that was deleted).
225225
*/
226-
public function deleteContent(ContentInfo $contentInfo): iterable;
226+
public function deleteContent(ContentInfo $contentInfo): array;
227227

228228
/**
229229
* Creates a draft from a published or archived version.

src/contracts/Repository/Decorator/ContentServiceDecorator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public function updateContentMetadata(
129129
return $this->innerService->updateContentMetadata($contentInfo, $contentMetadataUpdateStruct);
130130
}
131131

132-
public function deleteContent(ContentInfo $contentInfo): iterable
132+
public function deleteContent(ContentInfo $contentInfo): array
133133
{
134134
return $this->innerService->deleteContent($contentInfo);
135135
}

src/contracts/Repository/Decorator/UserServiceDecorator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function loadSubUserGroups(
6565
return $this->innerService->loadSubUserGroups($userGroup, $offset, $limit, $prioritizedLanguages);
6666
}
6767

68-
public function deleteUserGroup(UserGroup $userGroup): iterable
68+
public function deleteUserGroup(UserGroup $userGroup): array
6969
{
7070
return $this->innerService->deleteUserGroup($userGroup);
7171
}
@@ -134,7 +134,7 @@ public function loadUserByToken(
134134
return $this->innerService->loadUserByToken($hash, $prioritizedLanguages);
135135
}
136136

137-
public function deleteUser(User $user): iterable
137+
public function deleteUser(User $user): array
138138
{
139139
return $this->innerService->deleteUser($user);
140140
}

src/contracts/Repository/Events/Bookmark/BeforeCreateBookmarkEvent.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
final class BeforeCreateBookmarkEvent extends BeforeEvent
1515
{
16-
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location */
17-
private $location;
16+
private Location $location;
1817

1918
public function __construct(Location $location)
2019
{

src/contracts/Repository/Events/Bookmark/BeforeDeleteBookmarkEvent.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
final class BeforeDeleteBookmarkEvent extends BeforeEvent
1515
{
16-
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location */
17-
private $location;
16+
private Location $location;
1817

1918
public function __construct(Location $location)
2019
{

src/contracts/Repository/Events/Bookmark/CreateBookmarkEvent.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
final class CreateBookmarkEvent extends AfterEvent
1515
{
16-
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location */
17-
private $location;
16+
private Location $location;
1817

1918
public function __construct(Location $location)
2019
{

src/contracts/Repository/Events/Bookmark/DeleteBookmarkEvent.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
final class DeleteBookmarkEvent extends AfterEvent
1515
{
16-
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location */
17-
private $location;
16+
private Location $location;
1817

1918
public function __construct(Location $location)
2019
{

src/contracts/Repository/Events/Content/AddRelationEvent.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@
1515

1616
final class AddRelationEvent extends AfterEvent
1717
{
18-
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Relation */
19-
private $relation;
18+
private Relation $relation;
2019

21-
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo */
22-
private $sourceVersion;
20+
private VersionInfo $sourceVersion;
2321

24-
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo */
25-
private $destinationContent;
22+
private ContentInfo $destinationContent;
2623

2724
public function __construct(
2825
Relation $relation,

src/contracts/Repository/Events/Content/BeforeAddRelationEvent.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@
1616

1717
final class BeforeAddRelationEvent extends BeforeEvent
1818
{
19-
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo */
20-
private $sourceVersion;
19+
private VersionInfo $sourceVersion;
2120

22-
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo */
23-
private $destinationContent;
21+
private ContentInfo $destinationContent;
2422

25-
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Relation|null */
26-
private $relation;
23+
private ?Relation $relation = null;
2724

2825
public function __construct(VersionInfo $sourceVersion, ContentInfo $destinationContent)
2926
{

0 commit comments

Comments
 (0)