Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-4929: Fix property-read usage #373

Draft
wants to merge 10 commits into
base: 4.6
Choose a base branch
from
25 changes: 0 additions & 25 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -22985,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
Expand Down
14 changes: 7 additions & 7 deletions src/contracts/Limitation/Target/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
/**
* 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
* @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
{
Expand Down
30 changes: 15 additions & 15 deletions src/contracts/Repository/Values/Content/ContentInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
/**
* 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
* @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
{
Expand Down
10 changes: 5 additions & 5 deletions src/contracts/Repository/Values/Content/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
/**
* 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
* @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
{
Expand Down
14 changes: 9 additions & 5 deletions src/contracts/Repository/Values/Content/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
/**
* 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.
* @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
{
Expand All @@ -42,7 +42,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
Expand Down
22 changes: 11 additions & 11 deletions src/contracts/Repository/Values/Content/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
*
* @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_*}
* @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.
* @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
{
Expand Down
4 changes: 2 additions & 2 deletions src/contracts/Repository/Values/Content/LocationList.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
* 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
* @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
Expand Down
6 changes: 3 additions & 3 deletions src/contracts/Repository/Values/Content/Relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
/**
* 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
* @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
{
Expand Down
6 changes: 3 additions & 3 deletions src/contracts/Repository/Values/Content/Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
/**
* 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
* @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
{
Expand Down
8 changes: 4 additions & 4 deletions src/contracts/Repository/Values/Content/Thumbnail.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
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
* @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
{
Expand Down
18 changes: 9 additions & 9 deletions src/contracts/Repository/Values/Content/URLAlias.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
/**
* 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
* @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
{
Expand Down
8 changes: 4 additions & 4 deletions src/contracts/Repository/Values/Content/URLWildcard.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
/**
* 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
* @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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
/**
* 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
* @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
{
Expand Down
16 changes: 8 additions & 8 deletions src/contracts/Repository/Values/Content/VersionInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
* 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.
* @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
{
Expand Down
Loading
Loading