Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,332 changes: 174 additions & 1,158 deletions phpstan-baseline.neon

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/contracts/Repository/ContentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function updateContentMetadata(ContentInfo $contentInfo, ContentMetadataU
*
* @return array<int, int> Affected Location IDs (List of Location IDs of the Content that was deleted).
*/
public function deleteContent(ContentInfo $contentInfo): iterable;
public function deleteContent(ContentInfo $contentInfo): array;

/**
* Creates a draft from a published or archived version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function updateContentMetadata(
return $this->innerService->updateContentMetadata($contentInfo, $contentMetadataUpdateStruct);
}

public function deleteContent(ContentInfo $contentInfo): iterable
public function deleteContent(ContentInfo $contentInfo): array
{
return $this->innerService->deleteContent($contentInfo);
}
Expand Down
4 changes: 2 additions & 2 deletions src/contracts/Repository/Decorator/UserServiceDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function loadSubUserGroups(
return $this->innerService->loadSubUserGroups($userGroup, $offset, $limit, $prioritizedLanguages);
}

public function deleteUserGroup(UserGroup $userGroup): iterable
public function deleteUserGroup(UserGroup $userGroup): array
{
return $this->innerService->deleteUserGroup($userGroup);
}
Expand Down Expand Up @@ -134,7 +134,7 @@ public function loadUserByToken(
return $this->innerService->loadUserByToken($hash, $prioritizedLanguages);
}

public function deleteUser(User $user): iterable
public function deleteUser(User $user): array
{
return $this->innerService->deleteUser($user);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

final class BeforeCreateBookmarkEvent extends BeforeEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location */
private $location;
private Location $location;

public function __construct(Location $location)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

final class BeforeDeleteBookmarkEvent extends BeforeEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location */
private $location;
private Location $location;

public function __construct(Location $location)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

final class CreateBookmarkEvent extends AfterEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location */
private $location;
private Location $location;

public function __construct(Location $location)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

final class DeleteBookmarkEvent extends AfterEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location */
private $location;
private Location $location;

public function __construct(Location $location)
{
Expand Down
9 changes: 3 additions & 6 deletions src/contracts/Repository/Events/Content/AddRelationEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@

final class AddRelationEvent extends AfterEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Relation */
private $relation;
private Relation $relation;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo */
private $sourceVersion;
private VersionInfo $sourceVersion;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo */
private $destinationContent;
private ContentInfo $destinationContent;

public function __construct(
Relation $relation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@

final class BeforeAddRelationEvent extends BeforeEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo */
private $sourceVersion;
private VersionInfo $sourceVersion;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo */
private $destinationContent;
private ContentInfo $destinationContent;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Relation|null */
private $relation;
private ?Relation $relation = null;

public function __construct(VersionInfo $sourceVersion, ContentInfo $destinationContent)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,13 @@

final class BeforeCopyContentEvent extends BeforeEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo */
private $contentInfo;
private ContentInfo $contentInfo;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\LocationCreateStruct */
private $destinationLocationCreateStruct;
private LocationCreateStruct $destinationLocationCreateStruct;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo */
private $versionInfo;
private ?VersionInfo $versionInfo;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content|null */
private $content;
private ?Content $content = null;

public function __construct(
ContentInfo $contentInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,15 @@

final class BeforeCreateContentDraftEvent extends BeforeEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo */
private $contentInfo;
private ContentInfo $contentInfo;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo */
private $versionInfo;
private ?VersionInfo $versionInfo;

/** @var \Ibexa\Contracts\Core\Repository\Values\User\User */
private $creator;
private ?User $creator;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Language|null */
private $language;
private ?Language $language;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content|null */
private $contentDraft;
private ?Content $contentDraft = null;

public function __construct(
ContentInfo $contentInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@

final class BeforeCreateContentEvent extends BeforeEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentCreateStruct */
private $contentCreateStruct;
private ContentCreateStruct $contentCreateStruct;

/** @var array */
private $locationCreateStructs;
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\LocationCreateStruct[] */
private array $locationCreateStructs;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content|null */
private $content;
private ?Content $content = null;

/** @var string[]|null */
private $fieldIdentifiersToValidate;
private ?array $fieldIdentifiersToValidate;

public function __construct(
ContentCreateStruct $contentCreateStruct,
Expand All @@ -42,6 +40,9 @@ public function getContentCreateStruct(): ContentCreateStruct
return $this->contentCreateStruct;
}

/**
* @return \Ibexa\Contracts\Core\Repository\Values\Content\LocationCreateStruct[]
*/
public function getLocationCreateStructs(): array
{
return $this->locationCreateStructs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@

final class BeforeDeleteContentEvent extends BeforeEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo */
private $contentInfo;
private ContentInfo $contentInfo;

/** @var array|null */
private $locations;
/** @var int[]|null */
private ?array $locations = null;

public function __construct(ContentInfo $contentInfo)
{
Expand All @@ -30,6 +29,9 @@ public function getContentInfo(): ContentInfo
return $this->contentInfo;
}

/**
* @return int[]
*/
public function getLocations(): array
{
if (!$this->hasLocations()) {
Expand All @@ -39,11 +41,17 @@ public function getLocations(): array
return $this->locations;
}

/**
* @param int[]|null $locations
*/
public function setLocations(?array $locations): void
{
$this->locations = $locations;
}

/**
* @phpstan-assert-if-true !null $this->locations
*/
public function hasLocations(): bool
{
return is_array($this->locations);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@

final class BeforeDeleteRelationEvent extends BeforeEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo */
private $sourceVersion;
private VersionInfo $sourceVersion;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo */
private $destinationContent;
private ContentInfo $destinationContent;

public function __construct(VersionInfo $sourceVersion, ContentInfo $destinationContent)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@

final class BeforeDeleteTranslationEvent extends BeforeEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo */
private $contentInfo;
private ContentInfo $contentInfo;

private $languageCode;
private string $languageCode;

public function __construct(ContentInfo $contentInfo, $languageCode)
public function __construct(ContentInfo $contentInfo, string $languageCode)
{
$this->contentInfo = $contentInfo;
$this->languageCode = $languageCode;
Expand All @@ -29,7 +28,7 @@ public function getContentInfo(): ContentInfo
return $this->contentInfo;
}

public function getLanguageCode()
public function getLanguageCode(): string
{
return $this->languageCode;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

final class BeforeDeleteVersionEvent extends BeforeEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo */
private $versionInfo;
private VersionInfo $versionInfo;

public function __construct(VersionInfo $versionInfo)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

final class BeforeHideContentEvent extends BeforeEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo */
private $contentInfo;
private ContentInfo $contentInfo;

public function __construct(ContentInfo $contentInfo)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@

final class BeforePublishVersionEvent extends BeforeEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo */
private $versionInfo;
private VersionInfo $versionInfo;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content|null */
private $content;
private ?Content $content = null;

/** @var string[] */
private $translations;
private array $translations;

public function __construct(VersionInfo $versionInfo, array $translations)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

final class BeforeRevealContentEvent extends BeforeEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo */
private $contentInfo;
private ContentInfo $contentInfo;

public function __construct(ContentInfo $contentInfo)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@

final class BeforeUpdateContentEvent extends BeforeEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo */
private $versionInfo;
private VersionInfo $versionInfo;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentUpdateStruct */
private $contentUpdateStruct;
private ContentUpdateStruct $contentUpdateStruct;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content|null */
private $content;
private ?Content $content = null;

/** @var string[]|null */
private $fieldIdentifiersToValidate;
private ?array $fieldIdentifiersToValidate;

public function __construct(
VersionInfo $versionInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@

final class BeforeUpdateContentMetadataEvent extends BeforeEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo */
private $contentInfo;
private ContentInfo $contentInfo;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentMetadataUpdateStruct */
private $contentMetadataUpdateStruct;
private ContentMetadataUpdateStruct $contentMetadataUpdateStruct;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content|null */
private $content;
private ?Content $content = null;

public function __construct(ContentInfo $contentInfo, ContentMetadataUpdateStruct $contentMetadataUpdateStruct)
{
Expand Down
12 changes: 4 additions & 8 deletions src/contracts/Repository/Events/Content/CopyContentEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,13 @@

final class CopyContentEvent extends AfterEvent
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content */
private $content;
private Content $content;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo */
private $contentInfo;
private ContentInfo $contentInfo;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\LocationCreateStruct */
private $destinationLocationCreateStruct;
private LocationCreateStruct $destinationLocationCreateStruct;

/** @var \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo */
private $versionInfo;
private ?VersionInfo $versionInfo;

public function __construct(
Content $content,
Expand Down
Loading
Loading