From cf3baf900419499119220af0d8567d67ff132c22 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 17 May 2024 14:13:46 +0200 Subject: [PATCH 01/10] URLAlias.php: Fix misusage of @property-read @property* tags are used for magic properties. https://docs.phpdoc.org/guide/references/phpdoc/tags/property.html @property* tags duplicate property definitions in the output documentation when used to re-declare real properties. --- src/contracts/Repository/Values/Content/URLAlias.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/contracts/Repository/Values/Content/URLAlias.php b/src/contracts/Repository/Values/Content/URLAlias.php index 6e4502ff90..750b433a96 100644 --- a/src/contracts/Repository/Values/Content/URLAlias.php +++ b/src/contracts/Repository/Values/Content/URLAlias.php @@ -12,16 +12,6 @@ /** * This class represents a url alias in the repository. - * - * @property-read string $id A unique identifier for the alias - * @property-read int $type The type of the URL Alias i.e. one of URLAlias::LOCATION, URLAlias::RESOURCE, URLAlias::VIRTUAL - * @property-read mixed $destination If type = URLAlias::LOCATION it is a Location id otherwise a string (e.g. /content/search) - * @property-read string $path the alias path - * @property-read string[] $languageCodes the languages for which this alias is valid - * @property-read bool $alwaysAvailable Fallback indicator for other languages - * @property-read bool $isHistory Indicates that this alias was autogenerated for an in the meanwhile archived version of the content - * @property-read bool $isCustom If false this alias was autogenerated otherwise manuel created - * @property-read bool $forward Indicates if the url should be redirected */ class URLAlias extends ValueObject { From d2e6bf908c551c14789865def158339f18b90afe Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 17 May 2024 14:21:55 +0200 Subject: [PATCH 02/10] Fix misusage of @property-read @property* tags are used for magic properties. https://docs.phpdoc.org/guide/references/phpdoc/tags/property.html @property* tags duplicate property definitions in the output documentation when used to re-declare real properties. --- src/contracts/Limitation/Target/Version.php | 8 -------- src/contracts/Repository/Values/Content/Field.php | 6 ------ src/contracts/Repository/Values/Content/Language.php | 11 +++++------ src/contracts/Search/Field.php | 4 ---- src/contracts/Variation/Values/ImageVariation.php | 7 ------- 5 files changed, 5 insertions(+), 31 deletions(-) diff --git a/src/contracts/Limitation/Target/Version.php b/src/contracts/Limitation/Target/Version.php index 196dae3949..e5046e6846 100644 --- a/src/contracts/Limitation/Target/Version.php +++ b/src/contracts/Limitation/Target/Version.php @@ -13,14 +13,6 @@ /** * Version Limitation target. Indicates an intent to create new Version. - * - * @property-read string[] $allLanguageCodesList - * @property-read int[] $allContentTypeIdsList - * @property-read int $newStatus - * @property-read string $forUpdateInitialLanguageCode - * @property-read string[] $forUpdateLanguageCodesList - * @property-read string[] $forPublishLanguageCodesList - * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\Field[] $updatedFields */ final class Version extends ValueObject implements Target { diff --git a/src/contracts/Repository/Values/Content/Field.php b/src/contracts/Repository/Values/Content/Field.php index 6114c1c479..1648e2dd9f 100644 --- a/src/contracts/Repository/Values/Content/Field.php +++ b/src/contracts/Repository/Values/Content/Field.php @@ -12,12 +12,6 @@ /** * This class represents a field of a content object. - * - * @property-read mixed $id an internal id of the field - * @property-read string $fieldDefIdentifier the field definition identifier - * @property-read mixed $value the value of the field - * @property-read string $languageCode the language code of the field - * @property-read string $fieldTypeIdentifier field type identifier */ class Field extends ValueObject { diff --git a/src/contracts/Repository/Values/Content/Language.php b/src/contracts/Repository/Values/Content/Language.php index 0594395ab0..d27d332a83 100644 --- a/src/contracts/Repository/Values/Content/Language.php +++ b/src/contracts/Repository/Values/Content/Language.php @@ -12,11 +12,6 @@ /** * This class represents a language in the repository. - * - * @property-read mixed $id the language id - * @property-read string $languageCode the language code in - * @property-read string $name human readable name of the language - * @property-read bool $enabled indicates if the language is enabled or not. */ class Language extends ValueObject { @@ -42,7 +37,11 @@ class Language extends ValueObject */ protected $name; - /** @var bool */ + /** + * Indicates if the language is enabled or not. + * + * @var bool + */ protected $enabled; public function getId(): int diff --git a/src/contracts/Search/Field.php b/src/contracts/Search/Field.php index 54245d2aa6..66285ef1c2 100644 --- a/src/contracts/Search/Field.php +++ b/src/contracts/Search/Field.php @@ -10,10 +10,6 @@ /** * Base class for document fields. - * - * @property-read $name - * @property-read $value - * @property-read $type */ class Field extends ValueObject { diff --git a/src/contracts/Variation/Values/ImageVariation.php b/src/contracts/Variation/Values/ImageVariation.php index 980808f723..1d11a97bb6 100644 --- a/src/contracts/Variation/Values/ImageVariation.php +++ b/src/contracts/Variation/Values/ImageVariation.php @@ -6,13 +6,6 @@ */ namespace Ibexa\Contracts\Core\Variation\Values; -/** - * @property-read int|null $width The width as number of pixels (for example "320") - * @property-read int|null $height The height as number of pixels (for example "256") - * @property-read string $name The name of the image alias (for example "original") - * @property-read mixed $info Extra information about the image, depending on the image type - * @property-read mixed $imageId - */ class ImageVariation extends Variation { /** From dc868a301113f27bd8873dddeca2bb781700d2ad Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 17 May 2024 15:14:15 +0200 Subject: [PATCH 03/10] Location.php: Fix misusage of @property-read @property* tags are used for magic properties. https://docs.phpdoc.org/guide/references/phpdoc/tags/property.html @property* tags duplicate property definitions in the output documentation when used to re-declare real properties. --- src/contracts/Repository/Values/Content/Location.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index 72c5348002..6f3f98fd10 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -17,18 +17,7 @@ * * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo calls getContentInfo() * @property-read int $contentId calls getContentInfo()->id - * @property-read int $id the id of the location - * @property-read int $priority Position of the Location among its siblings when sorted using priority - * @property-read bool $hidden Indicates that the Location entity is hidden (explicitly or hidden by content). - * @property-read bool $invisible Indicates that the Location is not visible, being either marked as hidden itself, or implicitly hidden by its Content or an ancestor Location - * @property-read bool $explicitlyHidden Indicates that the Location entity has been explicitly marked as hidden. - * @property-read string $remoteId a global unique id of the content object - * @property-read int $parentLocationId the id of the parent location - * @property-read string $pathString @deprecated use {@see Location::getPathString()} instead. * @property-read array $path Same as $pathString but as array, e.g. [ 1, 2, 4, 23 ] - * @property-read int $depth Depth location has in the location tree - * @property-read int $sortField Specifies which property the child locations should be sorted on. Valid values are found at {@link Location::SORT_FIELD_*} - * @property-read int $sortOrder Specifies whether the sort order should be ascending or descending. Valid values are {@link Location::SORT_ORDER_*} */ abstract class Location extends ValueObject { From dbbf64288b4b1ac045828d53e3182c4daadc3518 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 17 May 2024 15:48:09 +0200 Subject: [PATCH 04/10] Fix misusage of @property-read @property* tags are used for magic properties. https://docs.phpdoc.org/guide/references/phpdoc/tags/property.html @property* tags duplicate property definitions in the output documentation when used to re-declare real properties. --- .../Repository/Values/Content/ContentInfo.php | 16 ---------------- .../Repository/Values/Content/LocationList.php | 4 ---- .../Repository/Values/Content/Relation.php | 3 --- .../Repository/Values/Content/Section.php | 4 ---- .../Repository/Values/Content/Thumbnail.php | 6 ------ .../Repository/Values/Content/URLWildcard.php | 5 ----- .../Content/URLWildcardTranslationResult.php | 3 --- .../Repository/Values/Content/VersionInfo.php | 8 -------- .../Values/ContentType/ContentType.php | 15 --------------- .../Values/ContentType/ContentTypeGroup.php | 7 ------- .../Values/ContentType/FieldDefinition.php | 12 ------------ .../Values/Notification/Notification.php | 7 ------- .../Values/ObjectState/ObjectState.php | 4 ---- .../Values/ObjectState/ObjectStateGroup.php | 4 ---- .../Repository/Values/Setting/Setting.php | 5 ----- .../Values/User/PasswordValidationContext.php | 3 --- src/contracts/Repository/Values/User/Policy.php | 4 ---- src/contracts/Repository/Values/User/Role.php | 2 -- src/contracts/Repository/Values/User/User.php | 8 -------- .../Repository/Values/User/UserGroup.php | 2 -- .../Values/UserPreference/UserPreference.php | 3 --- src/contracts/Search/FieldType.php | 2 -- src/contracts/Variation/Values/Variation.php | 7 ------- 23 files changed, 134 deletions(-) diff --git a/src/contracts/Repository/Values/Content/ContentInfo.php b/src/contracts/Repository/Values/Content/ContentInfo.php index 6a7a4e13c9..dd56a66034 100644 --- a/src/contracts/Repository/Values/Content/ContentInfo.php +++ b/src/contracts/Repository/Values/Content/ContentInfo.php @@ -14,22 +14,6 @@ /** * This class provides all version independent information of the Content object. - * - * @property-read int $id @deprecated Use {@see ContentInfo::getId} instead. The unique id of the Content object - * @property-read int $contentTypeId The unique id of the content type item the Content object is an instance of - * @property-read string $name the computed name (via name schema) in the main language of the Content object - * @property-read int $sectionId @deprecated 4.6.2 Use {@see ContentInfo::getSectionId} instead. The section to which the Content object is assigned - * @property-read int $currentVersionNo Current Version number is the version number of the published version or the version number of a newly created draft (which is 1). - * @property-read bool $published true if there exists a published version false otherwise - * @property-read int $ownerId the user id of the owner of the Content object - * @property-read \DateTime $modificationDate Content object modification date - * @property-read \DateTime $publishedDate date of the first publish - * @property-read bool $alwaysAvailable Indicates if the Content object is shown in the mainlanguage if its not present in an other requested language - * @property-read string $remoteId a global unique id of the Content object - * @property-read string $mainLanguageCode The main language code of the Content object. If the available flag is set to true the Content is shown in this language if the requested language does not exist. - * @property-read int|null $mainLocationId @deprecated Use {@see ContentInfo::getMainLocationId} instead - * @property-read int $status status of the Content object - * @property-read bool $isHidden status of the Content object */ class ContentInfo extends ValueObject { diff --git a/src/contracts/Repository/Values/Content/LocationList.php b/src/contracts/Repository/Values/Content/LocationList.php index cf6d624d33..085a4a0d46 100644 --- a/src/contracts/Repository/Values/Content/LocationList.php +++ b/src/contracts/Repository/Values/Content/LocationList.php @@ -17,10 +17,6 @@ /** * This class represents a queried location list holding a totalCount and a partial list of locations * (by offset/limit parameters and permission filters). - * - * @property-read int $totalCount - the total count of found locations (filtered by permissions) - * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\Location[] $locations - the partial list of - * Locations controlled by offset/limit. **/ class LocationList extends ValueObject implements IteratorAggregate, TotalCountAwareInterface { diff --git a/src/contracts/Repository/Values/Content/Relation.php b/src/contracts/Repository/Values/Content/Relation.php index 7922e4f8fa..f956a80546 100644 --- a/src/contracts/Repository/Values/Content/Relation.php +++ b/src/contracts/Repository/Values/Content/Relation.php @@ -13,11 +13,8 @@ /** * Class representing a relation between content. * - * @property-read mixed $id the internal id of the relation - * @property-read string $sourceFieldDefinitionIdentifier the field definition identifier of the field where this relation is anchored if the relation is of type EMBED, LINK, or ATTRIBUTE * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $sourceContentInfo - calls {@link getSourceContentInfo()} * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $destinationContentInfo - calls {@link getDestinationContentInfo()} - * @property-read int $type The relation type bitmask containing one or more of Relation::COMMON, Relation::EMBED, Relation::LINK, Relation::FIELD */ abstract class Relation extends ValueObject { diff --git a/src/contracts/Repository/Values/Content/Section.php b/src/contracts/Repository/Values/Content/Section.php index 959b5ef953..709d689b47 100644 --- a/src/contracts/Repository/Values/Content/Section.php +++ b/src/contracts/Repository/Values/Content/Section.php @@ -12,10 +12,6 @@ /** * This class represents a section. - * - * @property-read mixed $id the id of the section - * @property-read string $identifier the identifier of the section - * @property-read string $name human readable name of the section */ class Section extends ValueObject { diff --git a/src/contracts/Repository/Values/Content/Thumbnail.php b/src/contracts/Repository/Values/Content/Thumbnail.php index 80caed993e..4034b98ce3 100644 --- a/src/contracts/Repository/Values/Content/Thumbnail.php +++ b/src/contracts/Repository/Values/Content/Thumbnail.php @@ -10,12 +10,6 @@ use Ibexa\Contracts\Core\Repository\Values\ValueObject; -/** - * @property-read string $resource - * @property-read int|null $width - * @property-read int|null $height - * @property-read string|null $mimeType - */ class Thumbnail extends ValueObject { /** diff --git a/src/contracts/Repository/Values/Content/URLWildcard.php b/src/contracts/Repository/Values/Content/URLWildcard.php index 6a624e0808..3e7ea70955 100644 --- a/src/contracts/Repository/Values/Content/URLWildcard.php +++ b/src/contracts/Repository/Values/Content/URLWildcard.php @@ -12,11 +12,6 @@ /** * This class represents a url alias in the repository. - * - * @property-read mixed $id A unique identifier for the alias - * @property-read string $sourceUrl The source url with wildcards - * @property-read string $destinationUrl The destination URL with placeholders - * @property-read bool $forward indicates if the url is redirected or not */ class URLWildcard extends ValueObject { diff --git a/src/contracts/Repository/Values/Content/URLWildcardTranslationResult.php b/src/contracts/Repository/Values/Content/URLWildcardTranslationResult.php index ccdf0e1ae0..71b6ef9133 100644 --- a/src/contracts/Repository/Values/Content/URLWildcardTranslationResult.php +++ b/src/contracts/Repository/Values/Content/URLWildcardTranslationResult.php @@ -12,9 +12,6 @@ /** * This class represents a result of a translated url wildcard which is not an URLAlias. - * - * @property-read string $uri The found resource uri - * @property-read bool $forward indicates if the url is redirected or not */ class URLWildcardTranslationResult extends ValueObject { diff --git a/src/contracts/Repository/Values/Content/VersionInfo.php b/src/contracts/Repository/Values/Content/VersionInfo.php index f416251c89..4c2ac0442f 100644 --- a/src/contracts/Repository/Values/Content/VersionInfo.php +++ b/src/contracts/Repository/Values/Content/VersionInfo.php @@ -17,14 +17,6 @@ * which the version belongs to. * * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo calls getContentInfo() - * @property-read mixed $id the internal id of the version - * @property-read int $versionNo the version number of this version (which only increments in scope of a single Content object) - * @property-read \DateTime $modificationDate the last modified date of this version - * @property-read \DateTime $creationDate the creation date of this version - * @property-read mixed $creatorId the user id of the user which created this version - * @property-read int $status the status of this version. One of VersionInfo::STATUS_DRAFT, VersionInfo::STATUS_PUBLISHED, VersionInfo::STATUS_ARCHIVED - * @property-read string $initialLanguageCode the language code of the version. This value is used to flag a version as a translation to specific language - * @property-read string[] $languageCodes a collection of all languages which exist in this version. */ abstract class VersionInfo extends ValueObject implements MultiLanguageName { diff --git a/src/contracts/Repository/Values/ContentType/ContentType.php b/src/contracts/Repository/Values/ContentType/ContentType.php index 3fdf59c188..d7dce3a224 100644 --- a/src/contracts/Repository/Values/ContentType/ContentType.php +++ b/src/contracts/Repository/Values/ContentType/ContentType.php @@ -17,22 +17,7 @@ * * @property-read \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup[] $contentTypeGroups calls getContentTypeGroups * @property-read \Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinitionCollection $fieldDefinitions calls getFieldDefinitions() or on access getFieldDefinition($fieldDefIdentifier) - * @property-read mixed $id the id of the content type - * @property-read int $status the status of the content type. One of ContentType::STATUS_DEFINED|ContentType::STATUS_DRAFT|ContentType::STATUS_MODIFIED - * @property-read string $identifier the identifier of the content type - * @property-read \DateTime $creationDate the date of the creation of this content type - * @property-read \DateTime $modificationDate the date of the last modification of this content type - * @property-read mixed $creatorId the user id of the creator of this content type - * @property-read mixed $modifierId the user id of the user which has last modified this content type - * @property-read string $remoteId a global unique id of the content object - * @property-read string $urlAliasSchema URL alias schema. If nothing is provided, $nameSchema will be used instead. - * @property-read string $nameSchema The name schema. - * @property-read bool $isContainer @deprecated use strict getter {@see ContentType::isContainer} instead. * @property-read string $mainLanguageCode the main language of the content type names and description used for fallback. - * @property-read bool $defaultAlwaysAvailable if an instance of a content type is created the always available flag is set by default this this value. - * @property-read string[] $languageCodes array of language codes used by content type translations. - * @property-read int $defaultSortField Specifies which property the child locations should be sorted on by default when created. Valid values are found at {@link Location::SORT_FIELD_*} - * @property-read int $defaultSortOrder Specifies whether the sort order should be ascending or descending by default when created. Valid values are {@link Location::SORT_ORDER_*} */ abstract class ContentType extends ValueObject implements MultiLanguageName, MultiLanguageDescription { diff --git a/src/contracts/Repository/Values/ContentType/ContentTypeGroup.php b/src/contracts/Repository/Values/ContentType/ContentTypeGroup.php index 4d8b4e1490..aee9fb05c6 100644 --- a/src/contracts/Repository/Values/ContentType/ContentTypeGroup.php +++ b/src/contracts/Repository/Values/ContentType/ContentTypeGroup.php @@ -14,13 +14,6 @@ /** * This class represents a content type group value. - * - * @property-read mixed $id the id of the content type group - * @property-read string $identifier the identifier of the content type group - * @property-read \DateTime $creationDate the date of the creation of this content type group - * @property-read \DateTime $modificationDate the date of the last modification of this content type group - * @property-read mixed $creatorId the user id of the creator of this content type group - * @property-read mixed $modifierId the user id of the user which has last modified this content type group */ abstract class ContentTypeGroup extends ValueObject implements MultiLanguageName, MultiLanguageDescription { diff --git a/src/contracts/Repository/Values/ContentType/FieldDefinition.php b/src/contracts/Repository/Values/ContentType/FieldDefinition.php index f27f93bb68..497d0e45aa 100644 --- a/src/contracts/Repository/Values/ContentType/FieldDefinition.php +++ b/src/contracts/Repository/Values/ContentType/FieldDefinition.php @@ -17,18 +17,6 @@ * * @property-read array $fieldSettings calls getFieldSettings() * @property-read array $validatorConfiguration calls getValidatorConfiguration() - * @property-read int $id the id of the field definition - * @property-read string $identifier the identifier of the field definition - * @property-read string $fieldGroup the field group name - * @property-read int $position the position of the field definition in the content type - * @property-read string $fieldTypeIdentifier String identifier of the field type - * @property-read bool $isTranslatable indicates if fields of this definition are translatable - * @property-read bool $isRequired indicates if this field is required in the content object - * @property-read bool $isSearchable indicates if the field is searchable - * @property-read bool $isThumbnail indicates if the field can be thumbnail - * @property-read bool $isInfoCollector indicates if this field is used for information collection - * @property-read mixed $defaultValue the default value of the field - * @property-read string $mainLanguageCode main Translation (language code) of a multilingual Field Definition */ abstract class FieldDefinition extends ValueObject implements MultiLanguageName, MultiLanguageDescription { diff --git a/src/contracts/Repository/Values/Notification/Notification.php b/src/contracts/Repository/Values/Notification/Notification.php index d99042b121..593773b19b 100644 --- a/src/contracts/Repository/Values/Notification/Notification.php +++ b/src/contracts/Repository/Values/Notification/Notification.php @@ -12,13 +12,6 @@ /** * This class represents a notification value. - * - * @property-read int $id The ID of notification - * @property-read int $ownerId The ID of notification owner - * @property-read bool $isPending True if notification is unreaded - * @property-read string $type Notification type - * @property-read \DateTimeInterface $created Creation date. - * @property-read array $data Optional context data */ class Notification extends ValueObject { diff --git a/src/contracts/Repository/Values/ObjectState/ObjectState.php b/src/contracts/Repository/Values/ObjectState/ObjectState.php index f4c8c6e331..72adbd1429 100644 --- a/src/contracts/Repository/Values/ObjectState/ObjectState.php +++ b/src/contracts/Repository/Values/ObjectState/ObjectState.php @@ -15,11 +15,7 @@ /** * This class represents a object state value. * - * @property-read mixed $id the id of the content type group - * @property-read string $identifier the identifier of the content type group - * @property-read int $priority the priority in the group ordering * @property-read string $mainLanguageCode the default language of the object state names and descriptions used for fallback. - * @property-read string[] $languageCodes the available languages */ abstract class ObjectState extends ValueObject implements MultiLanguageName, MultiLanguageDescription { diff --git a/src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php b/src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php index 0524cca46d..f45d77cec8 100644 --- a/src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php +++ b/src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php @@ -15,11 +15,7 @@ /** * This class represents an object state group value. * - * @property-read mixed $id the id of the content type group - * @property-read string $identifier the identifier of the content type group * @property-read string $mainLanguageCode the default language of the object state group names and description used for fallback. - * @property-read string $defaultLanguageCode the default language code. - * @property-read string[] $languageCodes the available languages */ abstract class ObjectStateGroup extends ValueObject implements MultiLanguageName, MultiLanguageDescription { diff --git a/src/contracts/Repository/Values/Setting/Setting.php b/src/contracts/Repository/Values/Setting/Setting.php index d22d616713..b2c8fb05a0 100644 --- a/src/contracts/Repository/Values/Setting/Setting.php +++ b/src/contracts/Repository/Values/Setting/Setting.php @@ -10,11 +10,6 @@ use Ibexa\Contracts\Core\Repository\Values\ValueObject; -/** - * @property-read string $group - * @property-read string $identifier - * @property-read mixed $value - */ class Setting extends ValueObject { /** @var string */ diff --git a/src/contracts/Repository/Values/User/PasswordValidationContext.php b/src/contracts/Repository/Values/User/PasswordValidationContext.php index de81c4ca0c..2af25774d5 100644 --- a/src/contracts/Repository/Values/User/PasswordValidationContext.php +++ b/src/contracts/Repository/Values/User/PasswordValidationContext.php @@ -12,9 +12,6 @@ /** * Context of the password validation. - * - * @property-read \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType|null $contentType - * @property-read \Ibexa\Contracts\Core\Repository\Values\User\User|null $user */ class PasswordValidationContext extends ValueObject { diff --git a/src/contracts/Repository/Values/User/Policy.php b/src/contracts/Repository/Values/User/Policy.php index 04c4be5d5a..ccbeaeabb4 100644 --- a/src/contracts/Repository/Values/User/Policy.php +++ b/src/contracts/Repository/Values/User/Policy.php @@ -13,10 +13,6 @@ /** * This class represents a policy value. * - * @property-read mixed $id internal id of the policy - * @property-read mixed $roleId the role id this policy belongs to - * @property-read string $module Name of module, associated with the Policy - * @property-read string $function Name of the module function Or all functions with '*' * @property-read \Ibexa\Contracts\Core\Repository\Values\User\Limitation[] $limitations an array of \Ibexa\Contracts\Core\Repository\Values\User\Limitation */ abstract class Policy extends ValueObject diff --git a/src/contracts/Repository/Values/User/Role.php b/src/contracts/Repository/Values/User/Role.php index 032c2284fc..5206c6c45f 100644 --- a/src/contracts/Repository/Values/User/Role.php +++ b/src/contracts/Repository/Values/User/Role.php @@ -13,8 +13,6 @@ /** * This class represents a role. * - * @property-read int $id the internal id of the role - * @property-read string $identifier the identifier of the role * @property-read \Ibexa\Contracts\Core\Repository\Values\User\Policy[] $policies an array of the policies {@link \Ibexa\Contracts\Core\Repository\Values\User\Policy} of the role. */ abstract class Role extends ValueObject diff --git a/src/contracts/Repository/Values/User/User.php b/src/contracts/Repository/Values/User/User.php index cb970e20c0..7d367d9b17 100644 --- a/src/contracts/Repository/Values/User/User.php +++ b/src/contracts/Repository/Values/User/User.php @@ -12,14 +12,6 @@ /** * This class represents a user value. - * - * @property-read string $login - * @property-read string $email - * @property-read string $passwordHash - * @property-read string $hashAlgorithm Hash algorithm used to hash the password - * @property-read \DateTimeInterface|null $passwordUpdatedAt - * @property-read bool $enabled User can not login if false - * @property-read int $maxLogin Max number of time user is allowed to login */ abstract class User extends Content implements UserReference { diff --git a/src/contracts/Repository/Values/User/UserGroup.php b/src/contracts/Repository/Values/User/UserGroup.php index f04be77fc1..4f8aecca65 100644 --- a/src/contracts/Repository/Values/User/UserGroup.php +++ b/src/contracts/Repository/Values/User/UserGroup.php @@ -12,8 +12,6 @@ /** * This class represents a user group. - * - * @property-read mixed $parentId */ abstract class UserGroup extends Content { diff --git a/src/contracts/Repository/Values/UserPreference/UserPreference.php b/src/contracts/Repository/Values/UserPreference/UserPreference.php index a3c6bb3f6c..ae79cad91f 100644 --- a/src/contracts/Repository/Values/UserPreference/UserPreference.php +++ b/src/contracts/Repository/Values/UserPreference/UserPreference.php @@ -12,9 +12,6 @@ /** * This class represents a user preference value. - * - * @property-read string $name name of user preference - * @property-read string $value value of user preference */ class UserPreference extends ValueObject { diff --git a/src/contracts/Search/FieldType.php b/src/contracts/Search/FieldType.php index 5163df332c..034e52ef7d 100644 --- a/src/contracts/Search/FieldType.php +++ b/src/contracts/Search/FieldType.php @@ -10,8 +10,6 @@ /** * Base class for document field definitions. - * - * @property-read string $type [deprecated] The type name of the facet, deprecated - use {@see \Ibexa\Contracts\Core\Search\FieldType::getType} instead. */ abstract class FieldType extends ValueObject { diff --git a/src/contracts/Variation/Values/Variation.php b/src/contracts/Variation/Values/Variation.php index ec373e1890..1c78df20b2 100644 --- a/src/contracts/Variation/Values/Variation.php +++ b/src/contracts/Variation/Values/Variation.php @@ -10,13 +10,6 @@ /** * Base class for file variations (i.e. image aliases). - * - * @property-read int $fileSize Number of bytes for current variation - * @property-read string $mimeType The MIME type (for example "image/png") - * @property-read string $fileName The name of the file (for example "my_image.png") - * @property-read string $dirPath The path to the file (for example "var/storage/images/test/199-2-eng-GB") - * @property-read string $uri Complete path + name of image file (for example "var/storage/images/test/199-2-eng-GB/apple.png") - * @property-read \DateTime $lastModified When the variation was last modified */ class Variation extends ValueObject { From 48e850d2805956cffaf9668fb1df9f038fe61e4e Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 17 May 2024 16:12:15 +0200 Subject: [PATCH 05/10] Version.php: Test @phpstan-property-read --- src/contracts/Limitation/Target/Version.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/contracts/Limitation/Target/Version.php b/src/contracts/Limitation/Target/Version.php index e5046e6846..b68f3a4869 100644 --- a/src/contracts/Limitation/Target/Version.php +++ b/src/contracts/Limitation/Target/Version.php @@ -13,6 +13,14 @@ /** * Version Limitation target. Indicates an intent to create new Version. + * + * @phpstan-property-read string[] $allLanguageCodesList + * @phpstan-property-read int[] $allContentTypeIdsList + * @phpstan-property-read int $newStatus + * @phpstan-property-read string $forUpdateInitialLanguageCode + * @phpstan-property-read string[] $forUpdateLanguageCodesList + * @phpstan-property-read string[] $forPublishLanguageCodesList + * @phpstan-property-read \Ibexa\Contracts\Core\Repository\Values\Content\Field[] $updatedFields */ final class Version extends ValueObject implements Target { From 9627080289301aab2d68dfc9985be29483aae5fe Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 17 May 2024 16:25:48 +0200 Subject: [PATCH 06/10] Use @phpstan-property-read --- .../Repository/Values/Content/ContentInfo.php | 16 ++++++++++++++++ .../Repository/Values/Content/Field.php | 6 ++++++ .../Repository/Values/Content/Language.php | 5 +++++ .../Repository/Values/Content/Location.php | 11 +++++++++++ .../Repository/Values/Content/LocationList.php | 4 ++++ .../Repository/Values/Content/Relation.php | 3 +++ .../Repository/Values/Content/Section.php | 4 ++++ .../Repository/Values/Content/Thumbnail.php | 6 ++++++ .../Repository/Values/Content/URLAlias.php | 10 ++++++++++ .../Repository/Values/Content/URLWildcard.php | 5 +++++ .../Content/URLWildcardTranslationResult.php | 3 +++ .../Repository/Values/Content/VersionInfo.php | 8 ++++++++ .../Values/ContentType/ContentType.php | 15 +++++++++++++++ .../Values/ContentType/ContentTypeGroup.php | 7 +++++++ .../Values/ContentType/FieldDefinition.php | 12 ++++++++++++ .../Values/Notification/Notification.php | 7 +++++++ .../Values/ObjectState/ObjectState.php | 4 ++++ .../Values/ObjectState/ObjectStateGroup.php | 4 ++++ .../Repository/Values/Setting/Setting.php | 5 +++++ .../Values/User/PasswordValidationContext.php | 3 +++ src/contracts/Repository/Values/User/Policy.php | 4 ++++ src/contracts/Repository/Values/User/Role.php | 2 ++ src/contracts/Repository/Values/User/User.php | 8 ++++++++ .../Repository/Values/User/UserGroup.php | 2 ++ .../Values/UserPreference/UserPreference.php | 3 +++ src/contracts/Search/Field.php | 4 ++++ src/contracts/Search/FieldType.php | 2 ++ .../Variation/Values/ImageVariation.php | 7 +++++++ src/contracts/Variation/Values/Variation.php | 7 +++++++ 29 files changed, 177 insertions(+) diff --git a/src/contracts/Repository/Values/Content/ContentInfo.php b/src/contracts/Repository/Values/Content/ContentInfo.php index dd56a66034..8b56c0370d 100644 --- a/src/contracts/Repository/Values/Content/ContentInfo.php +++ b/src/contracts/Repository/Values/Content/ContentInfo.php @@ -14,6 +14,22 @@ /** * This class provides all version independent information of the Content object. + * + * @phpstan-property-read int $id @deprecated Use {@see ContentInfo::getId} instead. The unique id of the Content object + * @phpstan-property-read int $contentTypeId The unique id of the content type item the Content object is an instance of + * @phpstan-property-read string $name the computed name (via name schema) in the main language of the Content object + * @phpstan-property-read int $sectionId @deprecated 4.6.2 Use {@see ContentInfo::getSectionId} instead. The section to which the Content object is assigned + * @phpstan-property-read int $currentVersionNo Current Version number is the version number of the published version or the version number of a newly created draft (which is 1). + * @phpstan-property-read bool $published true if there exists a published version false otherwise + * @phpstan-property-read int $ownerId the user id of the owner of the Content object + * @phpstan-property-read \DateTime $modificationDate Content object modification date + * @phpstan-property-read \DateTime $publishedDate date of the first publish + * @phpstan-property-read bool $alwaysAvailable Indicates if the Content object is shown in the mainlanguage if its not present in an other requested language + * @phpstan-property-read string $remoteId a global unique id of the Content object + * @phpstan-property-read string $mainLanguageCode The main language code of the Content object. If the available flag is set to true the Content is shown in this language if the requested language does not exist. + * @phpstan-property-read int|null $mainLocationId @deprecated Use {@see ContentInfo::getMainLocationId} instead + * @phpstan-property-read int $status status of the Content object + * @phpstan-property-read bool $isHidden status of the Content object */ class ContentInfo extends ValueObject { diff --git a/src/contracts/Repository/Values/Content/Field.php b/src/contracts/Repository/Values/Content/Field.php index 1648e2dd9f..978e8f07df 100644 --- a/src/contracts/Repository/Values/Content/Field.php +++ b/src/contracts/Repository/Values/Content/Field.php @@ -12,6 +12,12 @@ /** * This class represents a field of a content object. + * + * @phpstan-property-read mixed $id an internal id of the field + * @phpstan-property-read string $fieldDefIdentifier the field definition identifier + * @phpstan-property-read mixed $value the value of the field + * @phpstan-property-read string $languageCode the language code of the field + * @phpstan-property-read string $fieldTypeIdentifier field type identifier */ class Field extends ValueObject { diff --git a/src/contracts/Repository/Values/Content/Language.php b/src/contracts/Repository/Values/Content/Language.php index d27d332a83..67ebdcecf1 100644 --- a/src/contracts/Repository/Values/Content/Language.php +++ b/src/contracts/Repository/Values/Content/Language.php @@ -12,6 +12,11 @@ /** * This class represents a language in the repository. + * + * @phpstan-property-read mixed $id the language id + * @phpstan-property-read string $languageCode the language code in + * @phpstan-property-read string $name human readable name of the language + * @phpstan-property-read bool $enabled indicates if the language is enabled or not. */ class Language extends ValueObject { diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index 6f3f98fd10..a6229199cb 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -17,7 +17,18 @@ * * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo calls getContentInfo() * @property-read int $contentId calls getContentInfo()->id + * @phpstan-property-read int $id the id of the location + * @phpstan-property-read int $priority Position of the Location among its siblings when sorted using priority + * @phpstan-property-read bool $hidden Indicates that the Location entity is hidden (explicitly or hidden by content). + * @phpstan-property-read bool $invisible Indicates that the Location is not visible, being either marked as hidden itself, or implicitly hidden by its Content or an ancestor Location + * @phpstan-property-read bool $explicitlyHidden Indicates that the Location entity has been explicitly marked as hidden. + * @phpstan-property-read string $remoteId a global unique id of the content object + * @phpstan-property-read int $parentLocationId the id of the parent location + * @phpstan-property-read string $pathString @deprecated use {@see Location::getPathString()} instead. * @property-read array $path Same as $pathString but as array, e.g. [ 1, 2, 4, 23 ] + * @phpstan-property-read int $depth Depth location has in the location tree + * @phpstan-property-read int $sortField Specifies which property the child locations should be sorted on. Valid values are found at {@link Location::SORT_FIELD_*} + * @phpstan-property-read int $sortOrder Specifies whether the sort order should be ascending or descending. Valid values are {@link Location::SORT_ORDER_*} */ abstract class Location extends ValueObject { diff --git a/src/contracts/Repository/Values/Content/LocationList.php b/src/contracts/Repository/Values/Content/LocationList.php index 085a4a0d46..1cca89ef88 100644 --- a/src/contracts/Repository/Values/Content/LocationList.php +++ b/src/contracts/Repository/Values/Content/LocationList.php @@ -17,6 +17,10 @@ /** * This class represents a queried location list holding a totalCount and a partial list of locations * (by offset/limit parameters and permission filters). + * + * @phpstan-property-read int $totalCount - the total count of found locations (filtered by permissions) + * @phpstan-property-read \Ibexa\Contracts\Core\Repository\Values\Content\Location[] $locations - the partial list of + * Locations controlled by offset/limit. **/ class LocationList extends ValueObject implements IteratorAggregate, TotalCountAwareInterface { diff --git a/src/contracts/Repository/Values/Content/Relation.php b/src/contracts/Repository/Values/Content/Relation.php index f956a80546..a6e3aaf1a0 100644 --- a/src/contracts/Repository/Values/Content/Relation.php +++ b/src/contracts/Repository/Values/Content/Relation.php @@ -13,8 +13,11 @@ /** * Class representing a relation between content. * + * @phpstan-property-read mixed $id the internal id of the relation + * @phpstan-property-read string $sourceFieldDefinitionIdentifier the field definition identifier of the field where this relation is anchored if the relation is of type EMBED, LINK, or ATTRIBUTE * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $sourceContentInfo - calls {@link getSourceContentInfo()} * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $destinationContentInfo - calls {@link getDestinationContentInfo()} + * @phpstan-property-read int $type The relation type bitmask containing one or more of Relation::COMMON, Relation::EMBED, Relation::LINK, Relation::FIELD */ abstract class Relation extends ValueObject { diff --git a/src/contracts/Repository/Values/Content/Section.php b/src/contracts/Repository/Values/Content/Section.php index 709d689b47..07df9ebf7f 100644 --- a/src/contracts/Repository/Values/Content/Section.php +++ b/src/contracts/Repository/Values/Content/Section.php @@ -12,6 +12,10 @@ /** * This class represents a section. + * + * @phpstan-property-read mixed $id the id of the section + * @phpstan-property-read string $identifier the identifier of the section + * @phpstan-property-read string $name human readable name of the section */ class Section extends ValueObject { diff --git a/src/contracts/Repository/Values/Content/Thumbnail.php b/src/contracts/Repository/Values/Content/Thumbnail.php index 4034b98ce3..f11bbbe307 100644 --- a/src/contracts/Repository/Values/Content/Thumbnail.php +++ b/src/contracts/Repository/Values/Content/Thumbnail.php @@ -10,6 +10,12 @@ use Ibexa\Contracts\Core\Repository\Values\ValueObject; +/** + * @phpstan-property-read string $resource + * @phpstan-property-read int|null $width + * @phpstan-property-read int|null $height + * @phpstan-property-read string|null $mimeType + */ class Thumbnail extends ValueObject { /** diff --git a/src/contracts/Repository/Values/Content/URLAlias.php b/src/contracts/Repository/Values/Content/URLAlias.php index 750b433a96..960f64518d 100644 --- a/src/contracts/Repository/Values/Content/URLAlias.php +++ b/src/contracts/Repository/Values/Content/URLAlias.php @@ -12,6 +12,16 @@ /** * This class represents a url alias in the repository. + * + * @phpstan-property-read string $id A unique identifier for the alias + * @phpstan-property-read int $type The type of the URL Alias i.e. one of URLAlias::LOCATION, URLAlias::RESOURCE, URLAlias::VIRTUAL + * @phpstan-property-read mixed $destination If type = URLAlias::LOCATION it is a Location id otherwise a string (e.g. /content/search) + * @phpstan-property-read string $path the alias path + * @phpstan-property-read string[] $languageCodes the languages for which this alias is valid + * @phpstan-property-read bool $alwaysAvailable Fallback indicator for other languages + * @phpstan-property-read bool $isHistory Indicates that this alias was autogenerated for an in the meanwhile archived version of the content + * @phpstan-property-read bool $isCustom If false this alias was autogenerated otherwise manuel created + * @phpstan-property-read bool $forward Indicates if the url should be redirected */ class URLAlias extends ValueObject { diff --git a/src/contracts/Repository/Values/Content/URLWildcard.php b/src/contracts/Repository/Values/Content/URLWildcard.php index 3e7ea70955..25bf836b02 100644 --- a/src/contracts/Repository/Values/Content/URLWildcard.php +++ b/src/contracts/Repository/Values/Content/URLWildcard.php @@ -12,6 +12,11 @@ /** * This class represents a url alias in the repository. + * + * @phpstan-property-read mixed $id A unique identifier for the alias + * @phpstan-property-read string $sourceUrl The source url with wildcards + * @phpstan-property-read string $destinationUrl The destination URL with placeholders + * @phpstan-property-read bool $forward indicates if the url is redirected or not */ class URLWildcard extends ValueObject { diff --git a/src/contracts/Repository/Values/Content/URLWildcardTranslationResult.php b/src/contracts/Repository/Values/Content/URLWildcardTranslationResult.php index 71b6ef9133..3c96e59c7b 100644 --- a/src/contracts/Repository/Values/Content/URLWildcardTranslationResult.php +++ b/src/contracts/Repository/Values/Content/URLWildcardTranslationResult.php @@ -12,6 +12,9 @@ /** * This class represents a result of a translated url wildcard which is not an URLAlias. + * + * @phpstan-property-read string $uri The found resource uri + * @phpstan-property-read bool $forward indicates if the url is redirected or not */ class URLWildcardTranslationResult extends ValueObject { diff --git a/src/contracts/Repository/Values/Content/VersionInfo.php b/src/contracts/Repository/Values/Content/VersionInfo.php index 4c2ac0442f..326e0ddaab 100644 --- a/src/contracts/Repository/Values/Content/VersionInfo.php +++ b/src/contracts/Repository/Values/Content/VersionInfo.php @@ -17,6 +17,14 @@ * which the version belongs to. * * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo calls getContentInfo() + * @phpstan-property-read mixed $id the internal id of the version + * @phpstan-property-read int $versionNo the version number of this version (which only increments in scope of a single Content object) + * @phpstan-property-read \DateTime $modificationDate the last modified date of this version + * @phpstan-property-read \DateTime $creationDate the creation date of this version + * @phpstan-property-read mixed $creatorId the user id of the user which created this version + * @phpstan-property-read int $status the status of this version. One of VersionInfo::STATUS_DRAFT, VersionInfo::STATUS_PUBLISHED, VersionInfo::STATUS_ARCHIVED + * @phpstan-property-read string $initialLanguageCode the language code of the version. This value is used to flag a version as a translation to specific language + * @phpstan-property-read string[] $languageCodes a collection of all languages which exist in this version. */ abstract class VersionInfo extends ValueObject implements MultiLanguageName { diff --git a/src/contracts/Repository/Values/ContentType/ContentType.php b/src/contracts/Repository/Values/ContentType/ContentType.php index d7dce3a224..fda1ccaabe 100644 --- a/src/contracts/Repository/Values/ContentType/ContentType.php +++ b/src/contracts/Repository/Values/ContentType/ContentType.php @@ -17,7 +17,22 @@ * * @property-read \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup[] $contentTypeGroups calls getContentTypeGroups * @property-read \Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinitionCollection $fieldDefinitions calls getFieldDefinitions() or on access getFieldDefinition($fieldDefIdentifier) + * @phpstan-property-read mixed $id the id of the content type + * @phpstan-property-read int $status the status of the content type. One of ContentType::STATUS_DEFINED|ContentType::STATUS_DRAFT|ContentType::STATUS_MODIFIED + * @phpstan-property-read string $identifier the identifier of the content type + * @phpstan-property-read \DateTime $creationDate the date of the creation of this content type + * @phpstan-property-read \DateTime $modificationDate the date of the last modification of this content type + * @phpstan-property-read mixed $creatorId the user id of the creator of this content type + * @phpstan-property-read mixed $modifierId the user id of the user which has last modified this content type + * @phpstan-property-read string $remoteId a global unique id of the content object + * @phpstan-property-read string $urlAliasSchema URL alias schema. If nothing is provided, $nameSchema will be used instead. + * @phpstan-property-read string $nameSchema The name schema. + * @phpstan-property-read bool $isContainer @deprecated use strict getter {@see ContentType::isContainer} instead. * @property-read string $mainLanguageCode the main language of the content type names and description used for fallback. + * @phpstan-property-read bool $defaultAlwaysAvailable if an instance of a content type is created the always available flag is set by default this this value. + * @phpstan-property-read string[] $languageCodes array of language codes used by content type translations. + * @phpstan-property-read int $defaultSortField Specifies which property the child locations should be sorted on by default when created. Valid values are found at {@link Location::SORT_FIELD_*} + * @phpstan-property-read int $defaultSortOrder Specifies whether the sort order should be ascending or descending by default when created. Valid values are {@link Location::SORT_ORDER_*} */ abstract class ContentType extends ValueObject implements MultiLanguageName, MultiLanguageDescription { diff --git a/src/contracts/Repository/Values/ContentType/ContentTypeGroup.php b/src/contracts/Repository/Values/ContentType/ContentTypeGroup.php index aee9fb05c6..a04ed9ca7b 100644 --- a/src/contracts/Repository/Values/ContentType/ContentTypeGroup.php +++ b/src/contracts/Repository/Values/ContentType/ContentTypeGroup.php @@ -14,6 +14,13 @@ /** * This class represents a content type group value. + * + * @phpstan-property-read mixed $id the id of the content type group + * @phpstan-property-read string $identifier the identifier of the content type group + * @phpstan-property-read \DateTime $creationDate the date of the creation of this content type group + * @phpstan-property-read \DateTime $modificationDate the date of the last modification of this content type group + * @phpstan-property-read mixed $creatorId the user id of the creator of this content type group + * @phpstan-property-read mixed $modifierId the user id of the user which has last modified this content type group */ abstract class ContentTypeGroup extends ValueObject implements MultiLanguageName, MultiLanguageDescription { diff --git a/src/contracts/Repository/Values/ContentType/FieldDefinition.php b/src/contracts/Repository/Values/ContentType/FieldDefinition.php index 497d0e45aa..ee4ce1c088 100644 --- a/src/contracts/Repository/Values/ContentType/FieldDefinition.php +++ b/src/contracts/Repository/Values/ContentType/FieldDefinition.php @@ -17,6 +17,18 @@ * * @property-read array $fieldSettings calls getFieldSettings() * @property-read array $validatorConfiguration calls getValidatorConfiguration() + * @phpstan-property-read int $id the id of the field definition + * @phpstan-property-read string $identifier the identifier of the field definition + * @phpstan-property-read string $fieldGroup the field group name + * @phpstan-property-read int $position the position of the field definition in the content type + * @phpstan-property-read string $fieldTypeIdentifier String identifier of the field type + * @phpstan-property-read bool $isTranslatable indicates if fields of this definition are translatable + * @phpstan-property-read bool $isRequired indicates if this field is required in the content object + * @phpstan-property-read bool $isSearchable indicates if the field is searchable + * @phpstan-property-read bool $isThumbnail indicates if the field can be thumbnail + * @phpstan-property-read bool $isInfoCollector indicates if this field is used for information collection + * @phpstan-property-read mixed $defaultValue the default value of the field + * @phpstan-property-read string $mainLanguageCode main Translation (language code) of a multilingual Field Definition */ abstract class FieldDefinition extends ValueObject implements MultiLanguageName, MultiLanguageDescription { diff --git a/src/contracts/Repository/Values/Notification/Notification.php b/src/contracts/Repository/Values/Notification/Notification.php index 593773b19b..24643f21ff 100644 --- a/src/contracts/Repository/Values/Notification/Notification.php +++ b/src/contracts/Repository/Values/Notification/Notification.php @@ -12,6 +12,13 @@ /** * This class represents a notification value. + * + * @phpstan-property-read int $id The ID of notification + * @phpstan-property-read int $ownerId The ID of notification owner + * @phpstan-property-read bool $isPending True if notification is unreaded + * @phpstan-property-read string $type Notification type + * @phpstan-property-read \DateTimeInterface $created Creation date. + * @phpstan-property-read array $data Optional context data */ class Notification extends ValueObject { diff --git a/src/contracts/Repository/Values/ObjectState/ObjectState.php b/src/contracts/Repository/Values/ObjectState/ObjectState.php index 72adbd1429..d63e135a0d 100644 --- a/src/contracts/Repository/Values/ObjectState/ObjectState.php +++ b/src/contracts/Repository/Values/ObjectState/ObjectState.php @@ -15,7 +15,11 @@ /** * This class represents a object state value. * + * @phpstan-property-read mixed $id the id of the content type group + * @phpstan-property-read string $identifier the identifier of the content type group + * @phpstan-property-read int $priority the priority in the group ordering * @property-read string $mainLanguageCode the default language of the object state names and descriptions used for fallback. + * @phpstan-property-read string[] $languageCodes the available languages */ abstract class ObjectState extends ValueObject implements MultiLanguageName, MultiLanguageDescription { diff --git a/src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php b/src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php index f45d77cec8..2043fe0d3b 100644 --- a/src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php +++ b/src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php @@ -15,7 +15,11 @@ /** * This class represents an object state group value. * + * @phpstan-property-read mixed $id the id of the content type group + * @phpstan-property-read string $identifier the identifier of the content type group * @property-read string $mainLanguageCode the default language of the object state group names and description used for fallback. + * @phpstan-property-read string $defaultLanguageCode the default language code. + * @phpstan-property-read string[] $languageCodes the available languages */ abstract class ObjectStateGroup extends ValueObject implements MultiLanguageName, MultiLanguageDescription { diff --git a/src/contracts/Repository/Values/Setting/Setting.php b/src/contracts/Repository/Values/Setting/Setting.php index b2c8fb05a0..46e89119c9 100644 --- a/src/contracts/Repository/Values/Setting/Setting.php +++ b/src/contracts/Repository/Values/Setting/Setting.php @@ -10,6 +10,11 @@ use Ibexa\Contracts\Core\Repository\Values\ValueObject; +/** + * @phpstan-property-read string $group + * @phpstan-property-read string $identifier + * @phpstan-property-read mixed $value + */ class Setting extends ValueObject { /** @var string */ diff --git a/src/contracts/Repository/Values/User/PasswordValidationContext.php b/src/contracts/Repository/Values/User/PasswordValidationContext.php index 2af25774d5..5baba5834d 100644 --- a/src/contracts/Repository/Values/User/PasswordValidationContext.php +++ b/src/contracts/Repository/Values/User/PasswordValidationContext.php @@ -12,6 +12,9 @@ /** * Context of the password validation. + * + * @phpstan-property-read \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType|null $contentType + * @phpstan-property-read \Ibexa\Contracts\Core\Repository\Values\User\User|null $user */ class PasswordValidationContext extends ValueObject { diff --git a/src/contracts/Repository/Values/User/Policy.php b/src/contracts/Repository/Values/User/Policy.php index ccbeaeabb4..c9acce542c 100644 --- a/src/contracts/Repository/Values/User/Policy.php +++ b/src/contracts/Repository/Values/User/Policy.php @@ -13,6 +13,10 @@ /** * This class represents a policy value. * + * @phpstan-property-read mixed $id internal id of the policy + * @phpstan-property-read mixed $roleId the role id this policy belongs to + * @phpstan-property-read string $module Name of module, associated with the Policy + * @phpstan-property-read string $function Name of the module function Or all functions with '*' * @property-read \Ibexa\Contracts\Core\Repository\Values\User\Limitation[] $limitations an array of \Ibexa\Contracts\Core\Repository\Values\User\Limitation */ abstract class Policy extends ValueObject diff --git a/src/contracts/Repository/Values/User/Role.php b/src/contracts/Repository/Values/User/Role.php index 5206c6c45f..0b31a22094 100644 --- a/src/contracts/Repository/Values/User/Role.php +++ b/src/contracts/Repository/Values/User/Role.php @@ -13,6 +13,8 @@ /** * This class represents a role. * + * @phpstan-property-read int $id the internal id of the role + * @phpstan-property-read string $identifier the identifier of the role * @property-read \Ibexa\Contracts\Core\Repository\Values\User\Policy[] $policies an array of the policies {@link \Ibexa\Contracts\Core\Repository\Values\User\Policy} of the role. */ abstract class Role extends ValueObject diff --git a/src/contracts/Repository/Values/User/User.php b/src/contracts/Repository/Values/User/User.php index 7d367d9b17..3cc1c75b0d 100644 --- a/src/contracts/Repository/Values/User/User.php +++ b/src/contracts/Repository/Values/User/User.php @@ -12,6 +12,14 @@ /** * This class represents a user value. + * + * @phpstan-property-read string $login + * @phpstan-property-read string $email + * @phpstan-property-read string $passwordHash + * @phpstan-property-read string $hashAlgorithm Hash algorithm used to hash the password + * @phpstan-property-read \DateTimeInterface|null $passwordUpdatedAt + * @phpstan-property-read bool $enabled User can not login if false + * @phpstan-property-read int $maxLogin Max number of time user is allowed to login */ abstract class User extends Content implements UserReference { diff --git a/src/contracts/Repository/Values/User/UserGroup.php b/src/contracts/Repository/Values/User/UserGroup.php index 4f8aecca65..43b74391ff 100644 --- a/src/contracts/Repository/Values/User/UserGroup.php +++ b/src/contracts/Repository/Values/User/UserGroup.php @@ -12,6 +12,8 @@ /** * This class represents a user group. + * + * @phpstan-property-read mixed $parentId */ abstract class UserGroup extends Content { diff --git a/src/contracts/Repository/Values/UserPreference/UserPreference.php b/src/contracts/Repository/Values/UserPreference/UserPreference.php index ae79cad91f..d15ca19c92 100644 --- a/src/contracts/Repository/Values/UserPreference/UserPreference.php +++ b/src/contracts/Repository/Values/UserPreference/UserPreference.php @@ -12,6 +12,9 @@ /** * This class represents a user preference value. + * + * @phpstan-property-read string $name name of user preference + * @phpstan-property-read string $value value of user preference */ class UserPreference extends ValueObject { diff --git a/src/contracts/Search/Field.php b/src/contracts/Search/Field.php index 66285ef1c2..6a31de7e44 100644 --- a/src/contracts/Search/Field.php +++ b/src/contracts/Search/Field.php @@ -10,6 +10,10 @@ /** * Base class for document fields. + * + * @phpstan-property-read $name + * @phpstan-property-read $value + * @phpstan-property-read $type */ class Field extends ValueObject { diff --git a/src/contracts/Search/FieldType.php b/src/contracts/Search/FieldType.php index 034e52ef7d..43f18bfd04 100644 --- a/src/contracts/Search/FieldType.php +++ b/src/contracts/Search/FieldType.php @@ -10,6 +10,8 @@ /** * Base class for document field definitions. + * + * @phpstan-property-read string $type [deprecated] The type name of the facet, deprecated - use {@see \Ibexa\Contracts\Core\Search\FieldType::getType} instead. */ abstract class FieldType extends ValueObject { diff --git a/src/contracts/Variation/Values/ImageVariation.php b/src/contracts/Variation/Values/ImageVariation.php index 1d11a97bb6..709682502a 100644 --- a/src/contracts/Variation/Values/ImageVariation.php +++ b/src/contracts/Variation/Values/ImageVariation.php @@ -6,6 +6,13 @@ */ namespace Ibexa\Contracts\Core\Variation\Values; +/** + * @phpstan-property-read int|null $width The width as number of pixels (for example "320") + * @phpstan-property-read int|null $height The height as number of pixels (for example "256") + * @phpstan-property-read string $name The name of the image alias (for example "original") + * @phpstan-property-read mixed $info Extra information about the image, depending on the image type + * @phpstan-property-read mixed $imageId + */ class ImageVariation extends Variation { /** diff --git a/src/contracts/Variation/Values/Variation.php b/src/contracts/Variation/Values/Variation.php index 1c78df20b2..352f11e120 100644 --- a/src/contracts/Variation/Values/Variation.php +++ b/src/contracts/Variation/Values/Variation.php @@ -10,6 +10,13 @@ /** * Base class for file variations (i.e. image aliases). + * + * @phpstan-property-read int $fileSize Number of bytes for current variation + * @phpstan-property-read string $mimeType The MIME type (for example "image/png") + * @phpstan-property-read string $fileName The name of the file (for example "my_image.png") + * @phpstan-property-read string $dirPath The path to the file (for example "var/storage/images/test/199-2-eng-GB") + * @phpstan-property-read string $uri Complete path + name of image file (for example "var/storage/images/test/199-2-eng-GB/apple.png") + * @phpstan-property-read \DateTime $lastModified When the variation was last modified */ class Variation extends ValueObject { From 05c8cd5c8a752ecc745aa6dd6f6008cc3cee66c1 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 17 May 2024 16:38:36 +0200 Subject: [PATCH 07/10] Field.php: Fix "PHPDoc tag @property-read has invalid value" --- phpstan-baseline.neon | 15 --------------- src/contracts/Search/Field.php | 6 +++--- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 5bf5afb553..4d427ba6e3 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -7480,21 +7480,6 @@ parameters: count: 1 path: src/contracts/Repository/Values/ValueObject.php - - - message: "#^PHPDoc tag @property\\-read has invalid value \\(\\$name\\)\\: Unexpected token \"\\$name\", expected type at offset 60$#" - count: 1 - path: src/contracts/Search/Field.php - - - - message: "#^PHPDoc tag @property\\-read has invalid value \\(\\$type\\)\\: Unexpected token \"\\$type\", expected type at offset 109$#" - count: 1 - path: src/contracts/Search/Field.php - - - - message: "#^PHPDoc tag @property\\-read has invalid value \\(\\$value\\)\\: Unexpected token \"\\$value\", expected type at offset 84$#" - count: 1 - path: src/contracts/Search/Field.php - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Search\\\\FieldType\\\\FullTextField\\:\\:__construct\\(\\) has parameter \\$transformationRules with no value type specified in iterable type array\\.$#" count: 1 diff --git a/src/contracts/Search/Field.php b/src/contracts/Search/Field.php index 6a31de7e44..f3835932da 100644 --- a/src/contracts/Search/Field.php +++ b/src/contracts/Search/Field.php @@ -11,9 +11,9 @@ /** * Base class for document fields. * - * @phpstan-property-read $name - * @phpstan-property-read $value - * @phpstan-property-read $type + * @phpstan-property-read string $name + * @phpstan-property-read mixed $value + * @phpstan-property-read \Ibexa\Contracts\Core\Search\FieldType $type */ class Field extends ValueObject { From dd8b8e490dde2dae9dc80301fdd9b39d0dd6b626 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 21 May 2024 08:16:56 +0200 Subject: [PATCH 08/10] phpstan-baseline.neon: don't ignore fixed error --- phpstan-baseline.neon | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 4d427ba6e3..f017a7e271 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -22970,16 +22970,6 @@ parameters: count: 1 path: src/lib/Search/Legacy/Content/Mapper/FullTextMapper.php - - - message: "#^Access to protected property Ibexa\\\\Contracts\\\\Core\\\\Search\\\\Field\\:\\:\\$type\\.$#" - count: 3 - path: src/lib/Search/Legacy/Content/Mapper/FullTextMapper.php - - - - message: "#^Access to protected property Ibexa\\\\Contracts\\\\Core\\\\Search\\\\Field\\:\\:\\$value\\.$#" - count: 3 - path: src/lib/Search/Legacy/Content/Mapper/FullTextMapper.php - - message: "#^Method Ibexa\\\\Core\\\\Search\\\\Legacy\\\\Content\\\\WordIndexer\\\\Gateway\\:\\:bulkIndex\\(\\) has no return type specified\\.$#" count: 1 From b7d128eec84b2ccb93b727892974593d3fcc1066 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 21 May 2024 09:14:17 +0200 Subject: [PATCH 09/10] Fix "Found violation(s) of type: phpdoc_separation" composer install; /opt/homebrew/Cellar/php@8.1/8.1.28/bin/php -d memory_limit=-1 vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots; --- src/contracts/Repository/Values/Content/Location.php | 1 + src/contracts/Repository/Values/Content/Relation.php | 1 + src/contracts/Repository/Values/ContentType/ContentType.php | 1 + src/contracts/Repository/Values/ObjectState/ObjectState.php | 1 + src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php | 1 + src/contracts/Repository/Values/User/Policy.php | 1 + src/contracts/Repository/Values/User/Role.php | 1 + 7 files changed, 7 insertions(+) diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index a6229199cb..e343aeb55a 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -25,6 +25,7 @@ * @phpstan-property-read string $remoteId a global unique id of the content object * @phpstan-property-read int $parentLocationId the id of the parent location * @phpstan-property-read string $pathString @deprecated use {@see Location::getPathString()} instead. + * * @property-read array $path Same as $pathString but as array, e.g. [ 1, 2, 4, 23 ] * @phpstan-property-read int $depth Depth location has in the location tree * @phpstan-property-read int $sortField Specifies which property the child locations should be sorted on. Valid values are found at {@link Location::SORT_FIELD_*} diff --git a/src/contracts/Repository/Values/Content/Relation.php b/src/contracts/Repository/Values/Content/Relation.php index a6e3aaf1a0..753b46cdf1 100644 --- a/src/contracts/Repository/Values/Content/Relation.php +++ b/src/contracts/Repository/Values/Content/Relation.php @@ -15,6 +15,7 @@ * * @phpstan-property-read mixed $id the internal id of the relation * @phpstan-property-read string $sourceFieldDefinitionIdentifier the field definition identifier of the field where this relation is anchored if the relation is of type EMBED, LINK, or ATTRIBUTE + * * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $sourceContentInfo - calls {@link getSourceContentInfo()} * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $destinationContentInfo - calls {@link getDestinationContentInfo()} * @phpstan-property-read int $type The relation type bitmask containing one or more of Relation::COMMON, Relation::EMBED, Relation::LINK, Relation::FIELD diff --git a/src/contracts/Repository/Values/ContentType/ContentType.php b/src/contracts/Repository/Values/ContentType/ContentType.php index fda1ccaabe..435e2e183f 100644 --- a/src/contracts/Repository/Values/ContentType/ContentType.php +++ b/src/contracts/Repository/Values/ContentType/ContentType.php @@ -28,6 +28,7 @@ * @phpstan-property-read string $urlAliasSchema URL alias schema. If nothing is provided, $nameSchema will be used instead. * @phpstan-property-read string $nameSchema The name schema. * @phpstan-property-read bool $isContainer @deprecated use strict getter {@see ContentType::isContainer} instead. + * * @property-read string $mainLanguageCode the main language of the content type names and description used for fallback. * @phpstan-property-read bool $defaultAlwaysAvailable if an instance of a content type is created the always available flag is set by default this this value. * @phpstan-property-read string[] $languageCodes array of language codes used by content type translations. diff --git a/src/contracts/Repository/Values/ObjectState/ObjectState.php b/src/contracts/Repository/Values/ObjectState/ObjectState.php index d63e135a0d..738c43b509 100644 --- a/src/contracts/Repository/Values/ObjectState/ObjectState.php +++ b/src/contracts/Repository/Values/ObjectState/ObjectState.php @@ -18,6 +18,7 @@ * @phpstan-property-read mixed $id the id of the content type group * @phpstan-property-read string $identifier the identifier of the content type group * @phpstan-property-read int $priority the priority in the group ordering + * * @property-read string $mainLanguageCode the default language of the object state names and descriptions used for fallback. * @phpstan-property-read string[] $languageCodes the available languages */ diff --git a/src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php b/src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php index 2043fe0d3b..8615d59803 100644 --- a/src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php +++ b/src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php @@ -17,6 +17,7 @@ * * @phpstan-property-read mixed $id the id of the content type group * @phpstan-property-read string $identifier the identifier of the content type group + * * @property-read string $mainLanguageCode the default language of the object state group names and description used for fallback. * @phpstan-property-read string $defaultLanguageCode the default language code. * @phpstan-property-read string[] $languageCodes the available languages diff --git a/src/contracts/Repository/Values/User/Policy.php b/src/contracts/Repository/Values/User/Policy.php index c9acce542c..481aba8154 100644 --- a/src/contracts/Repository/Values/User/Policy.php +++ b/src/contracts/Repository/Values/User/Policy.php @@ -17,6 +17,7 @@ * @phpstan-property-read mixed $roleId the role id this policy belongs to * @phpstan-property-read string $module Name of module, associated with the Policy * @phpstan-property-read string $function Name of the module function Or all functions with '*' + * * @property-read \Ibexa\Contracts\Core\Repository\Values\User\Limitation[] $limitations an array of \Ibexa\Contracts\Core\Repository\Values\User\Limitation */ abstract class Policy extends ValueObject diff --git a/src/contracts/Repository/Values/User/Role.php b/src/contracts/Repository/Values/User/Role.php index 0b31a22094..923ecfac3d 100644 --- a/src/contracts/Repository/Values/User/Role.php +++ b/src/contracts/Repository/Values/User/Role.php @@ -15,6 +15,7 @@ * * @phpstan-property-read int $id the internal id of the role * @phpstan-property-read string $identifier the identifier of the role + * * @property-read \Ibexa\Contracts\Core\Repository\Values\User\Policy[] $policies an array of the policies {@link \Ibexa\Contracts\Core\Repository\Values\User\Policy} of the role. */ abstract class Role extends ValueObject From e3ed0f963cf5d34f83724dac229ae76ed60fcfce Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 21 May 2024 09:40:01 +0200 Subject: [PATCH 10/10] Fix "Found violation(s) of type: phpdoc_separation" manually Reorder declarations to avoid new lines from php-cs-fixer --- src/contracts/Repository/Values/Content/Location.php | 3 +-- src/contracts/Repository/Values/Content/Relation.php | 5 ++--- src/contracts/Repository/Values/ContentType/ContentType.php | 3 +-- src/contracts/Repository/Values/ObjectState/ObjectState.php | 3 +-- .../Repository/Values/ObjectState/ObjectStateGroup.php | 3 +-- src/contracts/Repository/Values/User/Policy.php | 3 +-- src/contracts/Repository/Values/User/Role.php | 3 +-- 7 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index e343aeb55a..850ffce88a 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -17,6 +17,7 @@ * * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo calls getContentInfo() * @property-read int $contentId calls getContentInfo()->id + * @property-read array $path Same as $pathString but as array, e.g. [ 1, 2, 4, 23 ] * @phpstan-property-read int $id the id of the location * @phpstan-property-read int $priority Position of the Location among its siblings when sorted using priority * @phpstan-property-read bool $hidden Indicates that the Location entity is hidden (explicitly or hidden by content). @@ -25,8 +26,6 @@ * @phpstan-property-read string $remoteId a global unique id of the content object * @phpstan-property-read int $parentLocationId the id of the parent location * @phpstan-property-read string $pathString @deprecated use {@see Location::getPathString()} instead. - * - * @property-read array $path Same as $pathString but as array, e.g. [ 1, 2, 4, 23 ] * @phpstan-property-read int $depth Depth location has in the location tree * @phpstan-property-read int $sortField Specifies which property the child locations should be sorted on. Valid values are found at {@link Location::SORT_FIELD_*} * @phpstan-property-read int $sortOrder Specifies whether the sort order should be ascending or descending. Valid values are {@link Location::SORT_ORDER_*} diff --git a/src/contracts/Repository/Values/Content/Relation.php b/src/contracts/Repository/Values/Content/Relation.php index 753b46cdf1..2acba271eb 100644 --- a/src/contracts/Repository/Values/Content/Relation.php +++ b/src/contracts/Repository/Values/Content/Relation.php @@ -13,11 +13,10 @@ /** * Class representing a relation between content. * - * @phpstan-property-read mixed $id the internal id of the relation - * @phpstan-property-read string $sourceFieldDefinitionIdentifier the field definition identifier of the field where this relation is anchored if the relation is of type EMBED, LINK, or ATTRIBUTE - * * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $sourceContentInfo - calls {@link getSourceContentInfo()} * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $destinationContentInfo - calls {@link getDestinationContentInfo()} + * @phpstan-property-read mixed $id the internal id of the relation + * @phpstan-property-read string $sourceFieldDefinitionIdentifier the field definition identifier of the field where this relation is anchored if the relation is of type EMBED, LINK, or ATTRIBUTE * @phpstan-property-read int $type The relation type bitmask containing one or more of Relation::COMMON, Relation::EMBED, Relation::LINK, Relation::FIELD */ abstract class Relation extends ValueObject diff --git a/src/contracts/Repository/Values/ContentType/ContentType.php b/src/contracts/Repository/Values/ContentType/ContentType.php index 435e2e183f..ec09ea81c6 100644 --- a/src/contracts/Repository/Values/ContentType/ContentType.php +++ b/src/contracts/Repository/Values/ContentType/ContentType.php @@ -17,6 +17,7 @@ * * @property-read \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup[] $contentTypeGroups calls getContentTypeGroups * @property-read \Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinitionCollection $fieldDefinitions calls getFieldDefinitions() or on access getFieldDefinition($fieldDefIdentifier) + * @property-read string $mainLanguageCode the main language of the content type names and description used for fallback. * @phpstan-property-read mixed $id the id of the content type * @phpstan-property-read int $status the status of the content type. One of ContentType::STATUS_DEFINED|ContentType::STATUS_DRAFT|ContentType::STATUS_MODIFIED * @phpstan-property-read string $identifier the identifier of the content type @@ -28,8 +29,6 @@ * @phpstan-property-read string $urlAliasSchema URL alias schema. If nothing is provided, $nameSchema will be used instead. * @phpstan-property-read string $nameSchema The name schema. * @phpstan-property-read bool $isContainer @deprecated use strict getter {@see ContentType::isContainer} instead. - * - * @property-read string $mainLanguageCode the main language of the content type names and description used for fallback. * @phpstan-property-read bool $defaultAlwaysAvailable if an instance of a content type is created the always available flag is set by default this this value. * @phpstan-property-read string[] $languageCodes array of language codes used by content type translations. * @phpstan-property-read int $defaultSortField Specifies which property the child locations should be sorted on by default when created. Valid values are found at {@link Location::SORT_FIELD_*} diff --git a/src/contracts/Repository/Values/ObjectState/ObjectState.php b/src/contracts/Repository/Values/ObjectState/ObjectState.php index 738c43b509..80c3e0dae8 100644 --- a/src/contracts/Repository/Values/ObjectState/ObjectState.php +++ b/src/contracts/Repository/Values/ObjectState/ObjectState.php @@ -15,11 +15,10 @@ /** * This class represents a object state value. * + * @property-read string $mainLanguageCode the default language of the object state names and descriptions used for fallback. * @phpstan-property-read mixed $id the id of the content type group * @phpstan-property-read string $identifier the identifier of the content type group * @phpstan-property-read int $priority the priority in the group ordering - * - * @property-read string $mainLanguageCode the default language of the object state names and descriptions used for fallback. * @phpstan-property-read string[] $languageCodes the available languages */ abstract class ObjectState extends ValueObject implements MultiLanguageName, MultiLanguageDescription diff --git a/src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php b/src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php index 8615d59803..2629125c94 100644 --- a/src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php +++ b/src/contracts/Repository/Values/ObjectState/ObjectStateGroup.php @@ -15,10 +15,9 @@ /** * This class represents an object state group value. * + * @property-read string $mainLanguageCode the default language of the object state group names and description used for fallback. * @phpstan-property-read mixed $id the id of the content type group * @phpstan-property-read string $identifier the identifier of the content type group - * - * @property-read string $mainLanguageCode the default language of the object state group names and description used for fallback. * @phpstan-property-read string $defaultLanguageCode the default language code. * @phpstan-property-read string[] $languageCodes the available languages */ diff --git a/src/contracts/Repository/Values/User/Policy.php b/src/contracts/Repository/Values/User/Policy.php index 481aba8154..2e8c3fa2b5 100644 --- a/src/contracts/Repository/Values/User/Policy.php +++ b/src/contracts/Repository/Values/User/Policy.php @@ -13,12 +13,11 @@ /** * This class represents a policy value. * + * @property-read \Ibexa\Contracts\Core\Repository\Values\User\Limitation[] $limitations an array of \Ibexa\Contracts\Core\Repository\Values\User\Limitation * @phpstan-property-read mixed $id internal id of the policy * @phpstan-property-read mixed $roleId the role id this policy belongs to * @phpstan-property-read string $module Name of module, associated with the Policy * @phpstan-property-read string $function Name of the module function Or all functions with '*' - * - * @property-read \Ibexa\Contracts\Core\Repository\Values\User\Limitation[] $limitations an array of \Ibexa\Contracts\Core\Repository\Values\User\Limitation */ abstract class Policy extends ValueObject { diff --git a/src/contracts/Repository/Values/User/Role.php b/src/contracts/Repository/Values/User/Role.php index 923ecfac3d..a006490dd8 100644 --- a/src/contracts/Repository/Values/User/Role.php +++ b/src/contracts/Repository/Values/User/Role.php @@ -13,10 +13,9 @@ /** * This class represents a role. * + * @property-read \Ibexa\Contracts\Core\Repository\Values\User\Policy[] $policies an array of the policies {@link \Ibexa\Contracts\Core\Repository\Values\User\Policy} of the role. * @phpstan-property-read int $id the internal id of the role * @phpstan-property-read string $identifier the identifier of the role - * - * @property-read \Ibexa\Contracts\Core\Repository\Values\User\Policy[] $policies an array of the policies {@link \Ibexa\Contracts\Core\Repository\Values\User\Policy} of the role. */ abstract class Role extends ValueObject {