From 37d0a1876a674a777a384bd60e3323ea71227d8a Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:39:24 +0100 Subject: [PATCH 01/92] Enhance `DateMetadata::TRASHED` phpdoc --- .../Values/Content/Query/Criterion/DateMetadata.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php b/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php index 78d5397468..f4dc7e449b 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php @@ -24,13 +24,13 @@ * BETWEEN: matches content whose date is between (included) the TWO given timestamps * * Example: - * + * ``` * $createdCriterion = new Criterion\DateMetadata( * Criterion\DateMetadata::CREATED, * Operator::GTE, - * strtotime( 'yesterday' ) + * strtotime('yesterday') * ); - * + * ``` */ class DateMetadata extends Criterion implements TrashCriterion, FilteringCriterion { @@ -41,7 +41,7 @@ class DateMetadata extends Criterion implements TrashCriterion, FilteringCriteri public const PUBLISHED = 'published'; /** - * (applies to TrashService::findTrashItems only). + * Applies to {@see \Ibexa\Contracts\Core\Repository\TrashService::findTrashItems() only. */ public const TRASHED = 'trashed'; From cd00840fb4eeacc8fac5a899abdaf95b49e7bd65 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 10 Dec 2024 19:35:09 +0100 Subject: [PATCH 02/92] Enhance `Criterion::getSpecifications()` phpdoc --- .../Repository/Values/Content/Query/Criterion.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion.php b/src/contracts/Repository/Values/Content/Query/Criterion.php index 7e80664698..e05ef03558 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion.php @@ -118,12 +118,12 @@ public function __construct(?string $target, ?string $operator, $value, ?Value $ * * Returns the combination of the Criterion's supported operator/value, * as an array of {@see \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator\Specifications} objects - * - Operator is one supported Operator, as an Operator::* constant - * - ValueType is the type of input value this operator requires, either array or single - * - SupportedTypes is an array of types the operator will accept - * - ValueCountLimitation is an integer saying how many values are expected. + * - `$operator` is a supported {@see Operator} constant. + * - `$valueFormat is the type of input value this operator requires, either array ({@see Specifications::FORMAT_ARRAY}) or single ({@see Specifications::FORMAT_SINGLE}). + * - `$valueTypes` are bitwise flags of types the operator will accept ({@see Specifications::TYPE_BOOLEAN}, {@see Specifications::TYPE_INTEGER}, and/or {@see Specifications::TYPE_STRING}). + * - `$valueCount` is an integer saying how many values are expected. * - * + * ``` * // IN and EQ are supported * return [ * // The EQ operator expects a single value, either as an integer or a string @@ -139,7 +139,7 @@ public function __construct(?string $target, ?string $operator, $value, ?Value $ * Specifications::TYPE_INTEGER | Specifications::TYPE_STRING * ) * ] - * + * ``` * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator\Specifications[] */ From 7e87d09ecfa9e1f731e669f51981d3e7dc122b14 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 10 Dec 2024 19:35:43 +0100 Subject: [PATCH 03/92] Enhance `Specifications` phpdoc --- .../Content/Query/Criterion/Operator/Specifications.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion/Operator/Specifications.php b/src/contracts/Repository/Values/Content/Query/Criterion/Operator/Specifications.php index f22eeb6973..73c61c5d20 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion/Operator/Specifications.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion/Operator/Specifications.php @@ -11,9 +11,7 @@ /** * This class is used by Criteria to describe which operators they support. * - * Instances of this class are returned in an array by the Criterion::getSpecifications() method - * - * @see \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion::getSpecifications() + * Instances of this class are returned in an array by the {@see \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion::getSpecifications()} method. */ class Specifications { From 8cc9116ab1599e9e47f439565e4814ac23b357b7 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 11 Dec 2024 13:00:52 +0100 Subject: [PATCH 04/92] Capable.php: Fix phpdoc summary Don't use advanced format in summary, it won't be rendered. --- src/contracts/Search/Capable.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/contracts/Search/Capable.php b/src/contracts/Search/Capable.php index a6504d9595..11cb1cfb1d 100644 --- a/src/contracts/Search/Capable.php +++ b/src/contracts/Search/Capable.php @@ -9,6 +9,8 @@ namespace Ibexa\Contracts\Core\Search; /** + * Capability interface for search engines. + * * Capability interface for search engines needed for {@see \Ibexa\Contracts\Core\Repository\SearchService::supports()}. * * @since 6.12 And ported to 6.7.6 for search engine forward compatibility. From 67284d482152595157a9696be4552000b3f23eef Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:59:46 +0100 Subject: [PATCH 05/92] VersionBuilder.php: Fix phpdoc summary, arrays and self usages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't use advanced format in summary, it won't be rendered. Define array key type, or it will be rendered as array phpDocumentor don't seem to understand self. --- .../Target/Builder/VersionBuilder.php | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/contracts/Limitation/Target/Builder/VersionBuilder.php b/src/contracts/Limitation/Target/Builder/VersionBuilder.php index baff618ec0..c4738544c0 100644 --- a/src/contracts/Limitation/Target/Builder/VersionBuilder.php +++ b/src/contracts/Limitation/Target/Builder/VersionBuilder.php @@ -14,6 +14,8 @@ use Ibexa\Core\Base\Exceptions\InvalidArgumentException; /** + * Version builder. + * * Builder of {@see \Ibexa\Contracts\Core\Limitation\Target\Version} instance. */ final class VersionBuilder @@ -28,6 +30,8 @@ public function build(): Target\Version /** * @param \Ibexa\Contracts\Core\Repository\Values\Content\Field[] $updatedFields + * + * @return VersionBuilder */ public function updateFields(array $updatedFields): self { @@ -41,7 +45,7 @@ public function updateFields(array $updatedFields): self * * @param array $languageCodes * - * @return self + * @return VersionBuilder * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException */ @@ -61,9 +65,9 @@ public function translateToAnyLanguageOf(array $languageCodes): self /** * Set intent to create Content from unspecified (yet) content type, any from the given list. * - * @param int[] $contentTypeIds + * @param array $contentTypeIds * - * @return self + * @return VersionBuilder * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException */ @@ -83,13 +87,13 @@ public function createFromAnyContentTypeOf(array $contentTypeIds): self /** * Set intent to change Version status. * - * Supported: VersionInfo::STATUS_DRAFT, VersionInfo::STATUS_PUBLISHED, VersionInfo::STATUS_ARCHIVED + * Supported: {@see \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo::STATUS_DRAFT}, {@see \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo::STATUS_PUBLISHED}, {@see \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo::STATUS_ARCHIVED} * * @see \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo * * @param int $status * - * @return self + * @return VersionBuilder * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException */ @@ -114,9 +118,9 @@ public function changeStatusTo(int $status): self * Set intent to update Content Version Fields. * * @param string|null $initialLanguageCode - * @param \Ibexa\Contracts\Core\Repository\Values\Content\Field[] $fields + * @param array $fields * - * @return self + * @return VersionBuilder */ public function updateFieldsTo(?string $initialLanguageCode, array $fields): self { @@ -138,9 +142,9 @@ static function (Field $field) { /** * Set intent to publish, to specified translations, all from the given list. * - * @param string[] $languageCodes + * @param array $languageCodes * - * @return self + * @return VersionBuilder * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException */ From bc939e0ab76f0e297bfc3ea37ceaf71ea23a071e Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:20:26 +0100 Subject: [PATCH 06/92] ConstraintViolationAdapter's PHPDoc: Add a summary, reword description --- .../Generic/ValidationError/ConstraintViolationAdapter.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php b/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php index a7f63aa101..0d39e8ccf1 100644 --- a/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php +++ b/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php @@ -14,8 +14,10 @@ use Symfony\Component\Validator\ConstraintViolationInterface; /** - * {@see \Symfony\Component\Validator\ConstraintViolationInterface} to - * {@see \Ibexa\Contracts\Core\FieldType\ValidationError} adapter. + * Constraint violation validation error. + * + * Adapts {@see \Symfony\Component\Validator\ConstraintViolationInterface} to + * {@see \Ibexa\Contracts\Core\FieldType\ValidationError}. */ final class ConstraintViolationAdapter implements ValidationErrorInterface { From 8c3cacf21f379c8c39b5fbf31bfd792801ca63f1 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:13:32 +0100 Subject: [PATCH 07/92] Enhance `Criterion::getSpecifications()` phpdoc --- .../Repository/Values/Content/Query/Criterion.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion.php b/src/contracts/Repository/Values/Content/Query/Criterion.php index e05ef03558..64e5faf370 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion.php @@ -118,10 +118,10 @@ public function __construct(?string $target, ?string $operator, $value, ?Value $ * * Returns the combination of the Criterion's supported operator/value, * as an array of {@see \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator\Specifications} objects - * - `$operator` is a supported {@see Operator} constant. - * - `$valueFormat is the type of input value this operator requires, either array ({@see Specifications::FORMAT_ARRAY}) or single ({@see Specifications::FORMAT_SINGLE}). - * - `$valueTypes` are bitwise flags of types the operator will accept ({@see Specifications::TYPE_BOOLEAN}, {@see Specifications::TYPE_INTEGER}, and/or {@see Specifications::TYPE_STRING}). - * - `$valueCount` is an integer saying how many values are expected. + * - {@see Specifications::$operator} is a supported {@see Operator} constant. + * - {@see Specifications::$valueFormat} is the type of input value this operator requires, either array ({@see Specifications::FORMAT_ARRAY}) or single ({@see Specifications::FORMAT_SINGLE}). + * - {@see Specifications::$valueTypes} are bitwise flags of types the operator will accept ({@see Specifications::TYPE_BOOLEAN}, {@see Specifications::TYPE_INTEGER}, and/or {@see Specifications::TYPE_STRING}). + * - {@see Specifications::$valueCount} is an integer saying how many values are expected. * * ``` * // IN and EQ are supported From 57d427f3b65340f68074491fec21059f6d3e140e Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:19:06 +0100 Subject: [PATCH 08/92] Enhance `DateMetadata::TRASHED` phpdoc --- .../Repository/Values/Content/Query/Criterion/DateMetadata.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php b/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php index f4dc7e449b..b18296252a 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php @@ -41,6 +41,8 @@ class DateMetadata extends Criterion implements TrashCriterion, FilteringCriteri public const PUBLISHED = 'published'; /** + * To search for contents based on when they have been sent to trash. + * * Applies to {@see \Ibexa\Contracts\Core\Repository\TrashService::findTrashItems() only. */ public const TRASHED = 'trashed'; From 81d53dd6340d595857ca342034be81f3553ab28d Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:13:13 +0100 Subject: [PATCH 09/92] Enhance `DateMetadata` phpdoc --- .../Content/Query/Criterion/DateMetadata.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php b/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php index b18296252a..bde44bb36c 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php @@ -18,16 +18,16 @@ * A criterion that matches content based on one of the date metadata (created or modified). * * Supported Operators: - * EQ, IN: matches content whose date is or belongs to a list of timestamps - * GT, GTE: matches content whose date is greater than/greater than or equals the given timestamp - * LT, LTE: matches content whose date is lower than/lower than or equals the given timestamp - * BETWEEN: matches content whose date is between (included) the TWO given timestamps + * - {@see Operator::EQ EQ}, {@see Operator::IN IN}: matches content whose date is or belongs to a list of timestamps. + * - {@see Operator::GT GT}, {@see Operator::GTE GTE}: matches content whose date is greater than/greater than or equals the given timestamp. + * - {@see Operator::LT LT}, {@see Operator::LTE LTE}: matches content whose date is lower than/lower than or equals the given timestamp. + * - {@see Operator::BETWEEN BETWEEN}: matches content whose date is between TWO (included) given timestamps. * - * Example: + * The following example is a criterion for contents created yesterday or today: * ``` * $createdCriterion = new Criterion\DateMetadata( * Criterion\DateMetadata::CREATED, - * Operator::GTE, + * Criterion\Operator::GTE, * strtotime('yesterday') * ); * ``` @@ -43,7 +43,7 @@ class DateMetadata extends Criterion implements TrashCriterion, FilteringCriteri /** * To search for contents based on when they have been sent to trash. * - * Applies to {@see \Ibexa\Contracts\Core\Repository\TrashService::findTrashItems() only. + * Applies to {@see \Ibexa\Contracts\Core\Repository\TrashService::findTrashItems()} only. */ public const TRASHED = 'trashed'; @@ -59,8 +59,8 @@ class DateMetadata extends Criterion implements TrashCriterion, FilteringCriteri * * @throws \InvalidArgumentException If target is unknown * - * @param string $target One of DateMetadata::CREATED, DateMetadata::MODIFIED or DateMetadata::TRASHED (applies to TrashService::findTrashItems only) - * @param string $operator One of the Operator constants + * @param string $target One of {@see DateMetadata::CREATED}, {@see DateMetadata::MODIFIED}, or {@see DateMetadata::TRASHED} (applies to {@see \Ibexa\Contracts\Core\Repository\TrashService::findTrashItems()} only) + * @param string $operator One of the {@see Operator} constants * @param mixed $value The match value, either as an array of as a single value, depending on the operator */ public function __construct(string $target, string $operator, $value) From d6fb1bd4b1610cac7198518d2f9378f65d23cdb0 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:31:12 +0100 Subject: [PATCH 10/92] Enhance `UserMetadata` phpdoc --- .../Content/Query/Criterion/UserMetadata.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php b/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php index 13f4775307..44d80610a0 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php @@ -19,16 +19,16 @@ * group, modifier). * * Supported Operators: - * EQ, IN: Matches the provided user ID(s) against the user IDs in the database + * - {@see Operator::EQ EQ}, {@see Operator::IN}: Matches the provided user ID(s) against the user IDs in the database. * - * Example: - * + * The following example is a criterion for contents owned by a user with ID 10 or 14: + * ``` * $createdCriterion = new Criterion\UserMetadata( * Criterion\UserMetadata::OWNER, - * Operator::IN, - * array( 10, 14 ) + * Criterion\Operator::IN, + * [10, 14] * ); - * + * ``` */ class UserMetadata extends Criterion implements TrashCriterion, FilteringCriterion { @@ -48,13 +48,13 @@ class UserMetadata extends Criterion implements TrashCriterion, FilteringCriteri public const MODIFIER = 'modifier'; /** - * Creates a new UserMetadata criterion on $metadata. + * Creates a new UserMetadata criterion. * * @throws \InvalidArgumentException If target is unknown * - * @param string $target One of UserMetadata::OWNER, UserMetadata::GROUP or UserMetadata::MODIFIED - * @param string|null $operator The operator the Criterion uses. If null is given, will default to Operator::IN if $value is an array, Operator::EQ if it is not. - * @param mixed $value The match value, either as an array of as a single value, depending on the operator + * @param string $target One of {@see UserMetadata::OWNER}, {@see UserMetadata::GROUP}, or {@see UserMetadata::MODIFIED}. + * @param string|null $operator The operator the Criterion uses. If null is given, will default to {@see Operator::IN} if $value is an array, {@see Operator::EQ} if it isn't. + * @param mixed $value The match value, either as an array of as a single value, depending on the operator. */ public function __construct(string $target, ?string $operator, $value) { From 88cba98f9c3a182bd8ad97e940b07319f80157ee Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:31:19 +0100 Subject: [PATCH 11/92] Enhance `DateMetadata` phpdoc --- .../Repository/Values/Content/Query/Criterion/DateMetadata.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php b/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php index bde44bb36c..bbfe5f0643 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php @@ -55,7 +55,7 @@ class DateMetadata extends Criterion implements TrashCriterion, FilteringCriteri ]; /** - * Creates a new DateMetadata criterion on $metadata. + * Creates a new DateMetadata criterion. * * @throws \InvalidArgumentException If target is unknown * From 89887f37f6c4745beafb78cb9913274d8de9f22e Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:31:43 +0100 Subject: [PATCH 12/92] Enhance `Capable` phpdoc --- src/contracts/Search/Capable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Search/Capable.php b/src/contracts/Search/Capable.php index 11cb1cfb1d..0451ffda08 100644 --- a/src/contracts/Search/Capable.php +++ b/src/contracts/Search/Capable.php @@ -20,7 +20,7 @@ interface Capable /** * Query for supported capability of currently configured search engine. * - * @param int $capabilityFlag One of \Ibexa\Contracts\Core\Repository\SearchService::CAPABILITY_* constants. + * @param int $capabilityFlag One of {@see \Ibexa\Contracts\Core\Repository\SearchService}::CAPABILITY_* constants. * * @return bool */ From e2352825b81d027102ccfc5464ce50976b75b31e Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:50:08 +0100 Subject: [PATCH 13/92] Enhance `Criterion` phpdoc --- .../Repository/Values/Content/Query/Criterion.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion.php b/src/contracts/Repository/Values/Content/Query/Criterion.php index 64e5faf370..16e1267357 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion.php @@ -44,13 +44,15 @@ abstract class Criterion implements CriterionInterface public $valueData; /** - * Performs operator validation based on the Criterion specifications returned by {@see getSpecifications()}. + * Creates a Criterion. + * + * Performs operator validation based on the Criterion specifications returned by {@see Criterion::getSpecifications()}. * * @param string|null $target The target the Criterion applies to: metadata identifier, field identifier... * @param string|null $operator - * The operator the Criterion uses. If null is given, will default to Operator::IN if $value is an array, - * Operator::EQ if it is not. - * @param scalar[]|scalar $value + * The operator the Criterion uses. If null is given, will default to {@see Operator::IN} if $value is an array, + * {@see Operator::EQ} if it isn't. + * @param array|scalar $value * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Value|null $valueData * * @todo Add a dedicated exception @@ -141,14 +143,14 @@ public function __construct(?string $target, ?string $operator, $value, ?Value $ * ] * ``` * - * @return \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator\Specifications[] + * @return array */ abstract public function getSpecifications(): array; /** * Returns a callback that checks the values types depending on the operator specifications. * - * @param int $valueTypes The accepted values, as a bit field of Specifications::TYPE_* constants + * @param int $valueTypes The accepted values, as a bit field of {@see Specifications}::TYPE_* constants * * @return callable */ From 6b315d16f5c49980028f8f468daf92b2d975d97d Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:09:17 +0100 Subject: [PATCH 14/92] Enhance `UserMetadata` phpdoc (fix typo) --- .../Repository/Values/Content/Query/Criterion/UserMetadata.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php b/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php index 44d80610a0..1b4f924508 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php @@ -52,7 +52,7 @@ class UserMetadata extends Criterion implements TrashCriterion, FilteringCriteri * * @throws \InvalidArgumentException If target is unknown * - * @param string $target One of {@see UserMetadata::OWNER}, {@see UserMetadata::GROUP}, or {@see UserMetadata::MODIFIED}. + * @param string $target One of {@see UserMetadata::OWNER}, {@see UserMetadata::GROUP}, or {@see UserMetadata::MODIFIER}. * @param string|null $operator The operator the Criterion uses. If null is given, will default to {@see Operator::IN} if $value is an array, {@see Operator::EQ} if it isn't. * @param mixed $value The match value, either as an array of as a single value, depending on the operator. */ From d61337ecf073049d5e470cbec258c8c98a503255 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:50:43 +0100 Subject: [PATCH 15/92] Enhance `UserMetadata` phpdoc --- .../Repository/Values/Content/Query/Criterion/UserMetadata.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php b/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php index 1b4f924508..85f53a6f24 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php @@ -19,7 +19,7 @@ * group, modifier). * * Supported Operators: - * - {@see Operator::EQ EQ}, {@see Operator::IN}: Matches the provided user ID(s) against the user IDs in the database. + * - {@see Operator::EQ EQ}, {@see Operator::IN IN}: Matches the provided user ID(s) against the user IDs in the database. * * The following example is a criterion for contents owned by a user with ID 10 or 14: * ``` From 159b62202d564e69cebd6152f404769175adfce2 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 13 Dec 2024 12:35:11 +0100 Subject: [PATCH 16/92] Enhance `FieldType\Generic\Type` phpdoc --- src/contracts/FieldType/Generic/Type.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/contracts/FieldType/Generic/Type.php b/src/contracts/FieldType/Generic/Type.php index aa0028cd67..55c61b8ab1 100644 --- a/src/contracts/FieldType/Generic/Type.php +++ b/src/contracts/FieldType/Generic/Type.php @@ -263,17 +263,17 @@ final public function acceptValue($inputValue): Value * This is an operation method for {@see acceptValue()}. * * Example implementation: - * + * ``` * protected function createValueFromInput( $inputValue ) * { - * if ( is_array( $inputValue ) ) + * if (is_array($inputValue)) * { * $inputValue = \My\FieldType\CookieJar\Value( $inputValue ); * } * * return $inputValue; * } - * + * ``` * * @param mixed $inputValue * @@ -310,15 +310,15 @@ protected function getValueClass(): string * FieldType class and is named "Value". * * Example implementation: - * + * ``` * protected function checkValueType($value): void * { - * if ( !$inputValue instanceof \My\FieldType\CookieJar\Value ) ) + * if (!$inputValue instanceof \My\FieldType\CookieJar\Value)) * { - * throw new InvalidArgumentException( "Given value type is not supported." ); + * throw new InvalidArgumentException("Given value type isn't supported."); * } * } - * + * ``` * * @param mixed $value A value returned by {@see createValueFromInput()}. * From 429bf8666368434694ac5f77236d7954156a664a Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:21:52 +0100 Subject: [PATCH 17/92] Enhance `Limitation\Type` phpdoc One docblock per constant. --- src/contracts/Limitation/Type.php | 50 +++++++++++++++---- src/lib/Limitation/LocationLimitationType.php | 5 +- src/lib/Limitation/SubtreeLimitationType.php | 5 +- 3 files changed, 45 insertions(+), 15 deletions(-) diff --git a/src/contracts/Limitation/Type.php b/src/contracts/Limitation/Type.php index b93aa4a5c4..cb5410d705 100644 --- a/src/contracts/Limitation/Type.php +++ b/src/contracts/Limitation/Type.php @@ -21,26 +21,57 @@ interface Type { /** - * Constants for return value of {@see evaluate()}. + * Access is granted. * - * Currently ACCESS_ABSTAIN must mean that evaluate does not support the provided $object or $targets, - * this is currently only supported by role limitations as policy limitations should not allow this. + * Constant for return value of {@see Type::evaluate()}. * * Note: In future version constant values might change to 1, 0 and -1 as used in Symfony. * * @since 5.3.2 */ public const ACCESS_GRANTED = true; + + /** + * The type abstains from voting. + * + * Constant for return value of {@see Type::evaluate()}. + * + * Returning ACCESS_ABSTAIN must mean that evaluate does not support the provided $object or $targets, + * this is only supported by role limitations as policy limitations should not allow this. + * + * Note: In future version constant values might change to 1, 0 and -1 as used in Symfony. + * + * @since 5.3.2 + */ public const ACCESS_ABSTAIN = null; + + /** + * Access is denied. + * + * Constant for return value of {@see Type::evaluate()}. + * + * Note: In future version constant values might change to 1, 0 and -1 as used in Symfony. + * + * @since 5.3.2 + */ public const ACCESS_DENIED = false; /** - * Constants for valueSchema() return values. + * Limitation's value must be an array of location IDs. + * + * Constant for {@see Type::valueSchema()} return values. * - * Used in cases where a certain value is accepted but the options are to many to return as a hash of options. * GUI should typically present option to browse content tree to select limitation value(s). */ public const VALUE_SCHEMA_LOCATION_ID = 1; + + /** + * Limitation's value must be an array of location paths. + * + * Constant for {@see Type::valueSchema()} return values. + * + * GUI should typically present option to browse content tree to select limitation value(s). + */ public const VALUE_SCHEMA_LOCATION_PATH = 2; /** @@ -92,7 +123,7 @@ public function buildValue(array $limitationValues); * @param \Ibexa\Contracts\Core\Repository\Values\ValueObject[]|null $targets An array of location, parent or "assignment" * objects, if null: none where provided by caller * - * @return bool|null Returns one of ACCESS_* constants + * @return bool|null Returns one of ACCESS_* constants, {@see Type::ACCESS_GRANTED}, {@see Type::ACCESS_ABSTAIN}, or {@see Type::ACCESS_DENIED}. */ public function evaluate(APILimitationValue $value, APIUserReference $currentUser, APIValueObject $object, array $targets = null); @@ -112,9 +143,10 @@ public function getCriterion(APILimitationValue $value, APIUserReference $curren /** * Returns info on valid $limitationValues. * - * @return mixed[]|int In case of array, a hash with key as valid limitations value and value as human readable name - * of that option, in case of int on of VALUE_SCHEMA_* constants. - * Note: The hash might be an instance of Traversable, and not a native php array. + * @return array|Traversable|int In case of array, a hash with key as valid limitations value and value as human-readable name + * of that option. Note: The hash might be an instance of Traversable instead of a native PHP array. + * In case of int, one of VALUE_SCHEMA_* constants. Used in cases where a certain value is accepted + * but the options are too many to return as a hash of options. */ public function valueSchema(); } diff --git a/src/lib/Limitation/LocationLimitationType.php b/src/lib/Limitation/LocationLimitationType.php index 3c7cd6571f..e0ce4ec2b6 100644 --- a/src/lib/Limitation/LocationLimitationType.php +++ b/src/lib/Limitation/LocationLimitationType.php @@ -224,10 +224,9 @@ public function getCriterion(APILimitationValue $value, APIUserReference $curren } /** - * Returns info on valid $limitationValues. + * Returns an integer code meaning that the value must be an array listing location IDs. * - * @return mixed[]|int In case of array, a hash with key as valid limitations value and value as human readable name - * of that option, in case of int on of VALUE_SCHEMA_ constants. + * @return int {@see LocationLimitationType::VALUE_SCHEMA_LOCATION_ID} */ public function valueSchema() { diff --git a/src/lib/Limitation/SubtreeLimitationType.php b/src/lib/Limitation/SubtreeLimitationType.php index c642ec64e8..3ceb4cee0d 100644 --- a/src/lib/Limitation/SubtreeLimitationType.php +++ b/src/lib/Limitation/SubtreeLimitationType.php @@ -258,10 +258,9 @@ public function getCriterion(APILimitationValue $value, APIUserReference $curren } /** - * Returns info on valid $limitationValues. + * Returns an integer code meaning that the value must be an array listing location paths. * - * @return mixed[]|int In case of array, a hash with key as valid limitations value and value as human readable name - * of that option, in case of int on of VALUE_SCHEMA_ constants. + * @return int {@see SubtreeLimitationType::VALUE_SCHEMA_LOCATION_PATH} */ public function valueSchema() { From 9ce461815a666e0da3b87008c08cf8e6ca486a60 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 16 Dec 2024 10:43:14 +0100 Subject: [PATCH 18/92] LocationService: Fix count() phpdoc --- src/contracts/Repository/LocationService.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/contracts/Repository/LocationService.php b/src/contracts/Repository/LocationService.php index 124f7201d3..945323ffdd 100644 --- a/src/contracts/Repository/LocationService.php +++ b/src/contracts/Repository/LocationService.php @@ -267,9 +267,11 @@ public function loadAllLocations(int $offset = 0, int $limit = 25): array; public function find(Filter $filter, ?array $languages = null): LocationList; /** - * Count total number of items returned by {@see find} method. + * Counts total number of items matching the filter. * - * @param string[] $languages a list of language codes to be added as additional constraints. + * Return the count of items that would be returned by {@see LocationService::find()} method. + * + * @param array $languages a list of language codes to be added as additional constraints. * If skipped, by default, unless SiteAccessAware layer has been disabled, languages set * for a SiteAccess in a current context will be used. */ From 586acec2386aab1a32855b1713963b3f9491cf91 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 16 Dec 2024 10:46:55 +0100 Subject: [PATCH 19/92] Enhance `LocationService` phpdoc --- src/contracts/Repository/LocationService.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/contracts/Repository/LocationService.php b/src/contracts/Repository/LocationService.php index 945323ffdd..5181d398d7 100644 --- a/src/contracts/Repository/LocationService.php +++ b/src/contracts/Repository/LocationService.php @@ -57,10 +57,10 @@ public function loadLocation(int $locationId, ?array $prioritizedLanguages = nul * Returned list of Locations will be filtered by what is found and what current user has access to. * * @param array $locationIds - * @param string[]|null $prioritizedLanguages Filter on and use as prioritized language code on translated properties of returned objects. + * @param array|null $prioritizedLanguages Filter on and use as prioritized language code on translated properties of returned objects. * @param bool|null $useAlwaysAvailable Respect always available flag on content when filtering on $prioritizedLanguages. * - * @return \Ibexa\Contracts\Core\Repository\Values\Content\Location[]|iterable + * @return array|iterable */ public function loadLocationList(array $locationIds, ?array $prioritizedLanguages = null, ?bool $useAlwaysAvailable = null): iterable; @@ -253,14 +253,14 @@ public function getAllLocationsCount(): int; * @param int $limit * @param int $offset * - * @return \Ibexa\Contracts\Core\Repository\Values\Content\Location[] + * @return array */ public function loadAllLocations(int $offset = 0, int $limit = 25): array; /** * Fetch a LocationList from the Repository filtered by the given conditions. * - * @param string[] $languages a list of language codes to be added as additional constraints. + * @param array|null $languages a list of language codes to be added as additional constraints. * If skipped, by default, unless SiteAccessAware layer has been disabled, languages set * for a SiteAccess in a current context will be used. */ @@ -271,7 +271,7 @@ public function find(Filter $filter, ?array $languages = null): LocationList; * * Return the count of items that would be returned by {@see LocationService::find()} method. * - * @param array $languages a list of language codes to be added as additional constraints. + * @param array|null $languages a list of language codes to be added as additional constraints. * If skipped, by default, unless SiteAccessAware layer has been disabled, languages set * for a SiteAccess in a current context will be used. */ From 5ffa69698731b7f667ab599dfb5a975a703097f0 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 16 Dec 2024 11:34:27 +0100 Subject: [PATCH 20/92] Enhance `Location` phpdoc --- .../Repository/Values/Content/Location.php | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index 972302e695..7102605e59 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -22,8 +22,8 @@ * @property-read bool $hidden @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::isHidden()} instead. * @property-read bool $invisible @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::isInvisible()} instead. * @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 $remoteId A global unique ID of the content object + * @property-read int $parentLocationId The ID of the parent location * @property-read string $pathString @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getPathString()} instead. * @property-read array $path @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getPath()} instead. * @property-read int $depth @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getDepth()} instead. @@ -89,15 +89,15 @@ abstract class Location extends ValueObject /** * Location ID. * - * @var int Location ID. + * @var int */ protected $id; /** - * the status of the location. + * The status of the location. * - * a location gets the status DRAFT on newly created content which is not published. When content is published the - * location gets the status STATUS_PUBLISHED + * A location gets the status {@see Location::STATUS_DRAFT} on newly created content which is not published. + * When content is published the location gets the status {@see Location::STATUS_PUBLISHED}. * * @var int */ @@ -152,16 +152,19 @@ abstract class Location extends ValueObject protected $parentLocationId; /** - * The materialized path of the location entry, eg: /1/2/. + * The materialized path of the location entry, eg: /1/2/4/23/. * * @var string */ protected $pathString; /** - * Same as {@see Location::$pathString} but as array, e.g.: [ '1', '2', '4', '23' ]. + * The list of ancestor Locations' IDs, ordered in increasing depths, + * starting with '1', and ending with the current Location's ID. * - * @var string[] + * Same as {@see Location::$pathString} but as array, e.g.: `['1', '2', '4', '23']`. + * + * @var array */ protected array $path; @@ -259,7 +262,7 @@ public function getSortClauses(): array /** * The path to the Location represented by the current instance, - * e.g. /1/2/4/23 where 23 is current id. + * e.g. /1/2/4/23/ where 23 is current ID. */ public function getPathString(): string { @@ -267,9 +270,12 @@ public function getPathString(): string } /** - * Same as {@see Location::getPathString()} but as array, e.g.: [ '1', '2', '4', '23' ]. + * The list of ancestor Locations' IDs, ordered in increasing depths, + * starting with 1, and ending with the current Location's ID. + * + * Same as {@see Location::getPathString()} but as array, e.g.: `['1', '2', '4', '23']`. * - * @return string[] + * @return array */ public function getPath(): array { From 1927fcbf7d106c4eaa00a779f6e8ea829533fae2 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 16 Dec 2024 11:35:42 +0100 Subject: [PATCH 21/92] Enhance `Location` phpdoc: @deprecated can't be nested nor used inline. --- src/contracts/Repository/SearchService.php | 86 ++++++++++++------- .../Repository/Values/Content/Location.php | 14 +-- 2 files changed, 63 insertions(+), 37 deletions(-) diff --git a/src/contracts/Repository/SearchService.php b/src/contracts/Repository/SearchService.php index 585c5ae894..852ebd3149 100644 --- a/src/contracts/Repository/SearchService.php +++ b/src/contracts/Repository/SearchService.php @@ -20,7 +20,9 @@ interface SearchService { /** - * Capability flag for scoring feature for use with {@see ::supports()}. + * Capability flag for scoring feature. + * + * To use with {@see SearchService::supports()}. * * Scoring, a search feature telling you how well one search hit scores compared to other items in the search result. * When this is supported you can expect search engine to populate SearchHit->score and SearchResult->maxScore @@ -31,9 +33,11 @@ interface SearchService public const CAPABILITY_SCORING = 1; /** - * Capability flag for facets feature for use with {@see ::supports()}. + * Capability flag for facets feature. + * + * To use with {@see SearchService::supports()}. * - * Faceted search: https://en.wikipedia.org/wiki/Faceted_search + * Faceted search: {@link https://en.wikipedia.org/wiki/Faceted_search} * * Note: Even if search engine tells you this is supported, beware: * - It might not support all facets, by design it will only return facets for facet builders the search engine supports. @@ -45,19 +49,24 @@ interface SearchService public const CAPABILITY_FACETS = 2; /** - * Capability flag for custom fields feature for use with {@see ::supports()}. + * Capability flag for custom fields feature. + * + * To use with {@see SearchService::supports()}. * - * Custom fields is the capability for search engines to 1. allow you to extend the search index via plugins to - * generate custom fields, like a different representation (format, ...) of an existing field or similar. And 2. - * allow you on some search criteria to specify this custom field to rather query on that instead of the default - * field generated by the system. + * Custom fields is the capability for search engines to: + * - Allow you to extend the search index via plugins to + * generate custom fields, like a different representation (format, ...) of an existing field or similar. + * - Allow you on some search criteria to specify this custom field to rather query on that instead of the default + * field generated by the system. * * @since 1.12 eZ Platform 1.12 (ezpublish-kernel 6.12) (constant added in 6.7.6 and up) */ public const CAPABILITY_CUSTOM_FIELDS = 4; /** - * Capability flag for spellcheck feature for use with {@see ::supports()}. + * Capability flag for spellcheck feature. + * + * To use with {@see SearchService::supports()}. * * Spell check within search capabilities refers to ability to suggest better wordings in fulltext search string. * @@ -70,7 +79,9 @@ interface SearchService public const CAPABILITY_SPELLCHECK = 8; /** - * Capability flag for highlight feature for use with {@see ::supports()}. + * Capability flag for highlight feature. + * + * To use with {@see SearchService::supports()}. * * Highlight in search refers to extracting relevant text from the search index that matches the search result, * typically returning a chunk of text of a predefined size with matching text highlighted. @@ -88,7 +99,9 @@ interface SearchService public const CAPABILITY_HIGHLIGHT = 16; /** - * Capability flag for suggest feature for use with {@see ::supports()}. + * Capability flag for suggest feature. + * + * To use with {@see SearchService::supports()}. * * WARNING: This feature is considered experimental given it is not completely clear what it is supposed to do. Feature * might be deprecated in the future. @@ -98,7 +111,9 @@ interface SearchService public const CAPABILITY_SUGGEST = 32; /** - * Capability flag for advanced fulltext feature for use with {@see ::supports()}. + * Capability flag for advanced fulltext feature. + * + * To use with {@see SearchService::supports()}. * * Advance full text is a feature making to possible by current engine to parse advance full text expressions. * @@ -108,7 +123,9 @@ interface SearchService public const CAPABILITY_ADVANCED_FULLTEXT = 64; /** - * Capability flag for aggregation feature for use with {@see ::supports()}. + * Capability flag for aggregation feature. + * + * To use with {@see SearchService::supports()}. * * @since 3.2 eZ Platform 3.2 (ezplatform-kernel 1.2) */ @@ -120,11 +137,11 @@ interface SearchService * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query $query - * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. * Also used to define which field languages are loaded for the returned content. - * Currently supports: array("languages" => array(,..), "useAlwaysAvailable" => bool) - * useAlwaysAvailable defaults to true to avoid exceptions on missing translations - * @param bool $filterOnUserPermissions if true only the objects which the user is allowed to read are returned. + * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. + * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult */ @@ -142,10 +159,10 @@ public function findContent(Query $query, array $languageFilter = [], bool $filt * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query $query - * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. - * Currently supports: array("languages" => array(,..), "useAlwaysAvailable" => bool) - * useAlwaysAvailable defaults to true to avoid exceptions on missing translations - * @param bool $filterOnUserPermissions if true (default) only the objects which is the user allowed to read are returned. + * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. + * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult */ @@ -159,10 +176,10 @@ public function findContentInfo(Query $query, array $languageFilter = [], bool $ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if there is more than than one result matching the criterions * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion $filter - * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. - * Currently supports: array("languages" => array(,..), "useAlwaysAvailable" => bool) - * useAlwaysAvailable defaults to true to avoid exceptions on missing translations - * @param bool $filterOnUserPermissions if true only the objects which is the user allowed to read are returned. + * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. + * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content */ @@ -184,10 +201,11 @@ public function suggest(string $prefix, array $fieldPaths = [], int $limit = 10, * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery $query - * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. - * Currently supports: array("languages" => array(,..), "useAlwaysAvailable" => bool) - * useAlwaysAvailable defaults to true to avoid exceptions on missing translations - * @param bool $filterOnUserPermissions if true only the objects which is the user allowed to read are returned. + * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * Also used to define which field languages are loaded for the returned content. + * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. + * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult */ @@ -200,7 +218,15 @@ public function findLocations(LocationQuery $query, array $languageFilter = [], * * @since 1.12 eZ Platform 1.12 (ezpublish-kernel 6.12) * - * @param int $capabilityFlag One of CAPABILITY_* constants. + * @param int $capabilityFlag One of the CAPABILITY_* constants (only a single one, not a bitwise combination): + * {@see SearchService::CAPABILITY_SCORING CAPABILITY_SCORING}, + * {@see SearchService::CAPABILITY_FACETS CAPABILITY_FACETS}, + * {@see SearchService::CAPABILITY_CUSTOM_FIELDS CAPABILITY_CUSTOM_FIELDS}, + * {@see SearchService::CAPABILITY_SPELLCHECK CAPABILITY_SPELLCHECK}, + * {@internal SearchService::CAPABILITY_HIGHLIGHT CAPABILITY_HIGHLIGHT,} + * {@see SearchService::CAPABILITY_SUGGEST CAPABILITY_SUGGEST}, + * {@see SearchService::CAPABILITY_ADVANCED_FULLTEXT CAPABILITY_ADVANCED_FULLTEXT}, or + * {@see SearchService::CAPABILITY_AGGREGATIONS CAPABILITY_AGGREGATIONS}. * * @return bool */ diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index 7102605e59..b782f7ed76 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -16,17 +16,17 @@ * This class represents a location in the repository. * * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo calls getContentInfo() - * @property-read int $contentId @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getContentId()} instead. - * @property-read int $id @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getId()} instead. + * @property-read int $contentId Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getContentId()} instead. + * @property-read int $id Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getId()} instead. * @property-read int $priority Position of the Location among its siblings when sorted using priority - * @property-read bool $hidden @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::isHidden()} instead. - * @property-read bool $invisible @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::isInvisible()} instead. + * @property-read bool $hidden Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::isHidden()} instead. + * @property-read bool $invisible Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::isInvisible()} instead. * @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 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getPathString()} instead. - * @property-read array $path @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getPath()} instead. - * @property-read int $depth @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getDepth()} instead. + * @property-read string $pathString Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getPathString()} instead. + * @property-read array $path Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getPath()} instead. + * @property-read int $depth Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getDepth()} instead. * @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_*} */ From c15cfaf5eeb7a749cc125a9168526b5ac8113854 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 16 Dec 2024 12:59:20 +0100 Subject: [PATCH 22/92] Enhance `Location` phpdoc: Add an internal link --- src/contracts/Repository/Values/Content/Location.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index b782f7ed76..5eb5edd09a 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -15,7 +15,7 @@ /** * This class represents a location in the repository. * - * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo calls getContentInfo() + * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo Calls {@see Location::getContentInfo()} * @property-read int $contentId Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getContentId()} instead. * @property-read int $id Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getId()} instead. * @property-read int $priority Position of the Location among its siblings when sorted using priority From d8c2aed70a88c565070dabffec3206df7b57fb44 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:37:49 +0100 Subject: [PATCH 23/92] Enhance `ValueObject` phpdoc - Describes a bit more `getProperties` - Details `getProperties` param type and returned type - Hides link to internal function - Uses `@internal` as a short for "@ignore This method is for internal use" - Fixes internal links --- .../Repository/Values/ValueObject.php | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/contracts/Repository/Values/ValueObject.php b/src/contracts/Repository/Values/ValueObject.php index 0ab3d6e7fe..d2827a8770 100644 --- a/src/contracts/Repository/Values/ValueObject.php +++ b/src/contracts/Repository/Values/ValueObject.php @@ -26,7 +26,7 @@ abstract class ValueObject * Readonly properties values must be set using $properties as they are not writable anymore * after object has been created. * - * @param array $properties + * @param array $properties */ public function __construct(array $properties = []) { @@ -36,17 +36,18 @@ public function __construct(array $properties = []) } /** - * Function where list of properties are returned. + * Returns list of available properties' names. * - * Used by {@see attributes()}, override to add dynamic properties + * {@internal Used by {@see ValueObject::attributes()}} + * Override to add dynamic properties. * - * @uses ::__isset() + * @uses ValueObject::__isset() * * @todo Make object traversable and reuse this function there (hence why this is not exposed) * - * @param array $dynamicProperties Additional dynamic properties exposed on the object + * @param array $dynamicProperties Additional dynamic properties exposed on the object * - * @return array + * @return array * * @SerializerIgnore() */ @@ -65,7 +66,7 @@ protected function getProperties($dynamicProperties = []) /** * Magic set function handling writes to non public properties. * - * @ignore This method is for internal use + * @internal * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException When property does not exist * @throws \Ibexa\Contracts\Core\Repository\Exceptions\PropertyReadOnlyException When property is readonly (protected) @@ -86,7 +87,7 @@ public function __set($property, $value) * * Returns value for all readonly (protected) properties. * - * @ignore This method is for internal use + * @internal * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException exception on all reads to undefined properties so typos are not silently accepted. * @@ -107,7 +108,7 @@ public function __get($property) * * Returns true for all (public/)protected/private properties. * - * @ignore This method is for internal use + * @internal * * @param string $property Name of the property * @@ -121,12 +122,12 @@ public function __isset($property) /** * Magic unset function handling unset() to non public properties. * - * @ignore This method is for internal use + * @internal * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException exception on all writes to undefined properties so typos are not silently accepted and * @throws \Ibexa\Contracts\Core\Repository\Exceptions\PropertyReadOnlyException exception on readonly (protected) properties. * - * @uses ::__set() + * @uses ValueObject::__set() * * @param string $property Name of the property * @@ -147,7 +148,7 @@ public function __unset($property) * var_export() generates code, that calls this method when it * is parsed with PHP. * - * @ignore This method is for internal use + * @internal * * @param mixed[] $array * @@ -161,11 +162,11 @@ public static function __set_state(array $array) /** * Internal function for Legacy template engine compatibility to get property value. * - * @ignore This method is for internal use + * @internal * * @deprecated Since 5.0, available purely for legacy eZTemplate compatibility * - * @uses ::__get() + * @uses ValueObject::__get() * * @param string $property * @@ -179,11 +180,12 @@ final public function attribute($property) /** * Internal function for Legacy template engine compatibility to get properties. * - * @ignore This method is for internal use + * @internal * * @deprecated Since 5.0, available purely for legacy eZTemplate compatibility * - * @uses ::__isset() + * @uses ValueObject::getProperties() + * @uses ValueObject::__isset() * * @return array */ @@ -195,11 +197,11 @@ final public function attributes() /** * Internal function for Legacy template engine compatibility to check existence of property. * - * @ignore This method is for internal use + * @internal * * @deprecated Since 5.0, available purely for legacy eZTemplate compatibility * - * @uses ::__isset() + * @uses ValueObject::__isset() * * @param string $property * From 6dfba07548f6e3aef2a4f6d785903fa9e0a3f90d Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 17 Dec 2024 17:02:18 +0100 Subject: [PATCH 24/92] Enhance `FieldType\Generic\Type` phpdoc: Fix internal links --- src/contracts/FieldType/Generic/Type.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/contracts/FieldType/Generic/Type.php b/src/contracts/FieldType/Generic/Type.php index 55c61b8ab1..b09f77220e 100644 --- a/src/contracts/FieldType/Generic/Type.php +++ b/src/contracts/FieldType/Generic/Type.php @@ -260,15 +260,15 @@ final public function acceptValue($inputValue): Value * If given $inputValue could not be converted or is already an instance of dedicate value object, * the method should simply return it. * - * This is an operation method for {@see acceptValue()}. + * This is an operation method for {@see Type::acceptValue()}. * * Example implementation: * ``` - * protected function createValueFromInput( $inputValue ) + * protected function createValueFromInput($inputValue) * { * if (is_array($inputValue)) * { - * $inputValue = \My\FieldType\CookieJar\Value( $inputValue ); + * $inputValue = \My\FieldType\CookieJar\Value($inputValue); * } * * return $inputValue; @@ -304,7 +304,7 @@ protected function getValueClass(): string /** * Throws an exception if the given $value is not an instance of the supported value subtype. * - * This is an operation method for {@see acceptValue()}. + * This is an operation method for {@see Type::acceptValue()}. * * Default implementation expects the value class to reside in the same namespace as its * FieldType class and is named "Value". @@ -320,7 +320,7 @@ protected function getValueClass(): string * } * ``` * - * @param mixed $value A value returned by {@see createValueFromInput()}. + * @param mixed $value A value returned by {@see Type::createValueFromInput()}. * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException If the parameter is not an instance of the supported value subtype. */ From bc7ccb26185fc48255ede23ad0d322388f9d7748 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 17 Dec 2024 17:03:39 +0100 Subject: [PATCH 25/92] Enhance `FieldType\FieldType` phpdoc: Fix code blocks --- src/contracts/FieldType/FieldType.php | 56 +++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/contracts/FieldType/FieldType.php b/src/contracts/FieldType/FieldType.php index 46694a2458..388fb0e657 100644 --- a/src/contracts/FieldType/FieldType.php +++ b/src/contracts/FieldType/FieldType.php @@ -100,20 +100,20 @@ abstract public function getSettingsSchema(); * It is considered best practice to return a hash map, which contains * rudimentary settings structures, like e.g. for the "ezstring" FieldType * - * - * array( - * 'stringLength' => array( - * 'minStringLength' => array( - * 'type' => 'int', - * 'default' => 0, - * ), - * 'maxStringLength' => array( - * 'type' => 'int' - * 'default' => null, - * ) - * ), - * ); - * + * ``` + * [ + * 'stringLength' => [ + * 'minStringLength' => [ + * 'type' => 'int', + * 'default' => 0, + * ], + * 'maxStringLength' => [ + * 'type' => 'int' + * 'default' => null, + * ], + * ], + * ]; + * ``` * * @return mixed */ @@ -360,22 +360,22 @@ abstract public function fromPersistenceValue(FieldValue $fieldValue); * * @param \Ibexa\Contracts\Core\FieldType\Value $value * - * @return array Hash with relation type as key and array of destination content ids as value. + * @return array Hash with relation type as key and array of destination content IDs as value. * * Example: - * - * array( - * \Ibexa\Contracts\Core\Repository\Values\Content\Relation::LINK => array( - * "contentIds" => array( 12, 13, 14 ), - * "locationIds" => array( 24 ) - * ), - * \Ibexa\Contracts\Core\Repository\Values\Content\Relation::EMBED => array( - * "contentIds" => array( 12 ), - * "locationIds" => array( 24, 45 ) - * ), - * \Ibexa\Contracts\Core\Repository\Values\Content\Relation::FIELD => array( 12 ) - * ) - * + * ``` + * [ + * \Ibexa\Contracts\Core\Repository\Values\Content\Relation::LINK => [ + * 'contentIds' => [12, 13, 14], + * 'locationIds' => [24] + * ], + * \Ibexa\Contracts\Core\Repository\Values\Content\Relation::EMBED => [ + * 'contentIds" => [12], + * 'locationIds' => [24, 45] + * ], + * \Ibexa\Contracts\Core\Repository\Values\Content\Relation::FIELD => [12] + * ] + * ``` */ abstract public function getRelations(Value $value); } From 748309bf1b1e5a2bf3f11899f8a3cf20c341ec80 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 19 Dec 2024 11:13:01 +0100 Subject: [PATCH 26/92] Values\Content\Location: Set protected/read-only property as internal --- src/contracts/Repository/Values/Content/Location.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index 5eb5edd09a..1d3142bdb3 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -90,6 +90,7 @@ abstract class Location extends ValueObject * Location ID. * * @var int + * @internal Read-only property accessed through magic getter. */ protected $id; @@ -110,6 +111,7 @@ abstract class Location extends ValueObject * sort order. * * @var int + * @internal Read-only property accessed through magic getter. */ protected $priority; @@ -117,6 +119,7 @@ abstract class Location extends ValueObject * Indicates that the Location entity is hidden (explicitly or hidden by content). * * @var bool + * @internal Read-only property accessed through magic getter. */ protected $hidden; @@ -125,6 +128,7 @@ abstract class Location extends ValueObject * or implicitly hidden by its Content or an ancestor Location. * * @var bool + * @internal Read-only property accessed through magic getter. */ protected $invisible; @@ -132,6 +136,7 @@ abstract class Location extends ValueObject * Indicates that the Location entity has been explicitly marked as hidden. * * @var bool + * @internal Read-only property accessed through magic getter. */ protected $explicitlyHidden; @@ -141,6 +146,7 @@ abstract class Location extends ValueObject * A universally unique identifier. * * @var string + * @internal Read-only property accessed through magic getter. */ protected $remoteId; @@ -148,6 +154,7 @@ abstract class Location extends ValueObject * Parent ID. * * @var int Location ID. + * @internal Read-only property accessed through magic getter. */ protected $parentLocationId; @@ -155,6 +162,7 @@ abstract class Location extends ValueObject * The materialized path of the location entry, eg: /1/2/4/23/. * * @var string + * @internal Read-only property accessed through magic getter. */ protected $pathString; @@ -165,6 +173,7 @@ abstract class Location extends ValueObject * Same as {@see Location::$pathString} but as array, e.g.: `['1', '2', '4', '23']`. * * @var array + * @internal Read-only property accessed through magic getter. */ protected array $path; @@ -172,6 +181,7 @@ abstract class Location extends ValueObject * Depth location has in the location tree. * * @var int + * @internal Read-only property accessed through magic getter. */ protected $depth; @@ -181,6 +191,7 @@ abstract class Location extends ValueObject * Valid values are found at {@link Location::SORT_FIELD_*} * * @var int + * @internal Read-only property accessed through magic getter. */ protected $sortField; @@ -190,6 +201,7 @@ abstract class Location extends ValueObject * Valid values are {@link Location::SORT_ORDER_*} * * @var int + * @internal Read-only property accessed through magic getter. */ protected $sortOrder; From 49b624308dacba8bbc6767230262248a7279a8cc Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:14:46 +0100 Subject: [PATCH 27/92] Revert "Values\Content\Location: Set protected/read-only property as internal" This reverts commit 44aede1d26a38c8fee71ec204804f9b3aca8f3b4. --- src/contracts/Repository/Values/Content/Location.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index 1d3142bdb3..5eb5edd09a 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -90,7 +90,6 @@ abstract class Location extends ValueObject * Location ID. * * @var int - * @internal Read-only property accessed through magic getter. */ protected $id; @@ -111,7 +110,6 @@ abstract class Location extends ValueObject * sort order. * * @var int - * @internal Read-only property accessed through magic getter. */ protected $priority; @@ -119,7 +117,6 @@ abstract class Location extends ValueObject * Indicates that the Location entity is hidden (explicitly or hidden by content). * * @var bool - * @internal Read-only property accessed through magic getter. */ protected $hidden; @@ -128,7 +125,6 @@ abstract class Location extends ValueObject * or implicitly hidden by its Content or an ancestor Location. * * @var bool - * @internal Read-only property accessed through magic getter. */ protected $invisible; @@ -136,7 +132,6 @@ abstract class Location extends ValueObject * Indicates that the Location entity has been explicitly marked as hidden. * * @var bool - * @internal Read-only property accessed through magic getter. */ protected $explicitlyHidden; @@ -146,7 +141,6 @@ abstract class Location extends ValueObject * A universally unique identifier. * * @var string - * @internal Read-only property accessed through magic getter. */ protected $remoteId; @@ -154,7 +148,6 @@ abstract class Location extends ValueObject * Parent ID. * * @var int Location ID. - * @internal Read-only property accessed through magic getter. */ protected $parentLocationId; @@ -162,7 +155,6 @@ abstract class Location extends ValueObject * The materialized path of the location entry, eg: /1/2/4/23/. * * @var string - * @internal Read-only property accessed through magic getter. */ protected $pathString; @@ -173,7 +165,6 @@ abstract class Location extends ValueObject * Same as {@see Location::$pathString} but as array, e.g.: `['1', '2', '4', '23']`. * * @var array - * @internal Read-only property accessed through magic getter. */ protected array $path; @@ -181,7 +172,6 @@ abstract class Location extends ValueObject * Depth location has in the location tree. * * @var int - * @internal Read-only property accessed through magic getter. */ protected $depth; @@ -191,7 +181,6 @@ abstract class Location extends ValueObject * Valid values are found at {@link Location::SORT_FIELD_*} * * @var int - * @internal Read-only property accessed through magic getter. */ protected $sortField; @@ -201,7 +190,6 @@ abstract class Location extends ValueObject * Valid values are {@link Location::SORT_ORDER_*} * * @var int - * @internal Read-only property accessed through magic getter. */ protected $sortOrder; From 1e847aef67b314fe77694b4b96d23590235d6672 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:21:07 +0100 Subject: [PATCH 28/92] Revert src/lib/Limitation/ Revert 1799d56726f42e82f65a1054a2a823746dd2a4de changes on src/lib/Limitation/ as this is out of contracts scope. --- src/lib/Limitation/LocationLimitationType.php | 5 +++-- src/lib/Limitation/SubtreeLimitationType.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/Limitation/LocationLimitationType.php b/src/lib/Limitation/LocationLimitationType.php index e0ce4ec2b6..3c7cd6571f 100644 --- a/src/lib/Limitation/LocationLimitationType.php +++ b/src/lib/Limitation/LocationLimitationType.php @@ -224,9 +224,10 @@ public function getCriterion(APILimitationValue $value, APIUserReference $curren } /** - * Returns an integer code meaning that the value must be an array listing location IDs. + * Returns info on valid $limitationValues. * - * @return int {@see LocationLimitationType::VALUE_SCHEMA_LOCATION_ID} + * @return mixed[]|int In case of array, a hash with key as valid limitations value and value as human readable name + * of that option, in case of int on of VALUE_SCHEMA_ constants. */ public function valueSchema() { diff --git a/src/lib/Limitation/SubtreeLimitationType.php b/src/lib/Limitation/SubtreeLimitationType.php index 3ceb4cee0d..c642ec64e8 100644 --- a/src/lib/Limitation/SubtreeLimitationType.php +++ b/src/lib/Limitation/SubtreeLimitationType.php @@ -258,9 +258,10 @@ public function getCriterion(APILimitationValue $value, APIUserReference $curren } /** - * Returns an integer code meaning that the value must be an array listing location paths. + * Returns info on valid $limitationValues. * - * @return int {@see SubtreeLimitationType::VALUE_SCHEMA_LOCATION_PATH} + * @return mixed[]|int In case of array, a hash with key as valid limitations value and value as human readable name + * of that option, in case of int on of VALUE_SCHEMA_ constants. */ public function valueSchema() { From 0b82f1a605a066685865a59e8964eb2dd4e057f7 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 20 Dec 2024 17:15:29 +0100 Subject: [PATCH 29/92] `Limitation\Type`: type array keys --- src/contracts/Limitation/Type.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/contracts/Limitation/Type.php b/src/contracts/Limitation/Type.php index cb5410d705..584cba60e1 100644 --- a/src/contracts/Limitation/Type.php +++ b/src/contracts/Limitation/Type.php @@ -92,17 +92,17 @@ public function acceptValue(APILimitationValue $limitationValue); * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation $limitationValue * - * @return \Ibexa\Contracts\Core\FieldType\ValidationError[] + * @return array */ public function validate(APILimitationValue $limitationValue); /** * Create the Limitation Value. * - * The is the method to create values as Limitation type needs value knowledge anyway in acceptValue, + * This is the method to create values as Limitation type needs value knowledge anyway in acceptValue, * the reverse relation is provided by means of identifier lookup (Value has identifier, and so does RoleService). * - * @param mixed[] $limitationValues + * @param array $limitationValues * * @return \Ibexa\Contracts\Core\Repository\Values\User\Limitation */ @@ -120,7 +120,7 @@ public function buildValue(array $limitationValues); * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation $value * @param \Ibexa\Contracts\Core\Repository\Values\User\UserReference $currentUser * @param \Ibexa\Contracts\Core\Repository\Values\ValueObject $object - * @param \Ibexa\Contracts\Core\Repository\Values\ValueObject[]|null $targets An array of location, parent or "assignment" + * @param array|null $targets An array of location, parent or "assignment" * objects, if null: none where provided by caller * * @return bool|null Returns one of ACCESS_* constants, {@see Type::ACCESS_GRANTED}, {@see Type::ACCESS_ABSTAIN}, or {@see Type::ACCESS_DENIED}. From f2cefa620c70e96a45ec78c4fa3d312b5c9028c6 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Sun, 22 Dec 2024 13:16:03 +0100 Subject: [PATCH 30/92] ValueObject: Format desc --- src/contracts/Repository/Values/ValueObject.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/contracts/Repository/Values/ValueObject.php b/src/contracts/Repository/Values/ValueObject.php index d2827a8770..16ad2033da 100644 --- a/src/contracts/Repository/Values/ValueObject.php +++ b/src/contracts/Repository/Values/ValueObject.php @@ -13,9 +13,9 @@ /** * The base class for all value objects and structs. * - * Supports readonly properties by marking them as protected. + * Supports read-only properties by marking them as protected. * In this case they will only be writable using constructor, and need to be documented - * using property-read <$var> annotation in class doc in addition to inline property doc. + * using `@property-read <$var>` annotation in class doc in addition to inline property doc. * Writable properties must be public and must be documented inline. */ abstract class ValueObject From effbcf776e6291e43e8162e9a662caa27105c1e3 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Sun, 22 Dec 2024 19:54:27 +0100 Subject: [PATCH 31/92] ValueObject: Format desc --- src/contracts/Repository/Values/ValueObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Repository/Values/ValueObject.php b/src/contracts/Repository/Values/ValueObject.php index 16ad2033da..7e57f82dee 100644 --- a/src/contracts/Repository/Values/ValueObject.php +++ b/src/contracts/Repository/Values/ValueObject.php @@ -23,7 +23,7 @@ abstract class ValueObject /** * Construct object optionally with a set of properties. * - * Readonly properties values must be set using $properties as they are not writable anymore + * Readonly properties values must be set using `$properties` as they aren't writable anymore * after object has been created. * * @param array $properties From 98c24119eaafa307cecf4db73a18d8bd60e35a01 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Sun, 22 Dec 2024 19:54:41 +0100 Subject: [PATCH 32/92] ValueObject: Format desc --- src/contracts/Repository/Values/ValueObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Repository/Values/ValueObject.php b/src/contracts/Repository/Values/ValueObject.php index 7e57f82dee..583cd307bd 100644 --- a/src/contracts/Repository/Values/ValueObject.php +++ b/src/contracts/Repository/Values/ValueObject.php @@ -64,7 +64,7 @@ protected function getProperties($dynamicProperties = []) } /** - * Magic set function handling writes to non public properties. + * Magic set function handling writes to non-public properties. * * @internal * From b1ede48bac8872d988d90134f4b3c57b2ca663b4 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:24:36 +0100 Subject: [PATCH 33/92] ValueObject.php: fix phpdoc_inline_tag_normalizer --- src/contracts/Repository/Values/ValueObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Repository/Values/ValueObject.php b/src/contracts/Repository/Values/ValueObject.php index 583cd307bd..ca880a8283 100644 --- a/src/contracts/Repository/Values/ValueObject.php +++ b/src/contracts/Repository/Values/ValueObject.php @@ -38,7 +38,7 @@ public function __construct(array $properties = []) /** * Returns list of available properties' names. * - * {@internal Used by {@see ValueObject::attributes()}} + * {@internal Used by {@see ValueObject::attributes()}.} * Override to add dynamic properties. * * @uses ValueObject::__isset() From 6ce145dd4823f47e92a208fe32f602f4c1c92983 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:57:43 +0100 Subject: [PATCH 34/92] phpstan-baseline.neon: Update after LocationService::loadLocationList() @return change --- phpstan-baseline.neon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index cba4316dd0..0e9b7feb72 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -241,7 +241,7 @@ parameters: path: src/bundle/Core/Command/RegenerateUrlAliasesCommand.php - - message: "#^Method Ibexa\\\\Bundle\\\\Core\\\\Command\\\\RegenerateUrlAliasesCommand\\:\\:loadSpecificLocations\\(\\) should return array\\ but returns iterable\\\\.$#" + message: "#^Method Ibexa\\\\Bundle\\\\Core\\\\Command\\\\RegenerateUrlAliasesCommand\\:\\:loadSpecificLocations\\(\\) should return array\\ but returns iterable.$#" count: 1 path: src/bundle/Core/Command/RegenerateUrlAliasesCommand.php @@ -251,7 +251,7 @@ parameters: path: src/bundle/Core/Command/RegenerateUrlAliasesCommand.php - - message: "#^Parameter \\#2 \\$array of function array_map expects array, iterable\\ given\\.$#" + message: "#^Parameter \\#2 \\$array of function array_map expects array, iterable given\\.$#" count: 1 path: src/bundle/Core/Command/RegenerateUrlAliasesCommand.php From 99be2c0ccc6e73b92fad50d83f94bf807677d091 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 13:02:47 +0100 Subject: [PATCH 35/92] phpstan-baseline.neon: Update after ValueObject::__construct() @param $properties change $properties has now value type specified --- phpstan-baseline.neon | 5 ----- 1 file changed, 5 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 0e9b7feb72..483ef4007a 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -5140,11 +5140,6 @@ parameters: count: 1 path: src/contracts/Limitation/Target/Builder/VersionBuilder.php - - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Limitation\\\\Target\\\\DestinationLocation\\:\\:__construct\\(\\) has parameter \\$properties with no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Limitation/Target/DestinationLocation.php - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Limitation\\\\Type\\:\\:acceptValue\\(\\) has no return type specified\\.$#" count: 1 From 478b0b0b46f92038ce63eea9a64bbf0dd7b90392 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 13:09:48 +0100 Subject: [PATCH 36/92] Type::valueSchema(): Can it return generic \Traversable? Method Ibexa\Contracts\Core\Limitation\Type::valueSchema() has invalid return type Ibexa\Contracts\Core\Limitation\Traversable. To fix this, it's possible do add a leading backslash, but it throws a new error: Method Ibexa\Contracts\Core\Limitation\Type::valueSchema() return type has no value type specified in iterable type Traversable. See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type --- src/contracts/Limitation/Type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Limitation/Type.php b/src/contracts/Limitation/Type.php index 584cba60e1..7103069bbd 100644 --- a/src/contracts/Limitation/Type.php +++ b/src/contracts/Limitation/Type.php @@ -143,7 +143,7 @@ public function getCriterion(APILimitationValue $value, APIUserReference $curren /** * Returns info on valid $limitationValues. * - * @return array|Traversable|int In case of array, a hash with key as valid limitations value and value as human-readable name + * @return array|int In case of array, a hash with key as valid limitations value and value as human-readable name * of that option. Note: The hash might be an instance of Traversable instead of a native PHP array. * In case of int, one of VALUE_SCHEMA_* constants. Used in cases where a certain value is accepted * but the options are too many to return as a hash of options. From 768fd7e21a6e3a2b6d8bb8518af41db76f6f574e Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 13:13:03 +0100 Subject: [PATCH 37/92] phpstan-baseline.neon: Update after ValueObject::__construct() @param $properties change $properties has now value type specified --- phpstan-baseline.neon | 5 ----- 1 file changed, 5 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 483ef4007a..3380513e80 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -5270,11 +5270,6 @@ parameters: count: 1 path: src/contracts/Persistence/Content/Type.php - - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Type\\\\FieldDefinition\\:\\:__construct\\(\\) has parameter \\$properties with no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Persistence/Content/Type/FieldDefinition.php - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Type\\\\Handler\\:\\:delete\\(\\) has no return type specified\\.$#" count: 1 From 796a62cf8f919f5366313e3090a8054effe0dfd1 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 13:21:23 +0100 Subject: [PATCH 38/92] phpstan-baseline.neon: Update --- phpstan-baseline.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 3380513e80..7b61863419 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -11066,7 +11066,7 @@ parameters: path: src/lib/Limitation/BlockingLimitationType.php - - message: "#^Return type \\(void\\) of method Ibexa\\\\Core\\\\Limitation\\\\ChangeOwnerLimitationType\\:\\:valueSchema\\(\\) should be compatible with return type \\(array\\|int\\) of method Ibexa\\\\Contracts\\\\Core\\\\Limitation\\\\Type\\:\\:valueSchema\\(\\)$#" + message: "#^Return type \\(void\\) of method Ibexa\\\\Core\\\\Limitation\\\\ChangeOwnerLimitationType\\:\\:valueSchema\\(\\) should be compatible with return type \\(array\\|int\\) of method Ibexa\\\\Contracts\\\\Core\\\\Limitation\\\\Type\\:\\:valueSchema\\(\\)$#" count: 1 path: src/lib/Limitation/ChangeOwnerLimitationType.php From 70cd98503d526c29ea370d0b63726f555749d2c4 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:51:33 +0100 Subject: [PATCH 39/92] Reset \Ibexa\Contracts\Core\Limitation\Type::valueSchema() Too difficult to solve in this PR --- src/contracts/Limitation/Type.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/contracts/Limitation/Type.php b/src/contracts/Limitation/Type.php index 584cba60e1..d57a3af203 100644 --- a/src/contracts/Limitation/Type.php +++ b/src/contracts/Limitation/Type.php @@ -143,10 +143,9 @@ public function getCriterion(APILimitationValue $value, APIUserReference $curren /** * Returns info on valid $limitationValues. * - * @return array|Traversable|int In case of array, a hash with key as valid limitations value and value as human-readable name - * of that option. Note: The hash might be an instance of Traversable instead of a native PHP array. - * In case of int, one of VALUE_SCHEMA_* constants. Used in cases where a certain value is accepted - * but the options are too many to return as a hash of options. + * @return mixed[]|int In case of array, a hash with key as valid limitations value and value as human readable name + * of that option, in case of int on of VALUE_SCHEMA_* constants. + * Note: The hash might be an instance of Traversable, and not a native php array. */ public function valueSchema(); } From f835b2926e2844003c1c1530ede4e4df1a75a213 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:31:38 +0100 Subject: [PATCH 40/92] phpstan-baseline.neon: Remove or update not matched --- phpstan-baseline.neon | 78 +++---------------------------------------- 1 file changed, 4 insertions(+), 74 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 7b61863419..0d2754b0e4 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -5565,26 +5565,6 @@ parameters: count: 1 path: src/contracts/Repository/Decorator/LocationServiceDecorator.php - - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Decorator\\\\SearchServiceDecorator\\:\\:findContent\\(\\) has parameter \\$languageFilter with no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Repository/Decorator/SearchServiceDecorator.php - - - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Decorator\\\\SearchServiceDecorator\\:\\:findContentInfo\\(\\) has parameter \\$languageFilter with no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Repository/Decorator/SearchServiceDecorator.php - - - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Decorator\\\\SearchServiceDecorator\\:\\:findLocations\\(\\) has parameter \\$languageFilter with no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Repository/Decorator/SearchServiceDecorator.php - - - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Decorator\\\\SearchServiceDecorator\\:\\:findSingle\\(\\) has parameter \\$languageFilter with no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Repository/Decorator/SearchServiceDecorator.php - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Decorator\\\\SearchServiceDecorator\\:\\:suggest\\(\\) has no return type specified\\.$#" count: 1 @@ -6855,26 +6835,6 @@ parameters: count: 1 path: src/contracts/Repository/PermissionCriterionResolver.php - - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\SearchService\\:\\:findContent\\(\\) has parameter \\$languageFilter with no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Repository/SearchService.php - - - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\SearchService\\:\\:findContentInfo\\(\\) has parameter \\$languageFilter with no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Repository/SearchService.php - - - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\SearchService\\:\\:findLocations\\(\\) has parameter \\$languageFilter with no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Repository/SearchService.php - - - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\SearchService\\:\\:findSingle\\(\\) has parameter \\$languageFilter with no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Repository/SearchService.php - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\SearchService\\:\\:suggest\\(\\) has no return type specified\\.$#" count: 1 @@ -7255,21 +7215,11 @@ parameters: count: 1 path: src/contracts/Repository/Values/Content/Search/SearchResult.php - - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Search\\\\SearchResult\\:\\:__construct\\(\\) has parameter \\$properties with no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Repository/Values/Content/Search/SearchResult.php - - message: "#^Class Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Trash\\\\SearchResult implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" count: 1 path: src/contracts/Repository/Values/Content/Trash/SearchResult.php - - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Trash\\\\SearchResult\\:\\:__construct\\(\\) has parameter \\$properties with no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Repository/Values/Content/Trash/SearchResult.php - - message: "#^Class Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Trash\\\\TrashItemDeleteResultList implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" count: 1 @@ -7405,26 +7355,11 @@ parameters: count: 1 path: src/contracts/Repository/Values/UserPreference/UserPreferenceList.php - - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\ValueObject\\:\\:__construct\\(\\) has parameter \\$properties with no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Repository/Values/ValueObject.php - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\ValueObject\\:\\:attributes\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 path: src/contracts/Repository/Values/ValueObject.php - - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\ValueObject\\:\\:getProperties\\(\\) has parameter \\$dynamicProperties with no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Repository/Values/ValueObject.php - - - - message: "#^Method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\ValueObject\\:\\:getProperties\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Repository/Values/ValueObject.php - - message: "#^Parameter \\#2 \\$value of method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\ValueObject\\:\\:__set\\(\\) expects string, null given\\.$#" count: 1 @@ -11066,7 +11001,7 @@ parameters: path: src/lib/Limitation/BlockingLimitationType.php - - message: "#^Return type \\(void\\) of method Ibexa\\\\Core\\\\Limitation\\\\ChangeOwnerLimitationType\\:\\:valueSchema\\(\\) should be compatible with return type \\(array\\|int\\) of method Ibexa\\\\Contracts\\\\Core\\\\Limitation\\\\Type\\:\\:valueSchema\\(\\)$#" + message: "#^Return type \\(void\\) of method Ibexa\\\\Core\\\\Limitation\\\\ChangeOwnerLimitationType\\:\\:valueSchema\\(\\) should be compatible with return type \\(array\\|int\\) of method Ibexa\\\\Contracts\\\\Core\\\\Limitation\\\\Type\\:\\:valueSchema\\(\\)$#" count: 1 path: src/lib/Limitation/ChangeOwnerLimitationType.php @@ -17466,8 +17401,8 @@ parameters: path: src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php - - message: "#^Method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\Type\\\\MemoryCachingHandler\\:\\:loadContentTypeList\\(\\) should return array\\ but returns array\\\\.$#" - count: 1 + message: "#^Method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\Type\\\\MemoryCachingHandler\\:\\:loadContentTypeList\\(\\) should return array\\ but returns array\\\\.$#" + count: 2 path: src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php - @@ -17495,11 +17430,6 @@ parameters: count: 1 path: src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php - - - message: "#^Method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\Type\\\\MemoryCachingHandler\\:\\:loadGroups\\(\\) should return array\\ but returns array\\\\.$#" - count: 1 - path: src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php - - message: "#^Method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\Type\\\\MemoryCachingHandler\\:\\:storeGroupCache\\(\\) has parameter \\$groups with no value type specified in iterable type array\\.$#" count: 1 @@ -18931,7 +18861,7 @@ parameters: path: src/lib/Persistence/Legacy/User/Handler.php - - message: "#^Cannot access offset mixed on non\\-empty\\-array\\|Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\User\\\\RoleAssignment\\.$#" + message: "#^Cannot access offset mixed on non\\-empty\\-array\\\\|Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\User\\\\RoleAssignment\\.$#" count: 1 path: src/lib/Persistence/Legacy/User/Mapper.php From 59d8c293db4ee64e7af295999b6bbef44a59e024 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 17:07:52 +0100 Subject: [PATCH 41/92] phpstan-baseline.neon: Remove or update not matched --- phpstan-baseline.neon | 43 +++++++++---------------------------------- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 0d2754b0e4..497335880b 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -17402,7 +17402,7 @@ parameters: - message: "#^Method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\Type\\\\MemoryCachingHandler\\:\\:loadContentTypeList\\(\\) should return array\\ but returns array\\\\.$#" - count: 2 + count: 1 path: src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php - @@ -17430,6 +17430,11 @@ parameters: count: 1 path: src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php + - + message: "#^Method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\Type\\\\MemoryCachingHandler\\:\\:loadGroups\\(\\) should return array\\ but returns array\\\\.$#" + count: 1 + path: src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php + - message: "#^Method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\Type\\\\MemoryCachingHandler\\:\\:storeGroupCache\\(\\) has parameter \\$groups with no value type specified in iterable type array\\.$#" count: 1 @@ -20061,7 +20066,7 @@ parameters: path: src/lib/Repository/Mapper/RoleDomainMapper.php - - message: "#^Parameter \\#1 \\$limitationValues of method Ibexa\\\\Contracts\\\\Core\\\\Limitation\\\\Type\\:\\:buildValue\\(\\) expects array, array\\|null given\\.$#" + message: "#^Parameter \\#1 \\$limitationValues of method Ibexa\\\\Contracts\\\\Core\\\\Limitation\\\\Type\\:\\:buildValue\\(\\) expects array\\, array\\|null given\\.$#" count: 2 path: src/lib/Repository/Mapper/RoleDomainMapper.php @@ -20241,7 +20246,7 @@ parameters: path: src/lib/Repository/Permission/PermissionResolver.php - - message: "#^Parameter \\#1 \\$limitationValues of method Ibexa\\\\Contracts\\\\Core\\\\Limitation\\\\Type\\:\\:buildValue\\(\\) expects array, array\\|null given\\.$#" + message: "#^Parameter \\#1 \\$limitationValues of method Ibexa\\\\Contracts\\\\Core\\\\Limitation\\\\Type\\:\\:buildValue\\(\\) expects array\\, array\\|null given\\.$#" count: 1 path: src/lib/Repository/Permission/PermissionResolver.php @@ -20511,7 +20516,7 @@ parameters: path: src/lib/Repository/RoleService.php - - message: "#^Method Ibexa\\\\Core\\\\Repository\\\\RoleService\\:\\:validateRoleCreateStruct\\(\\) should return iterable\\\\>\\> but returns array\\\\>\\>\\.$#" + message: "#^Method Ibexa\\\\Core\\\\Repository\\\\RoleService\\:\\:validateRoleCreateStruct\\(\\) should return iterable\\\\>\\> but returns array\\\\>\\>\\.$#" count: 1 path: src/lib/Repository/RoleService.php @@ -20680,26 +20685,6 @@ parameters: count: 1 path: src/lib/Repository/SiteAccessAware/Repository.php - - - message: "#^Method Ibexa\\\\Core\\\\Repository\\\\SiteAccessAware\\\\SearchService\\:\\:findContent\\(\\) has parameter \\$languageFilter with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Repository/SiteAccessAware/SearchService.php - - - - message: "#^Method Ibexa\\\\Core\\\\Repository\\\\SiteAccessAware\\\\SearchService\\:\\:findContentInfo\\(\\) has parameter \\$languageFilter with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Repository/SiteAccessAware/SearchService.php - - - - message: "#^Method Ibexa\\\\Core\\\\Repository\\\\SiteAccessAware\\\\SearchService\\:\\:findLocations\\(\\) has parameter \\$languageFilter with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Repository/SiteAccessAware/SearchService.php - - - - message: "#^Method Ibexa\\\\Core\\\\Repository\\\\SiteAccessAware\\\\SearchService\\:\\:findSingle\\(\\) has parameter \\$languageFilter with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Repository/SiteAccessAware/SearchService.php - - message: "#^Method Ibexa\\\\Core\\\\Repository\\\\SiteAccessAware\\\\SearchService\\:\\:suggest\\(\\) has no return type specified\\.$#" count: 1 @@ -21115,16 +21100,6 @@ parameters: count: 1 path: src/lib/Repository/Values/Content/Content.php - - - message: "#^Method Ibexa\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Content\\:\\:getProperties\\(\\) has parameter \\$dynamicProperties with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Repository/Values/Content/Content.php - - - - message: "#^Method Ibexa\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Content\\:\\:getProperties\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Repository/Values/Content/Content.php - - message: "#^Property Ibexa\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Content\\:\\:\\$fieldDefinitionTranslationMap has unknown class eZ\\\\Publish\\\\API\\\\Repository\\\\Values\\\\Content\\\\Field as its type\\.$#" count: 1 From 7dcfc0e1fd6618e9c68da461a6f7916244a2c479 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 17:08:13 +0100 Subject: [PATCH 42/92] phpstan-baseline-gte-8.0.neon: Update not matched --- phpstan-baseline-gte-8.0.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan-baseline-gte-8.0.neon b/phpstan-baseline-gte-8.0.neon index e65db45872..a45e790ff5 100644 --- a/phpstan-baseline-gte-8.0.neon +++ b/phpstan-baseline-gte-8.0.neon @@ -316,7 +316,7 @@ parameters: path: tests/integration/Core/Repository/ContentServiceTest.php - - message: "#^Parameter \\#1 \\$array of function array_values expects array\\, iterable\\ given\\.$#" + message: "#^Parameter \\#1 \\$array of function array_values expects array\\, iterable given\\.$#" count: 1 path: tests/integration/Core/Repository/ContentServiceTest.php From 6678e461d3dddd9e86c607675293319da5c6a785 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 17:25:32 +0100 Subject: [PATCH 43/92] phpstan-baseline.neon: Remove or update not matched --- phpstan-baseline-gte-8.0.neon | 2 +- phpstan-baseline.neon | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/phpstan-baseline-gte-8.0.neon b/phpstan-baseline-gte-8.0.neon index a45e790ff5..76666a9184 100644 --- a/phpstan-baseline-gte-8.0.neon +++ b/phpstan-baseline-gte-8.0.neon @@ -366,7 +366,7 @@ parameters: path: tests/integration/Core/Repository/LocationServiceTest.php - - message: "#^Parameter \\#1 \\$array of function array_keys expects array, iterable\\ given\\.$#" + message: "#^Parameter \\#1 \\$array of function array_keys expects array, iterable given\\.$#" count: 3 path: tests/integration/Core/Repository/LocationServiceTest.php diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 497335880b..dd4efe35a9 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -34016,12 +34016,12 @@ parameters: path: tests/integration/Core/Repository/LocationServiceTest.php - - message: "#^Cannot access offset 1 on iterable\\\\.$#" + message: "#^Cannot access offset 1 on iterable\\.$#" count: 1 path: tests/integration/Core/Repository/LocationServiceTest.php - - message: "#^Cannot access offset 5 on iterable\\\\.$#" + message: "#^Cannot access offset 5 on iterable\\.$#" count: 2 path: tests/integration/Core/Repository/LocationServiceTest.php @@ -34416,7 +34416,7 @@ parameters: path: tests/integration/Core/Repository/LocationServiceTest.php - - message: "#^Parameter \\#1 \\$array of function array_column expects array, iterable\\ given\\.$#" + message: "#^Parameter \\#1 \\$array of function array_column expects array, iterable given\\.$#" count: 1 path: tests/integration/Core/Repository/LocationServiceTest.php @@ -57166,7 +57166,7 @@ parameters: path: tests/lib/Repository/Mapper/ContentLocationMapper/DecoratedLocationServiceTest.php - - message: "#^Cannot access property \\$locations on iterable\\\\.$#" + message: "#^Cannot access property \\$locations on iterable\\.$#" count: 2 path: tests/lib/Repository/Mapper/ContentLocationMapper/DecoratedLocationServiceTest.php From 3e34297e7f2e9b03d875b82b727b37786d6105ad Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 18:14:04 +0100 Subject: [PATCH 44/92] LocationService.php: type iterable's values "return type has no value type specified in iterable type iterable" --- src/contracts/Repository/LocationService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Repository/LocationService.php b/src/contracts/Repository/LocationService.php index 5181d398d7..a86c990d5b 100644 --- a/src/contracts/Repository/LocationService.php +++ b/src/contracts/Repository/LocationService.php @@ -60,7 +60,7 @@ public function loadLocation(int $locationId, ?array $prioritizedLanguages = nul * @param array|null $prioritizedLanguages Filter on and use as prioritized language code on translated properties of returned objects. * @param bool|null $useAlwaysAvailable Respect always available flag on content when filtering on $prioritizedLanguages. * - * @return array|iterable + * @return array|iterable<\Ibexa\Contracts\Core\Repository\Values\Content\Location> */ public function loadLocationList(array $locationIds, ?array $prioritizedLanguages = null, ?bool $useAlwaysAvailable = null): iterable; From dae892b16dc353129921dafcefa015e474cfd83a Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 18:26:10 +0100 Subject: [PATCH 45/92] phpstan-baseline.neonp: type iterable's values --- phpstan-baseline-gte-8.0.neon | 4 ++-- phpstan-baseline.neon | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/phpstan-baseline-gte-8.0.neon b/phpstan-baseline-gte-8.0.neon index 76666a9184..e65db45872 100644 --- a/phpstan-baseline-gte-8.0.neon +++ b/phpstan-baseline-gte-8.0.neon @@ -316,7 +316,7 @@ parameters: path: tests/integration/Core/Repository/ContentServiceTest.php - - message: "#^Parameter \\#1 \\$array of function array_values expects array\\, iterable given\\.$#" + message: "#^Parameter \\#1 \\$array of function array_values expects array\\, iterable\\ given\\.$#" count: 1 path: tests/integration/Core/Repository/ContentServiceTest.php @@ -366,7 +366,7 @@ parameters: path: tests/integration/Core/Repository/LocationServiceTest.php - - message: "#^Parameter \\#1 \\$array of function array_keys expects array, iterable given\\.$#" + message: "#^Parameter \\#1 \\$array of function array_keys expects array, iterable\\ given\\.$#" count: 3 path: tests/integration/Core/Repository/LocationServiceTest.php diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index dd4efe35a9..7480ad6bd6 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -241,7 +241,7 @@ parameters: path: src/bundle/Core/Command/RegenerateUrlAliasesCommand.php - - message: "#^Method Ibexa\\\\Bundle\\\\Core\\\\Command\\\\RegenerateUrlAliasesCommand\\:\\:loadSpecificLocations\\(\\) should return array\\ but returns iterable.$#" + message: "#^Method Ibexa\\\\Bundle\\\\Core\\\\Command\\\\RegenerateUrlAliasesCommand\\:\\:loadSpecificLocations\\(\\) should return array\\ but returns iterable\\\\.$#" count: 1 path: src/bundle/Core/Command/RegenerateUrlAliasesCommand.php @@ -251,7 +251,7 @@ parameters: path: src/bundle/Core/Command/RegenerateUrlAliasesCommand.php - - message: "#^Parameter \\#2 \\$array of function array_map expects array, iterable given\\.$#" + message: "#^Parameter \\#2 \\$array of function array_map expects array, iterable\\ given\\.$#" count: 1 path: src/bundle/Core/Command/RegenerateUrlAliasesCommand.php @@ -34016,12 +34016,12 @@ parameters: path: tests/integration/Core/Repository/LocationServiceTest.php - - message: "#^Cannot access offset 1 on iterable\\.$#" + message: "#^Cannot access offset 1 on iterable\\\\.$#" count: 1 path: tests/integration/Core/Repository/LocationServiceTest.php - - message: "#^Cannot access offset 5 on iterable\\.$#" + message: "#^Cannot access offset 5 on iterable\\\\.$#" count: 2 path: tests/integration/Core/Repository/LocationServiceTest.php @@ -34416,7 +34416,7 @@ parameters: path: tests/integration/Core/Repository/LocationServiceTest.php - - message: "#^Parameter \\#1 \\$array of function array_column expects array, iterable given\\.$#" + message: "#^Parameter \\#1 \\$array of function array_column expects array, iterable\\ given\\.$#" count: 1 path: tests/integration/Core/Repository/LocationServiceTest.php @@ -57166,7 +57166,7 @@ parameters: path: tests/lib/Repository/Mapper/ContentLocationMapper/DecoratedLocationServiceTest.php - - message: "#^Cannot access property \\$locations on iterable\\.$#" + message: "#^Cannot access property \\$locations on iterable\\\\.$#" count: 2 path: tests/lib/Repository/Mapper/ContentLocationMapper/DecoratedLocationServiceTest.php From 0cb55b83716a1451bd2cd45ef4e3cf1051a8429d Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 18:39:44 +0100 Subject: [PATCH 46/92] SearchService.php: Fix $languageFilter usage --- src/contracts/Repository/SearchService.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/contracts/Repository/SearchService.php b/src/contracts/Repository/SearchService.php index 852ebd3149..b42d323700 100644 --- a/src/contracts/Repository/SearchService.php +++ b/src/contracts/Repository/SearchService.php @@ -137,7 +137,7 @@ interface SearchService * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query $query - * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. * Also used to define which field languages are loaded for the returned content. * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. @@ -159,7 +159,7 @@ public function findContent(Query $query, array $languageFilter = [], bool $filt * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query $query - * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. @@ -176,7 +176,7 @@ public function findContentInfo(Query $query, array $languageFilter = [], bool $ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if there is more than than one result matching the criterions * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion $filter - * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. @@ -201,7 +201,7 @@ public function suggest(string $prefix, array $fieldPaths = [], int $limit = 10, * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery $query - * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. * Also used to define which field languages are loaded for the returned content. * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. From 4aaeeea1b81f458f8cb5f8a30fa92648d187b001 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 4 Feb 2025 12:02:18 +0100 Subject: [PATCH 47/92] SearchService.php: Enh. $languageFilter usage's doc --- src/contracts/Repository/SearchService.php | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/contracts/Repository/SearchService.php b/src/contracts/Repository/SearchService.php index b42d323700..faa1cfc0bc 100644 --- a/src/contracts/Repository/SearchService.php +++ b/src/contracts/Repository/SearchService.php @@ -137,10 +137,11 @@ interface SearchService * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query $query - * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. * Also used to define which field languages are loaded for the returned content. - * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. - * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * Currently, supports two syntaxes: + * - `['languages' => [,…], 'useAlwaysAvailable' => ]` + * - `[,…]` where `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult @@ -159,9 +160,10 @@ public function findContent(Query $query, array $languageFilter = [], bool $filt * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query $query - * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. - * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. - * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * Currently, supports two syntaxes: + * - `['languages' => [,…], 'useAlwaysAvailable' => ]` + * - `[,…]` where `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult @@ -176,9 +178,10 @@ public function findContentInfo(Query $query, array $languageFilter = [], bool $ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if there is more than than one result matching the criterions * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion $filter - * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. - * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. - * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * Currently, supports two syntaxes: + * - `['languages' => [,…], 'useAlwaysAvailable' => ]` + * - `[,…]` where `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content @@ -201,10 +204,11 @@ public function suggest(string $prefix, array $fieldPaths = [], int $limit = 10, * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery $query - * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. * Also used to define which field languages are loaded for the returned content. - * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. - * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * Currently, supports two syntaxeses: + * - `['languages' => [,…], 'useAlwaysAvailable' => ]` + * - `[,…]` where `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult From 4349876f2c2fb81d3f55d57093cbd31b2c300965 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 4 Feb 2025 16:38:06 +0100 Subject: [PATCH 48/92] Fix SearchServiceTest::testUserMetadataGroupHorizontalFilterContent --- phpstan-baseline.neon | 5 ----- tests/integration/Core/Repository/SearchServiceTest.php | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 7480ad6bd6..cc61420b5a 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -37730,11 +37730,6 @@ parameters: count: 1 path: tests/integration/Core/Repository/SearchServiceTest.php - - - message: "#^Method Ibexa\\\\Tests\\\\Integration\\\\Core\\\\Repository\\\\SearchServiceTest\\:\\:testUserMetadataGroupHorizontalFilterContent\\(\\) has parameter \\$queryType with no type specified\\.$#" - count: 1 - path: tests/integration/Core/Repository/SearchServiceTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Integration\\\\Core\\\\Repository\\\\SearchServiceTest\\:\\:testUserMetadataGroupHorizontalFilterLocation\\(\\) has no return type specified\\.$#" count: 1 diff --git a/tests/integration/Core/Repository/SearchServiceTest.php b/tests/integration/Core/Repository/SearchServiceTest.php index 87f59cc671..cc891e654a 100644 --- a/tests/integration/Core/Repository/SearchServiceTest.php +++ b/tests/integration/Core/Repository/SearchServiceTest.php @@ -4049,7 +4049,7 @@ protected function createContentForTestUserMetadataGroupHorizontal() * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findContent() */ - public function testUserMetadataGroupHorizontalFilterContent($queryType = null) + public function testUserMetadataGroupHorizontalFilterContent(string $queryType = null) { if ($queryType === null) { $queryType = 'filter'; From e294a23c18521901780d05c68d69eed550bb52f0 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 4 Feb 2025 16:40:20 +0100 Subject: [PATCH 49/92] Fix SearchServiceTest::testUserMetadataGroupHorizontalFilterContent --- tests/integration/Core/Repository/SearchServiceTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration/Core/Repository/SearchServiceTest.php b/tests/integration/Core/Repository/SearchServiceTest.php index cc891e654a..2eca48f944 100644 --- a/tests/integration/Core/Repository/SearchServiceTest.php +++ b/tests/integration/Core/Repository/SearchServiceTest.php @@ -4166,6 +4166,7 @@ public function testUserMetadataGroupHorizontalFilterLocation($queryType = null) $editorsUserGroupId ); + /** @var string $queryType */ $query = new LocationQuery( [ $queryType => new Criterion\LogicalAnd($criteria), From 5b5f9fa48c1f8d168e455bd1afe6562652a4e1ad Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:39:24 +0100 Subject: [PATCH 50/92] Enhance `DateMetadata::TRASHED` phpdoc --- .../Values/Content/Query/Criterion/DateMetadata.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php b/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php index 78d5397468..f4dc7e449b 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php @@ -24,13 +24,13 @@ * BETWEEN: matches content whose date is between (included) the TWO given timestamps * * Example: - * + * ``` * $createdCriterion = new Criterion\DateMetadata( * Criterion\DateMetadata::CREATED, * Operator::GTE, - * strtotime( 'yesterday' ) + * strtotime('yesterday') * ); - * + * ``` */ class DateMetadata extends Criterion implements TrashCriterion, FilteringCriterion { @@ -41,7 +41,7 @@ class DateMetadata extends Criterion implements TrashCriterion, FilteringCriteri public const PUBLISHED = 'published'; /** - * (applies to TrashService::findTrashItems only). + * Applies to {@see \Ibexa\Contracts\Core\Repository\TrashService::findTrashItems() only. */ public const TRASHED = 'trashed'; From 08737f05e0603d293574e84849734b555a695926 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 10 Dec 2024 19:35:09 +0100 Subject: [PATCH 51/92] Enhance `Criterion::getSpecifications()` phpdoc --- .../Repository/Values/Content/Query/Criterion.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion.php b/src/contracts/Repository/Values/Content/Query/Criterion.php index 7e80664698..e05ef03558 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion.php @@ -118,12 +118,12 @@ public function __construct(?string $target, ?string $operator, $value, ?Value $ * * Returns the combination of the Criterion's supported operator/value, * as an array of {@see \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator\Specifications} objects - * - Operator is one supported Operator, as an Operator::* constant - * - ValueType is the type of input value this operator requires, either array or single - * - SupportedTypes is an array of types the operator will accept - * - ValueCountLimitation is an integer saying how many values are expected. + * - `$operator` is a supported {@see Operator} constant. + * - `$valueFormat is the type of input value this operator requires, either array ({@see Specifications::FORMAT_ARRAY}) or single ({@see Specifications::FORMAT_SINGLE}). + * - `$valueTypes` are bitwise flags of types the operator will accept ({@see Specifications::TYPE_BOOLEAN}, {@see Specifications::TYPE_INTEGER}, and/or {@see Specifications::TYPE_STRING}). + * - `$valueCount` is an integer saying how many values are expected. * - * + * ``` * // IN and EQ are supported * return [ * // The EQ operator expects a single value, either as an integer or a string @@ -139,7 +139,7 @@ public function __construct(?string $target, ?string $operator, $value, ?Value $ * Specifications::TYPE_INTEGER | Specifications::TYPE_STRING * ) * ] - * + * ``` * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator\Specifications[] */ From c98dc4874ea3b8a501c7d219399ad30bd522c9f8 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 10 Dec 2024 19:35:43 +0100 Subject: [PATCH 52/92] Enhance `Specifications` phpdoc --- .../Content/Query/Criterion/Operator/Specifications.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion/Operator/Specifications.php b/src/contracts/Repository/Values/Content/Query/Criterion/Operator/Specifications.php index f22eeb6973..73c61c5d20 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion/Operator/Specifications.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion/Operator/Specifications.php @@ -11,9 +11,7 @@ /** * This class is used by Criteria to describe which operators they support. * - * Instances of this class are returned in an array by the Criterion::getSpecifications() method - * - * @see \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion::getSpecifications() + * Instances of this class are returned in an array by the {@see \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion::getSpecifications()} method. */ class Specifications { From 10535894bde35825eb0db8ec15d14395206fc4c6 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 11 Dec 2024 13:00:52 +0100 Subject: [PATCH 53/92] Capable.php: Fix phpdoc summary Don't use advanced format in summary, it won't be rendered. --- src/contracts/Search/Capable.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/contracts/Search/Capable.php b/src/contracts/Search/Capable.php index a6504d9595..11cb1cfb1d 100644 --- a/src/contracts/Search/Capable.php +++ b/src/contracts/Search/Capable.php @@ -9,6 +9,8 @@ namespace Ibexa\Contracts\Core\Search; /** + * Capability interface for search engines. + * * Capability interface for search engines needed for {@see \Ibexa\Contracts\Core\Repository\SearchService::supports()}. * * @since 6.12 And ported to 6.7.6 for search engine forward compatibility. From d784a17b691d99639faf45c115fcb1b463aee62b Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:59:46 +0100 Subject: [PATCH 54/92] VersionBuilder.php: Fix phpdoc summary, arrays and self usages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't use advanced format in summary, it won't be rendered. Define array key type, or it will be rendered as array phpDocumentor don't seem to understand self. --- .../Target/Builder/VersionBuilder.php | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/contracts/Limitation/Target/Builder/VersionBuilder.php b/src/contracts/Limitation/Target/Builder/VersionBuilder.php index baff618ec0..c4738544c0 100644 --- a/src/contracts/Limitation/Target/Builder/VersionBuilder.php +++ b/src/contracts/Limitation/Target/Builder/VersionBuilder.php @@ -14,6 +14,8 @@ use Ibexa\Core\Base\Exceptions\InvalidArgumentException; /** + * Version builder. + * * Builder of {@see \Ibexa\Contracts\Core\Limitation\Target\Version} instance. */ final class VersionBuilder @@ -28,6 +30,8 @@ public function build(): Target\Version /** * @param \Ibexa\Contracts\Core\Repository\Values\Content\Field[] $updatedFields + * + * @return VersionBuilder */ public function updateFields(array $updatedFields): self { @@ -41,7 +45,7 @@ public function updateFields(array $updatedFields): self * * @param array $languageCodes * - * @return self + * @return VersionBuilder * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException */ @@ -61,9 +65,9 @@ public function translateToAnyLanguageOf(array $languageCodes): self /** * Set intent to create Content from unspecified (yet) content type, any from the given list. * - * @param int[] $contentTypeIds + * @param array $contentTypeIds * - * @return self + * @return VersionBuilder * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException */ @@ -83,13 +87,13 @@ public function createFromAnyContentTypeOf(array $contentTypeIds): self /** * Set intent to change Version status. * - * Supported: VersionInfo::STATUS_DRAFT, VersionInfo::STATUS_PUBLISHED, VersionInfo::STATUS_ARCHIVED + * Supported: {@see \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo::STATUS_DRAFT}, {@see \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo::STATUS_PUBLISHED}, {@see \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo::STATUS_ARCHIVED} * * @see \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo * * @param int $status * - * @return self + * @return VersionBuilder * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException */ @@ -114,9 +118,9 @@ public function changeStatusTo(int $status): self * Set intent to update Content Version Fields. * * @param string|null $initialLanguageCode - * @param \Ibexa\Contracts\Core\Repository\Values\Content\Field[] $fields + * @param array $fields * - * @return self + * @return VersionBuilder */ public function updateFieldsTo(?string $initialLanguageCode, array $fields): self { @@ -138,9 +142,9 @@ static function (Field $field) { /** * Set intent to publish, to specified translations, all from the given list. * - * @param string[] $languageCodes + * @param array $languageCodes * - * @return self + * @return VersionBuilder * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException */ From c11bef7258d52863e99f0e52b68137af185affc9 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:20:26 +0100 Subject: [PATCH 55/92] ConstraintViolationAdapter's PHPDoc: Add a summary, reword description --- .../Generic/ValidationError/ConstraintViolationAdapter.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php b/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php index a7f63aa101..0d39e8ccf1 100644 --- a/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php +++ b/src/contracts/FieldType/Generic/ValidationError/ConstraintViolationAdapter.php @@ -14,8 +14,10 @@ use Symfony\Component\Validator\ConstraintViolationInterface; /** - * {@see \Symfony\Component\Validator\ConstraintViolationInterface} to - * {@see \Ibexa\Contracts\Core\FieldType\ValidationError} adapter. + * Constraint violation validation error. + * + * Adapts {@see \Symfony\Component\Validator\ConstraintViolationInterface} to + * {@see \Ibexa\Contracts\Core\FieldType\ValidationError}. */ final class ConstraintViolationAdapter implements ValidationErrorInterface { From 571289477a92ee9130c3e49156deed67f3b86f50 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:13:32 +0100 Subject: [PATCH 56/92] Enhance `Criterion::getSpecifications()` phpdoc --- .../Repository/Values/Content/Query/Criterion.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion.php b/src/contracts/Repository/Values/Content/Query/Criterion.php index e05ef03558..64e5faf370 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion.php @@ -118,10 +118,10 @@ public function __construct(?string $target, ?string $operator, $value, ?Value $ * * Returns the combination of the Criterion's supported operator/value, * as an array of {@see \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator\Specifications} objects - * - `$operator` is a supported {@see Operator} constant. - * - `$valueFormat is the type of input value this operator requires, either array ({@see Specifications::FORMAT_ARRAY}) or single ({@see Specifications::FORMAT_SINGLE}). - * - `$valueTypes` are bitwise flags of types the operator will accept ({@see Specifications::TYPE_BOOLEAN}, {@see Specifications::TYPE_INTEGER}, and/or {@see Specifications::TYPE_STRING}). - * - `$valueCount` is an integer saying how many values are expected. + * - {@see Specifications::$operator} is a supported {@see Operator} constant. + * - {@see Specifications::$valueFormat} is the type of input value this operator requires, either array ({@see Specifications::FORMAT_ARRAY}) or single ({@see Specifications::FORMAT_SINGLE}). + * - {@see Specifications::$valueTypes} are bitwise flags of types the operator will accept ({@see Specifications::TYPE_BOOLEAN}, {@see Specifications::TYPE_INTEGER}, and/or {@see Specifications::TYPE_STRING}). + * - {@see Specifications::$valueCount} is an integer saying how many values are expected. * * ``` * // IN and EQ are supported From 70aeff1204388e73b205520cc92573b0767a063c Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:19:06 +0100 Subject: [PATCH 57/92] Enhance `DateMetadata::TRASHED` phpdoc --- .../Repository/Values/Content/Query/Criterion/DateMetadata.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php b/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php index f4dc7e449b..b18296252a 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php @@ -41,6 +41,8 @@ class DateMetadata extends Criterion implements TrashCriterion, FilteringCriteri public const PUBLISHED = 'published'; /** + * To search for contents based on when they have been sent to trash. + * * Applies to {@see \Ibexa\Contracts\Core\Repository\TrashService::findTrashItems() only. */ public const TRASHED = 'trashed'; From 3be524106311753669b61c75a1109d1b85183484 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:13:13 +0100 Subject: [PATCH 58/92] Enhance `DateMetadata` phpdoc --- .../Content/Query/Criterion/DateMetadata.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php b/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php index b18296252a..bde44bb36c 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php @@ -18,16 +18,16 @@ * A criterion that matches content based on one of the date metadata (created or modified). * * Supported Operators: - * EQ, IN: matches content whose date is or belongs to a list of timestamps - * GT, GTE: matches content whose date is greater than/greater than or equals the given timestamp - * LT, LTE: matches content whose date is lower than/lower than or equals the given timestamp - * BETWEEN: matches content whose date is between (included) the TWO given timestamps + * - {@see Operator::EQ EQ}, {@see Operator::IN IN}: matches content whose date is or belongs to a list of timestamps. + * - {@see Operator::GT GT}, {@see Operator::GTE GTE}: matches content whose date is greater than/greater than or equals the given timestamp. + * - {@see Operator::LT LT}, {@see Operator::LTE LTE}: matches content whose date is lower than/lower than or equals the given timestamp. + * - {@see Operator::BETWEEN BETWEEN}: matches content whose date is between TWO (included) given timestamps. * - * Example: + * The following example is a criterion for contents created yesterday or today: * ``` * $createdCriterion = new Criterion\DateMetadata( * Criterion\DateMetadata::CREATED, - * Operator::GTE, + * Criterion\Operator::GTE, * strtotime('yesterday') * ); * ``` @@ -43,7 +43,7 @@ class DateMetadata extends Criterion implements TrashCriterion, FilteringCriteri /** * To search for contents based on when they have been sent to trash. * - * Applies to {@see \Ibexa\Contracts\Core\Repository\TrashService::findTrashItems() only. + * Applies to {@see \Ibexa\Contracts\Core\Repository\TrashService::findTrashItems()} only. */ public const TRASHED = 'trashed'; @@ -59,8 +59,8 @@ class DateMetadata extends Criterion implements TrashCriterion, FilteringCriteri * * @throws \InvalidArgumentException If target is unknown * - * @param string $target One of DateMetadata::CREATED, DateMetadata::MODIFIED or DateMetadata::TRASHED (applies to TrashService::findTrashItems only) - * @param string $operator One of the Operator constants + * @param string $target One of {@see DateMetadata::CREATED}, {@see DateMetadata::MODIFIED}, or {@see DateMetadata::TRASHED} (applies to {@see \Ibexa\Contracts\Core\Repository\TrashService::findTrashItems()} only) + * @param string $operator One of the {@see Operator} constants * @param mixed $value The match value, either as an array of as a single value, depending on the operator */ public function __construct(string $target, string $operator, $value) From a5d0f32a5fba941805bc0e065207246e2ddb5ed6 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:31:12 +0100 Subject: [PATCH 59/92] Enhance `UserMetadata` phpdoc --- .../Content/Query/Criterion/UserMetadata.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php b/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php index 13f4775307..44d80610a0 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php @@ -19,16 +19,16 @@ * group, modifier). * * Supported Operators: - * EQ, IN: Matches the provided user ID(s) against the user IDs in the database + * - {@see Operator::EQ EQ}, {@see Operator::IN}: Matches the provided user ID(s) against the user IDs in the database. * - * Example: - * + * The following example is a criterion for contents owned by a user with ID 10 or 14: + * ``` * $createdCriterion = new Criterion\UserMetadata( * Criterion\UserMetadata::OWNER, - * Operator::IN, - * array( 10, 14 ) + * Criterion\Operator::IN, + * [10, 14] * ); - * + * ``` */ class UserMetadata extends Criterion implements TrashCriterion, FilteringCriterion { @@ -48,13 +48,13 @@ class UserMetadata extends Criterion implements TrashCriterion, FilteringCriteri public const MODIFIER = 'modifier'; /** - * Creates a new UserMetadata criterion on $metadata. + * Creates a new UserMetadata criterion. * * @throws \InvalidArgumentException If target is unknown * - * @param string $target One of UserMetadata::OWNER, UserMetadata::GROUP or UserMetadata::MODIFIED - * @param string|null $operator The operator the Criterion uses. If null is given, will default to Operator::IN if $value is an array, Operator::EQ if it is not. - * @param mixed $value The match value, either as an array of as a single value, depending on the operator + * @param string $target One of {@see UserMetadata::OWNER}, {@see UserMetadata::GROUP}, or {@see UserMetadata::MODIFIED}. + * @param string|null $operator The operator the Criterion uses. If null is given, will default to {@see Operator::IN} if $value is an array, {@see Operator::EQ} if it isn't. + * @param mixed $value The match value, either as an array of as a single value, depending on the operator. */ public function __construct(string $target, ?string $operator, $value) { From c1be1e8a5dae49ca6f7b91c0c3c9d2533819a57b Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:31:19 +0100 Subject: [PATCH 60/92] Enhance `DateMetadata` phpdoc --- .../Repository/Values/Content/Query/Criterion/DateMetadata.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php b/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php index bde44bb36c..bbfe5f0643 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion/DateMetadata.php @@ -55,7 +55,7 @@ class DateMetadata extends Criterion implements TrashCriterion, FilteringCriteri ]; /** - * Creates a new DateMetadata criterion on $metadata. + * Creates a new DateMetadata criterion. * * @throws \InvalidArgumentException If target is unknown * From 3676bffe3a9ef23b9126a6274b94e7f6bbef66a6 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:31:43 +0100 Subject: [PATCH 61/92] Enhance `Capable` phpdoc --- src/contracts/Search/Capable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Search/Capable.php b/src/contracts/Search/Capable.php index 11cb1cfb1d..0451ffda08 100644 --- a/src/contracts/Search/Capable.php +++ b/src/contracts/Search/Capable.php @@ -20,7 +20,7 @@ interface Capable /** * Query for supported capability of currently configured search engine. * - * @param int $capabilityFlag One of \Ibexa\Contracts\Core\Repository\SearchService::CAPABILITY_* constants. + * @param int $capabilityFlag One of {@see \Ibexa\Contracts\Core\Repository\SearchService}::CAPABILITY_* constants. * * @return bool */ From 9018dcc3e516d7add8c80c106e0431f905fe8f37 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:50:08 +0100 Subject: [PATCH 62/92] Enhance `Criterion` phpdoc --- .../Repository/Values/Content/Query/Criterion.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion.php b/src/contracts/Repository/Values/Content/Query/Criterion.php index 64e5faf370..16e1267357 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion.php @@ -44,13 +44,15 @@ abstract class Criterion implements CriterionInterface public $valueData; /** - * Performs operator validation based on the Criterion specifications returned by {@see getSpecifications()}. + * Creates a Criterion. + * + * Performs operator validation based on the Criterion specifications returned by {@see Criterion::getSpecifications()}. * * @param string|null $target The target the Criterion applies to: metadata identifier, field identifier... * @param string|null $operator - * The operator the Criterion uses. If null is given, will default to Operator::IN if $value is an array, - * Operator::EQ if it is not. - * @param scalar[]|scalar $value + * The operator the Criterion uses. If null is given, will default to {@see Operator::IN} if $value is an array, + * {@see Operator::EQ} if it isn't. + * @param array|scalar $value * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Value|null $valueData * * @todo Add a dedicated exception @@ -141,14 +143,14 @@ public function __construct(?string $target, ?string $operator, $value, ?Value $ * ] * ``` * - * @return \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator\Specifications[] + * @return array */ abstract public function getSpecifications(): array; /** * Returns a callback that checks the values types depending on the operator specifications. * - * @param int $valueTypes The accepted values, as a bit field of Specifications::TYPE_* constants + * @param int $valueTypes The accepted values, as a bit field of {@see Specifications}::TYPE_* constants * * @return callable */ From 2054817294b17ef507032fdff9d0e117f5b44304 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:09:17 +0100 Subject: [PATCH 63/92] Enhance `UserMetadata` phpdoc (fix typo) --- .../Repository/Values/Content/Query/Criterion/UserMetadata.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php b/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php index 44d80610a0..1b4f924508 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php @@ -52,7 +52,7 @@ class UserMetadata extends Criterion implements TrashCriterion, FilteringCriteri * * @throws \InvalidArgumentException If target is unknown * - * @param string $target One of {@see UserMetadata::OWNER}, {@see UserMetadata::GROUP}, or {@see UserMetadata::MODIFIED}. + * @param string $target One of {@see UserMetadata::OWNER}, {@see UserMetadata::GROUP}, or {@see UserMetadata::MODIFIER}. * @param string|null $operator The operator the Criterion uses. If null is given, will default to {@see Operator::IN} if $value is an array, {@see Operator::EQ} if it isn't. * @param mixed $value The match value, either as an array of as a single value, depending on the operator. */ From f6c4fc4b5daf9a6d9458b3b5a48442b58f24b8be Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:50:43 +0100 Subject: [PATCH 64/92] Enhance `UserMetadata` phpdoc --- .../Repository/Values/Content/Query/Criterion/UserMetadata.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php b/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php index 1b4f924508..85f53a6f24 100644 --- a/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php +++ b/src/contracts/Repository/Values/Content/Query/Criterion/UserMetadata.php @@ -19,7 +19,7 @@ * group, modifier). * * Supported Operators: - * - {@see Operator::EQ EQ}, {@see Operator::IN}: Matches the provided user ID(s) against the user IDs in the database. + * - {@see Operator::EQ EQ}, {@see Operator::IN IN}: Matches the provided user ID(s) against the user IDs in the database. * * The following example is a criterion for contents owned by a user with ID 10 or 14: * ``` From 12ed22c84d769cbc6053ab550c966c3806f5df6d Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 13 Dec 2024 12:35:11 +0100 Subject: [PATCH 65/92] Enhance `FieldType\Generic\Type` phpdoc --- src/contracts/FieldType/Generic/Type.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/contracts/FieldType/Generic/Type.php b/src/contracts/FieldType/Generic/Type.php index aa0028cd67..55c61b8ab1 100644 --- a/src/contracts/FieldType/Generic/Type.php +++ b/src/contracts/FieldType/Generic/Type.php @@ -263,17 +263,17 @@ final public function acceptValue($inputValue): Value * This is an operation method for {@see acceptValue()}. * * Example implementation: - * + * ``` * protected function createValueFromInput( $inputValue ) * { - * if ( is_array( $inputValue ) ) + * if (is_array($inputValue)) * { * $inputValue = \My\FieldType\CookieJar\Value( $inputValue ); * } * * return $inputValue; * } - * + * ``` * * @param mixed $inputValue * @@ -310,15 +310,15 @@ protected function getValueClass(): string * FieldType class and is named "Value". * * Example implementation: - * + * ``` * protected function checkValueType($value): void * { - * if ( !$inputValue instanceof \My\FieldType\CookieJar\Value ) ) + * if (!$inputValue instanceof \My\FieldType\CookieJar\Value)) * { - * throw new InvalidArgumentException( "Given value type is not supported." ); + * throw new InvalidArgumentException("Given value type isn't supported."); * } * } - * + * ``` * * @param mixed $value A value returned by {@see createValueFromInput()}. * From a59306dbd652f726835b224e4d697afb182c6018 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:21:52 +0100 Subject: [PATCH 66/92] Enhance `Limitation\Type` phpdoc One docblock per constant. --- src/contracts/Limitation/Type.php | 50 +++++++++++++++---- src/lib/Limitation/LocationLimitationType.php | 5 +- src/lib/Limitation/SubtreeLimitationType.php | 5 +- 3 files changed, 45 insertions(+), 15 deletions(-) diff --git a/src/contracts/Limitation/Type.php b/src/contracts/Limitation/Type.php index b93aa4a5c4..cb5410d705 100644 --- a/src/contracts/Limitation/Type.php +++ b/src/contracts/Limitation/Type.php @@ -21,26 +21,57 @@ interface Type { /** - * Constants for return value of {@see evaluate()}. + * Access is granted. * - * Currently ACCESS_ABSTAIN must mean that evaluate does not support the provided $object or $targets, - * this is currently only supported by role limitations as policy limitations should not allow this. + * Constant for return value of {@see Type::evaluate()}. * * Note: In future version constant values might change to 1, 0 and -1 as used in Symfony. * * @since 5.3.2 */ public const ACCESS_GRANTED = true; + + /** + * The type abstains from voting. + * + * Constant for return value of {@see Type::evaluate()}. + * + * Returning ACCESS_ABSTAIN must mean that evaluate does not support the provided $object or $targets, + * this is only supported by role limitations as policy limitations should not allow this. + * + * Note: In future version constant values might change to 1, 0 and -1 as used in Symfony. + * + * @since 5.3.2 + */ public const ACCESS_ABSTAIN = null; + + /** + * Access is denied. + * + * Constant for return value of {@see Type::evaluate()}. + * + * Note: In future version constant values might change to 1, 0 and -1 as used in Symfony. + * + * @since 5.3.2 + */ public const ACCESS_DENIED = false; /** - * Constants for valueSchema() return values. + * Limitation's value must be an array of location IDs. + * + * Constant for {@see Type::valueSchema()} return values. * - * Used in cases where a certain value is accepted but the options are to many to return as a hash of options. * GUI should typically present option to browse content tree to select limitation value(s). */ public const VALUE_SCHEMA_LOCATION_ID = 1; + + /** + * Limitation's value must be an array of location paths. + * + * Constant for {@see Type::valueSchema()} return values. + * + * GUI should typically present option to browse content tree to select limitation value(s). + */ public const VALUE_SCHEMA_LOCATION_PATH = 2; /** @@ -92,7 +123,7 @@ public function buildValue(array $limitationValues); * @param \Ibexa\Contracts\Core\Repository\Values\ValueObject[]|null $targets An array of location, parent or "assignment" * objects, if null: none where provided by caller * - * @return bool|null Returns one of ACCESS_* constants + * @return bool|null Returns one of ACCESS_* constants, {@see Type::ACCESS_GRANTED}, {@see Type::ACCESS_ABSTAIN}, or {@see Type::ACCESS_DENIED}. */ public function evaluate(APILimitationValue $value, APIUserReference $currentUser, APIValueObject $object, array $targets = null); @@ -112,9 +143,10 @@ public function getCriterion(APILimitationValue $value, APIUserReference $curren /** * Returns info on valid $limitationValues. * - * @return mixed[]|int In case of array, a hash with key as valid limitations value and value as human readable name - * of that option, in case of int on of VALUE_SCHEMA_* constants. - * Note: The hash might be an instance of Traversable, and not a native php array. + * @return array|Traversable|int In case of array, a hash with key as valid limitations value and value as human-readable name + * of that option. Note: The hash might be an instance of Traversable instead of a native PHP array. + * In case of int, one of VALUE_SCHEMA_* constants. Used in cases where a certain value is accepted + * but the options are too many to return as a hash of options. */ public function valueSchema(); } diff --git a/src/lib/Limitation/LocationLimitationType.php b/src/lib/Limitation/LocationLimitationType.php index 3c7cd6571f..e0ce4ec2b6 100644 --- a/src/lib/Limitation/LocationLimitationType.php +++ b/src/lib/Limitation/LocationLimitationType.php @@ -224,10 +224,9 @@ public function getCriterion(APILimitationValue $value, APIUserReference $curren } /** - * Returns info on valid $limitationValues. + * Returns an integer code meaning that the value must be an array listing location IDs. * - * @return mixed[]|int In case of array, a hash with key as valid limitations value and value as human readable name - * of that option, in case of int on of VALUE_SCHEMA_ constants. + * @return int {@see LocationLimitationType::VALUE_SCHEMA_LOCATION_ID} */ public function valueSchema() { diff --git a/src/lib/Limitation/SubtreeLimitationType.php b/src/lib/Limitation/SubtreeLimitationType.php index c642ec64e8..3ceb4cee0d 100644 --- a/src/lib/Limitation/SubtreeLimitationType.php +++ b/src/lib/Limitation/SubtreeLimitationType.php @@ -258,10 +258,9 @@ public function getCriterion(APILimitationValue $value, APIUserReference $curren } /** - * Returns info on valid $limitationValues. + * Returns an integer code meaning that the value must be an array listing location paths. * - * @return mixed[]|int In case of array, a hash with key as valid limitations value and value as human readable name - * of that option, in case of int on of VALUE_SCHEMA_ constants. + * @return int {@see SubtreeLimitationType::VALUE_SCHEMA_LOCATION_PATH} */ public function valueSchema() { From 54b3fec48d1ad08c334aefdfcdec83478195e07b Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 16 Dec 2024 10:43:14 +0100 Subject: [PATCH 67/92] LocationService: Fix count() phpdoc --- src/contracts/Repository/LocationService.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/contracts/Repository/LocationService.php b/src/contracts/Repository/LocationService.php index 124f7201d3..945323ffdd 100644 --- a/src/contracts/Repository/LocationService.php +++ b/src/contracts/Repository/LocationService.php @@ -267,9 +267,11 @@ public function loadAllLocations(int $offset = 0, int $limit = 25): array; public function find(Filter $filter, ?array $languages = null): LocationList; /** - * Count total number of items returned by {@see find} method. + * Counts total number of items matching the filter. * - * @param string[] $languages a list of language codes to be added as additional constraints. + * Return the count of items that would be returned by {@see LocationService::find()} method. + * + * @param array $languages a list of language codes to be added as additional constraints. * If skipped, by default, unless SiteAccessAware layer has been disabled, languages set * for a SiteAccess in a current context will be used. */ From 04986f53f6bea2ec41e973b658bd4ccc3ad27249 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 16 Dec 2024 10:46:55 +0100 Subject: [PATCH 68/92] Enhance `LocationService` phpdoc --- src/contracts/Repository/LocationService.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/contracts/Repository/LocationService.php b/src/contracts/Repository/LocationService.php index 945323ffdd..5181d398d7 100644 --- a/src/contracts/Repository/LocationService.php +++ b/src/contracts/Repository/LocationService.php @@ -57,10 +57,10 @@ public function loadLocation(int $locationId, ?array $prioritizedLanguages = nul * Returned list of Locations will be filtered by what is found and what current user has access to. * * @param array $locationIds - * @param string[]|null $prioritizedLanguages Filter on and use as prioritized language code on translated properties of returned objects. + * @param array|null $prioritizedLanguages Filter on and use as prioritized language code on translated properties of returned objects. * @param bool|null $useAlwaysAvailable Respect always available flag on content when filtering on $prioritizedLanguages. * - * @return \Ibexa\Contracts\Core\Repository\Values\Content\Location[]|iterable + * @return array|iterable */ public function loadLocationList(array $locationIds, ?array $prioritizedLanguages = null, ?bool $useAlwaysAvailable = null): iterable; @@ -253,14 +253,14 @@ public function getAllLocationsCount(): int; * @param int $limit * @param int $offset * - * @return \Ibexa\Contracts\Core\Repository\Values\Content\Location[] + * @return array */ public function loadAllLocations(int $offset = 0, int $limit = 25): array; /** * Fetch a LocationList from the Repository filtered by the given conditions. * - * @param string[] $languages a list of language codes to be added as additional constraints. + * @param array|null $languages a list of language codes to be added as additional constraints. * If skipped, by default, unless SiteAccessAware layer has been disabled, languages set * for a SiteAccess in a current context will be used. */ @@ -271,7 +271,7 @@ public function find(Filter $filter, ?array $languages = null): LocationList; * * Return the count of items that would be returned by {@see LocationService::find()} method. * - * @param array $languages a list of language codes to be added as additional constraints. + * @param array|null $languages a list of language codes to be added as additional constraints. * If skipped, by default, unless SiteAccessAware layer has been disabled, languages set * for a SiteAccess in a current context will be used. */ From f2642675b3e2296db84671d95ad0730a27934168 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 16 Dec 2024 11:34:27 +0100 Subject: [PATCH 69/92] Enhance `Location` phpdoc --- .../Repository/Values/Content/Location.php | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index 972302e695..7102605e59 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -22,8 +22,8 @@ * @property-read bool $hidden @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::isHidden()} instead. * @property-read bool $invisible @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::isInvisible()} instead. * @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 $remoteId A global unique ID of the content object + * @property-read int $parentLocationId The ID of the parent location * @property-read string $pathString @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getPathString()} instead. * @property-read array $path @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getPath()} instead. * @property-read int $depth @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getDepth()} instead. @@ -89,15 +89,15 @@ abstract class Location extends ValueObject /** * Location ID. * - * @var int Location ID. + * @var int */ protected $id; /** - * the status of the location. + * The status of the location. * - * a location gets the status DRAFT on newly created content which is not published. When content is published the - * location gets the status STATUS_PUBLISHED + * A location gets the status {@see Location::STATUS_DRAFT} on newly created content which is not published. + * When content is published the location gets the status {@see Location::STATUS_PUBLISHED}. * * @var int */ @@ -152,16 +152,19 @@ abstract class Location extends ValueObject protected $parentLocationId; /** - * The materialized path of the location entry, eg: /1/2/. + * The materialized path of the location entry, eg: /1/2/4/23/. * * @var string */ protected $pathString; /** - * Same as {@see Location::$pathString} but as array, e.g.: [ '1', '2', '4', '23' ]. + * The list of ancestor Locations' IDs, ordered in increasing depths, + * starting with '1', and ending with the current Location's ID. * - * @var string[] + * Same as {@see Location::$pathString} but as array, e.g.: `['1', '2', '4', '23']`. + * + * @var array */ protected array $path; @@ -259,7 +262,7 @@ public function getSortClauses(): array /** * The path to the Location represented by the current instance, - * e.g. /1/2/4/23 where 23 is current id. + * e.g. /1/2/4/23/ where 23 is current ID. */ public function getPathString(): string { @@ -267,9 +270,12 @@ public function getPathString(): string } /** - * Same as {@see Location::getPathString()} but as array, e.g.: [ '1', '2', '4', '23' ]. + * The list of ancestor Locations' IDs, ordered in increasing depths, + * starting with 1, and ending with the current Location's ID. + * + * Same as {@see Location::getPathString()} but as array, e.g.: `['1', '2', '4', '23']`. * - * @return string[] + * @return array */ public function getPath(): array { From 8035083d53a1944739cdadea41f0599c6248a984 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 16 Dec 2024 11:35:42 +0100 Subject: [PATCH 70/92] Enhance `Location` phpdoc: @deprecated can't be nested nor used inline. --- src/contracts/Repository/SearchService.php | 86 ++++++++++++------- .../Repository/Values/Content/Location.php | 14 +-- 2 files changed, 63 insertions(+), 37 deletions(-) diff --git a/src/contracts/Repository/SearchService.php b/src/contracts/Repository/SearchService.php index 585c5ae894..852ebd3149 100644 --- a/src/contracts/Repository/SearchService.php +++ b/src/contracts/Repository/SearchService.php @@ -20,7 +20,9 @@ interface SearchService { /** - * Capability flag for scoring feature for use with {@see ::supports()}. + * Capability flag for scoring feature. + * + * To use with {@see SearchService::supports()}. * * Scoring, a search feature telling you how well one search hit scores compared to other items in the search result. * When this is supported you can expect search engine to populate SearchHit->score and SearchResult->maxScore @@ -31,9 +33,11 @@ interface SearchService public const CAPABILITY_SCORING = 1; /** - * Capability flag for facets feature for use with {@see ::supports()}. + * Capability flag for facets feature. + * + * To use with {@see SearchService::supports()}. * - * Faceted search: https://en.wikipedia.org/wiki/Faceted_search + * Faceted search: {@link https://en.wikipedia.org/wiki/Faceted_search} * * Note: Even if search engine tells you this is supported, beware: * - It might not support all facets, by design it will only return facets for facet builders the search engine supports. @@ -45,19 +49,24 @@ interface SearchService public const CAPABILITY_FACETS = 2; /** - * Capability flag for custom fields feature for use with {@see ::supports()}. + * Capability flag for custom fields feature. + * + * To use with {@see SearchService::supports()}. * - * Custom fields is the capability for search engines to 1. allow you to extend the search index via plugins to - * generate custom fields, like a different representation (format, ...) of an existing field or similar. And 2. - * allow you on some search criteria to specify this custom field to rather query on that instead of the default - * field generated by the system. + * Custom fields is the capability for search engines to: + * - Allow you to extend the search index via plugins to + * generate custom fields, like a different representation (format, ...) of an existing field or similar. + * - Allow you on some search criteria to specify this custom field to rather query on that instead of the default + * field generated by the system. * * @since 1.12 eZ Platform 1.12 (ezpublish-kernel 6.12) (constant added in 6.7.6 and up) */ public const CAPABILITY_CUSTOM_FIELDS = 4; /** - * Capability flag for spellcheck feature for use with {@see ::supports()}. + * Capability flag for spellcheck feature. + * + * To use with {@see SearchService::supports()}. * * Spell check within search capabilities refers to ability to suggest better wordings in fulltext search string. * @@ -70,7 +79,9 @@ interface SearchService public const CAPABILITY_SPELLCHECK = 8; /** - * Capability flag for highlight feature for use with {@see ::supports()}. + * Capability flag for highlight feature. + * + * To use with {@see SearchService::supports()}. * * Highlight in search refers to extracting relevant text from the search index that matches the search result, * typically returning a chunk of text of a predefined size with matching text highlighted. @@ -88,7 +99,9 @@ interface SearchService public const CAPABILITY_HIGHLIGHT = 16; /** - * Capability flag for suggest feature for use with {@see ::supports()}. + * Capability flag for suggest feature. + * + * To use with {@see SearchService::supports()}. * * WARNING: This feature is considered experimental given it is not completely clear what it is supposed to do. Feature * might be deprecated in the future. @@ -98,7 +111,9 @@ interface SearchService public const CAPABILITY_SUGGEST = 32; /** - * Capability flag for advanced fulltext feature for use with {@see ::supports()}. + * Capability flag for advanced fulltext feature. + * + * To use with {@see SearchService::supports()}. * * Advance full text is a feature making to possible by current engine to parse advance full text expressions. * @@ -108,7 +123,9 @@ interface SearchService public const CAPABILITY_ADVANCED_FULLTEXT = 64; /** - * Capability flag for aggregation feature for use with {@see ::supports()}. + * Capability flag for aggregation feature. + * + * To use with {@see SearchService::supports()}. * * @since 3.2 eZ Platform 3.2 (ezplatform-kernel 1.2) */ @@ -120,11 +137,11 @@ interface SearchService * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query $query - * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. * Also used to define which field languages are loaded for the returned content. - * Currently supports: array("languages" => array(,..), "useAlwaysAvailable" => bool) - * useAlwaysAvailable defaults to true to avoid exceptions on missing translations - * @param bool $filterOnUserPermissions if true only the objects which the user is allowed to read are returned. + * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. + * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult */ @@ -142,10 +159,10 @@ public function findContent(Query $query, array $languageFilter = [], bool $filt * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query $query - * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. - * Currently supports: array("languages" => array(,..), "useAlwaysAvailable" => bool) - * useAlwaysAvailable defaults to true to avoid exceptions on missing translations - * @param bool $filterOnUserPermissions if true (default) only the objects which is the user allowed to read are returned. + * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. + * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult */ @@ -159,10 +176,10 @@ public function findContentInfo(Query $query, array $languageFilter = [], bool $ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if there is more than than one result matching the criterions * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion $filter - * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. - * Currently supports: array("languages" => array(,..), "useAlwaysAvailable" => bool) - * useAlwaysAvailable defaults to true to avoid exceptions on missing translations - * @param bool $filterOnUserPermissions if true only the objects which is the user allowed to read are returned. + * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. + * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content */ @@ -184,10 +201,11 @@ public function suggest(string $prefix, array $fieldPaths = [], int $limit = 10, * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery $query - * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. - * Currently supports: array("languages" => array(,..), "useAlwaysAvailable" => bool) - * useAlwaysAvailable defaults to true to avoid exceptions on missing translations - * @param bool $filterOnUserPermissions if true only the objects which is the user allowed to read are returned. + * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * Also used to define which field languages are loaded for the returned content. + * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. + * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult */ @@ -200,7 +218,15 @@ public function findLocations(LocationQuery $query, array $languageFilter = [], * * @since 1.12 eZ Platform 1.12 (ezpublish-kernel 6.12) * - * @param int $capabilityFlag One of CAPABILITY_* constants. + * @param int $capabilityFlag One of the CAPABILITY_* constants (only a single one, not a bitwise combination): + * {@see SearchService::CAPABILITY_SCORING CAPABILITY_SCORING}, + * {@see SearchService::CAPABILITY_FACETS CAPABILITY_FACETS}, + * {@see SearchService::CAPABILITY_CUSTOM_FIELDS CAPABILITY_CUSTOM_FIELDS}, + * {@see SearchService::CAPABILITY_SPELLCHECK CAPABILITY_SPELLCHECK}, + * {@internal SearchService::CAPABILITY_HIGHLIGHT CAPABILITY_HIGHLIGHT,} + * {@see SearchService::CAPABILITY_SUGGEST CAPABILITY_SUGGEST}, + * {@see SearchService::CAPABILITY_ADVANCED_FULLTEXT CAPABILITY_ADVANCED_FULLTEXT}, or + * {@see SearchService::CAPABILITY_AGGREGATIONS CAPABILITY_AGGREGATIONS}. * * @return bool */ diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index 7102605e59..b782f7ed76 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -16,17 +16,17 @@ * This class represents a location in the repository. * * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo calls getContentInfo() - * @property-read int $contentId @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getContentId()} instead. - * @property-read int $id @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getId()} instead. + * @property-read int $contentId Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getContentId()} instead. + * @property-read int $id Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getId()} instead. * @property-read int $priority Position of the Location among its siblings when sorted using priority - * @property-read bool $hidden @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::isHidden()} instead. - * @property-read bool $invisible @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::isInvisible()} instead. + * @property-read bool $hidden Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::isHidden()} instead. + * @property-read bool $invisible Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::isInvisible()} instead. * @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 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getPathString()} instead. - * @property-read array $path @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getPath()} instead. - * @property-read int $depth @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getDepth()} instead. + * @property-read string $pathString Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getPathString()} instead. + * @property-read array $path Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getPath()} instead. + * @property-read int $depth Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getDepth()} instead. * @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_*} */ From 44cfae05c2a853e5bf8305be0cc4fdf3c8da716a Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 16 Dec 2024 12:59:20 +0100 Subject: [PATCH 71/92] Enhance `Location` phpdoc: Add an internal link --- src/contracts/Repository/Values/Content/Location.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index b782f7ed76..5eb5edd09a 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -15,7 +15,7 @@ /** * This class represents a location in the repository. * - * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo calls getContentInfo() + * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo Calls {@see Location::getContentInfo()} * @property-read int $contentId Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getContentId()} instead. * @property-read int $id Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getId()} instead. * @property-read int $priority Position of the Location among its siblings when sorted using priority From a315a36a2f0a09d605a75a0d1235d5839609fa8d Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:37:49 +0100 Subject: [PATCH 72/92] Enhance `ValueObject` phpdoc - Describes a bit more `getProperties` - Details `getProperties` param type and returned type - Hides link to internal function - Uses `@internal` as a short for "@ignore This method is for internal use" - Fixes internal links --- .../Repository/Values/ValueObject.php | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/contracts/Repository/Values/ValueObject.php b/src/contracts/Repository/Values/ValueObject.php index 0ab3d6e7fe..d2827a8770 100644 --- a/src/contracts/Repository/Values/ValueObject.php +++ b/src/contracts/Repository/Values/ValueObject.php @@ -26,7 +26,7 @@ abstract class ValueObject * Readonly properties values must be set using $properties as they are not writable anymore * after object has been created. * - * @param array $properties + * @param array $properties */ public function __construct(array $properties = []) { @@ -36,17 +36,18 @@ public function __construct(array $properties = []) } /** - * Function where list of properties are returned. + * Returns list of available properties' names. * - * Used by {@see attributes()}, override to add dynamic properties + * {@internal Used by {@see ValueObject::attributes()}} + * Override to add dynamic properties. * - * @uses ::__isset() + * @uses ValueObject::__isset() * * @todo Make object traversable and reuse this function there (hence why this is not exposed) * - * @param array $dynamicProperties Additional dynamic properties exposed on the object + * @param array $dynamicProperties Additional dynamic properties exposed on the object * - * @return array + * @return array * * @SerializerIgnore() */ @@ -65,7 +66,7 @@ protected function getProperties($dynamicProperties = []) /** * Magic set function handling writes to non public properties. * - * @ignore This method is for internal use + * @internal * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException When property does not exist * @throws \Ibexa\Contracts\Core\Repository\Exceptions\PropertyReadOnlyException When property is readonly (protected) @@ -86,7 +87,7 @@ public function __set($property, $value) * * Returns value for all readonly (protected) properties. * - * @ignore This method is for internal use + * @internal * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException exception on all reads to undefined properties so typos are not silently accepted. * @@ -107,7 +108,7 @@ public function __get($property) * * Returns true for all (public/)protected/private properties. * - * @ignore This method is for internal use + * @internal * * @param string $property Name of the property * @@ -121,12 +122,12 @@ public function __isset($property) /** * Magic unset function handling unset() to non public properties. * - * @ignore This method is for internal use + * @internal * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException exception on all writes to undefined properties so typos are not silently accepted and * @throws \Ibexa\Contracts\Core\Repository\Exceptions\PropertyReadOnlyException exception on readonly (protected) properties. * - * @uses ::__set() + * @uses ValueObject::__set() * * @param string $property Name of the property * @@ -147,7 +148,7 @@ public function __unset($property) * var_export() generates code, that calls this method when it * is parsed with PHP. * - * @ignore This method is for internal use + * @internal * * @param mixed[] $array * @@ -161,11 +162,11 @@ public static function __set_state(array $array) /** * Internal function for Legacy template engine compatibility to get property value. * - * @ignore This method is for internal use + * @internal * * @deprecated Since 5.0, available purely for legacy eZTemplate compatibility * - * @uses ::__get() + * @uses ValueObject::__get() * * @param string $property * @@ -179,11 +180,12 @@ final public function attribute($property) /** * Internal function for Legacy template engine compatibility to get properties. * - * @ignore This method is for internal use + * @internal * * @deprecated Since 5.0, available purely for legacy eZTemplate compatibility * - * @uses ::__isset() + * @uses ValueObject::getProperties() + * @uses ValueObject::__isset() * * @return array */ @@ -195,11 +197,11 @@ final public function attributes() /** * Internal function for Legacy template engine compatibility to check existence of property. * - * @ignore This method is for internal use + * @internal * * @deprecated Since 5.0, available purely for legacy eZTemplate compatibility * - * @uses ::__isset() + * @uses ValueObject::__isset() * * @param string $property * From 7d646019970715a2ec2272cee79f8c41dbcc35fb Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 17 Dec 2024 17:02:18 +0100 Subject: [PATCH 73/92] Enhance `FieldType\Generic\Type` phpdoc: Fix internal links --- src/contracts/FieldType/Generic/Type.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/contracts/FieldType/Generic/Type.php b/src/contracts/FieldType/Generic/Type.php index 55c61b8ab1..b09f77220e 100644 --- a/src/contracts/FieldType/Generic/Type.php +++ b/src/contracts/FieldType/Generic/Type.php @@ -260,15 +260,15 @@ final public function acceptValue($inputValue): Value * If given $inputValue could not be converted or is already an instance of dedicate value object, * the method should simply return it. * - * This is an operation method for {@see acceptValue()}. + * This is an operation method for {@see Type::acceptValue()}. * * Example implementation: * ``` - * protected function createValueFromInput( $inputValue ) + * protected function createValueFromInput($inputValue) * { * if (is_array($inputValue)) * { - * $inputValue = \My\FieldType\CookieJar\Value( $inputValue ); + * $inputValue = \My\FieldType\CookieJar\Value($inputValue); * } * * return $inputValue; @@ -304,7 +304,7 @@ protected function getValueClass(): string /** * Throws an exception if the given $value is not an instance of the supported value subtype. * - * This is an operation method for {@see acceptValue()}. + * This is an operation method for {@see Type::acceptValue()}. * * Default implementation expects the value class to reside in the same namespace as its * FieldType class and is named "Value". @@ -320,7 +320,7 @@ protected function getValueClass(): string * } * ``` * - * @param mixed $value A value returned by {@see createValueFromInput()}. + * @param mixed $value A value returned by {@see Type::createValueFromInput()}. * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException If the parameter is not an instance of the supported value subtype. */ From bf0ce81e531a85288a29bf5ceae46509d822b97c Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 17 Dec 2024 17:03:39 +0100 Subject: [PATCH 74/92] Enhance `FieldType\FieldType` phpdoc: Fix code blocks --- src/contracts/FieldType/FieldType.php | 56 +++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/contracts/FieldType/FieldType.php b/src/contracts/FieldType/FieldType.php index 46694a2458..388fb0e657 100644 --- a/src/contracts/FieldType/FieldType.php +++ b/src/contracts/FieldType/FieldType.php @@ -100,20 +100,20 @@ abstract public function getSettingsSchema(); * It is considered best practice to return a hash map, which contains * rudimentary settings structures, like e.g. for the "ezstring" FieldType * - * - * array( - * 'stringLength' => array( - * 'minStringLength' => array( - * 'type' => 'int', - * 'default' => 0, - * ), - * 'maxStringLength' => array( - * 'type' => 'int' - * 'default' => null, - * ) - * ), - * ); - * + * ``` + * [ + * 'stringLength' => [ + * 'minStringLength' => [ + * 'type' => 'int', + * 'default' => 0, + * ], + * 'maxStringLength' => [ + * 'type' => 'int' + * 'default' => null, + * ], + * ], + * ]; + * ``` * * @return mixed */ @@ -360,22 +360,22 @@ abstract public function fromPersistenceValue(FieldValue $fieldValue); * * @param \Ibexa\Contracts\Core\FieldType\Value $value * - * @return array Hash with relation type as key and array of destination content ids as value. + * @return array Hash with relation type as key and array of destination content IDs as value. * * Example: - * - * array( - * \Ibexa\Contracts\Core\Repository\Values\Content\Relation::LINK => array( - * "contentIds" => array( 12, 13, 14 ), - * "locationIds" => array( 24 ) - * ), - * \Ibexa\Contracts\Core\Repository\Values\Content\Relation::EMBED => array( - * "contentIds" => array( 12 ), - * "locationIds" => array( 24, 45 ) - * ), - * \Ibexa\Contracts\Core\Repository\Values\Content\Relation::FIELD => array( 12 ) - * ) - * + * ``` + * [ + * \Ibexa\Contracts\Core\Repository\Values\Content\Relation::LINK => [ + * 'contentIds' => [12, 13, 14], + * 'locationIds' => [24] + * ], + * \Ibexa\Contracts\Core\Repository\Values\Content\Relation::EMBED => [ + * 'contentIds" => [12], + * 'locationIds' => [24, 45] + * ], + * \Ibexa\Contracts\Core\Repository\Values\Content\Relation::FIELD => [12] + * ] + * ``` */ abstract public function getRelations(Value $value); } From da00d1f83c52bbf60fde921bceea83d2f38688eb Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 19 Dec 2024 11:13:01 +0100 Subject: [PATCH 75/92] Values\Content\Location: Set protected/read-only property as internal --- src/contracts/Repository/Values/Content/Location.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index 5eb5edd09a..1d3142bdb3 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -90,6 +90,7 @@ abstract class Location extends ValueObject * Location ID. * * @var int + * @internal Read-only property accessed through magic getter. */ protected $id; @@ -110,6 +111,7 @@ abstract class Location extends ValueObject * sort order. * * @var int + * @internal Read-only property accessed through magic getter. */ protected $priority; @@ -117,6 +119,7 @@ abstract class Location extends ValueObject * Indicates that the Location entity is hidden (explicitly or hidden by content). * * @var bool + * @internal Read-only property accessed through magic getter. */ protected $hidden; @@ -125,6 +128,7 @@ abstract class Location extends ValueObject * or implicitly hidden by its Content or an ancestor Location. * * @var bool + * @internal Read-only property accessed through magic getter. */ protected $invisible; @@ -132,6 +136,7 @@ abstract class Location extends ValueObject * Indicates that the Location entity has been explicitly marked as hidden. * * @var bool + * @internal Read-only property accessed through magic getter. */ protected $explicitlyHidden; @@ -141,6 +146,7 @@ abstract class Location extends ValueObject * A universally unique identifier. * * @var string + * @internal Read-only property accessed through magic getter. */ protected $remoteId; @@ -148,6 +154,7 @@ abstract class Location extends ValueObject * Parent ID. * * @var int Location ID. + * @internal Read-only property accessed through magic getter. */ protected $parentLocationId; @@ -155,6 +162,7 @@ abstract class Location extends ValueObject * The materialized path of the location entry, eg: /1/2/4/23/. * * @var string + * @internal Read-only property accessed through magic getter. */ protected $pathString; @@ -165,6 +173,7 @@ abstract class Location extends ValueObject * Same as {@see Location::$pathString} but as array, e.g.: `['1', '2', '4', '23']`. * * @var array + * @internal Read-only property accessed through magic getter. */ protected array $path; @@ -172,6 +181,7 @@ abstract class Location extends ValueObject * Depth location has in the location tree. * * @var int + * @internal Read-only property accessed through magic getter. */ protected $depth; @@ -181,6 +191,7 @@ abstract class Location extends ValueObject * Valid values are found at {@link Location::SORT_FIELD_*} * * @var int + * @internal Read-only property accessed through magic getter. */ protected $sortField; @@ -190,6 +201,7 @@ abstract class Location extends ValueObject * Valid values are {@link Location::SORT_ORDER_*} * * @var int + * @internal Read-only property accessed through magic getter. */ protected $sortOrder; From c1befcfdf61a6ba3a2a42b066974db2f62ab7172 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:14:46 +0100 Subject: [PATCH 76/92] Revert "Values\Content\Location: Set protected/read-only property as internal" This reverts commit 44aede1d26a38c8fee71ec204804f9b3aca8f3b4. --- src/contracts/Repository/Values/Content/Location.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index 1d3142bdb3..5eb5edd09a 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -90,7 +90,6 @@ abstract class Location extends ValueObject * Location ID. * * @var int - * @internal Read-only property accessed through magic getter. */ protected $id; @@ -111,7 +110,6 @@ abstract class Location extends ValueObject * sort order. * * @var int - * @internal Read-only property accessed through magic getter. */ protected $priority; @@ -119,7 +117,6 @@ abstract class Location extends ValueObject * Indicates that the Location entity is hidden (explicitly or hidden by content). * * @var bool - * @internal Read-only property accessed through magic getter. */ protected $hidden; @@ -128,7 +125,6 @@ abstract class Location extends ValueObject * or implicitly hidden by its Content or an ancestor Location. * * @var bool - * @internal Read-only property accessed through magic getter. */ protected $invisible; @@ -136,7 +132,6 @@ abstract class Location extends ValueObject * Indicates that the Location entity has been explicitly marked as hidden. * * @var bool - * @internal Read-only property accessed through magic getter. */ protected $explicitlyHidden; @@ -146,7 +141,6 @@ abstract class Location extends ValueObject * A universally unique identifier. * * @var string - * @internal Read-only property accessed through magic getter. */ protected $remoteId; @@ -154,7 +148,6 @@ abstract class Location extends ValueObject * Parent ID. * * @var int Location ID. - * @internal Read-only property accessed through magic getter. */ protected $parentLocationId; @@ -162,7 +155,6 @@ abstract class Location extends ValueObject * The materialized path of the location entry, eg: /1/2/4/23/. * * @var string - * @internal Read-only property accessed through magic getter. */ protected $pathString; @@ -173,7 +165,6 @@ abstract class Location extends ValueObject * Same as {@see Location::$pathString} but as array, e.g.: `['1', '2', '4', '23']`. * * @var array - * @internal Read-only property accessed through magic getter. */ protected array $path; @@ -181,7 +172,6 @@ abstract class Location extends ValueObject * Depth location has in the location tree. * * @var int - * @internal Read-only property accessed through magic getter. */ protected $depth; @@ -191,7 +181,6 @@ abstract class Location extends ValueObject * Valid values are found at {@link Location::SORT_FIELD_*} * * @var int - * @internal Read-only property accessed through magic getter. */ protected $sortField; @@ -201,7 +190,6 @@ abstract class Location extends ValueObject * Valid values are {@link Location::SORT_ORDER_*} * * @var int - * @internal Read-only property accessed through magic getter. */ protected $sortOrder; From ae1eaff5b94b9f2354d4d0fbd54c69bdc7a7c5c2 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:21:07 +0100 Subject: [PATCH 77/92] Revert src/lib/Limitation/ Revert 1799d56726f42e82f65a1054a2a823746dd2a4de changes on src/lib/Limitation/ as this is out of contracts scope. --- src/lib/Limitation/LocationLimitationType.php | 5 +++-- src/lib/Limitation/SubtreeLimitationType.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/Limitation/LocationLimitationType.php b/src/lib/Limitation/LocationLimitationType.php index e0ce4ec2b6..3c7cd6571f 100644 --- a/src/lib/Limitation/LocationLimitationType.php +++ b/src/lib/Limitation/LocationLimitationType.php @@ -224,9 +224,10 @@ public function getCriterion(APILimitationValue $value, APIUserReference $curren } /** - * Returns an integer code meaning that the value must be an array listing location IDs. + * Returns info on valid $limitationValues. * - * @return int {@see LocationLimitationType::VALUE_SCHEMA_LOCATION_ID} + * @return mixed[]|int In case of array, a hash with key as valid limitations value and value as human readable name + * of that option, in case of int on of VALUE_SCHEMA_ constants. */ public function valueSchema() { diff --git a/src/lib/Limitation/SubtreeLimitationType.php b/src/lib/Limitation/SubtreeLimitationType.php index 3ceb4cee0d..c642ec64e8 100644 --- a/src/lib/Limitation/SubtreeLimitationType.php +++ b/src/lib/Limitation/SubtreeLimitationType.php @@ -258,9 +258,10 @@ public function getCriterion(APILimitationValue $value, APIUserReference $curren } /** - * Returns an integer code meaning that the value must be an array listing location paths. + * Returns info on valid $limitationValues. * - * @return int {@see SubtreeLimitationType::VALUE_SCHEMA_LOCATION_PATH} + * @return mixed[]|int In case of array, a hash with key as valid limitations value and value as human readable name + * of that option, in case of int on of VALUE_SCHEMA_ constants. */ public function valueSchema() { From d609a8dea8b2779b28ba520ac396ad5d09e0ceaa Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 20 Dec 2024 17:15:29 +0100 Subject: [PATCH 78/92] `Limitation\Type`: type array keys --- src/contracts/Limitation/Type.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/contracts/Limitation/Type.php b/src/contracts/Limitation/Type.php index cb5410d705..584cba60e1 100644 --- a/src/contracts/Limitation/Type.php +++ b/src/contracts/Limitation/Type.php @@ -92,17 +92,17 @@ public function acceptValue(APILimitationValue $limitationValue); * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation $limitationValue * - * @return \Ibexa\Contracts\Core\FieldType\ValidationError[] + * @return array */ public function validate(APILimitationValue $limitationValue); /** * Create the Limitation Value. * - * The is the method to create values as Limitation type needs value knowledge anyway in acceptValue, + * This is the method to create values as Limitation type needs value knowledge anyway in acceptValue, * the reverse relation is provided by means of identifier lookup (Value has identifier, and so does RoleService). * - * @param mixed[] $limitationValues + * @param array $limitationValues * * @return \Ibexa\Contracts\Core\Repository\Values\User\Limitation */ @@ -120,7 +120,7 @@ public function buildValue(array $limitationValues); * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation $value * @param \Ibexa\Contracts\Core\Repository\Values\User\UserReference $currentUser * @param \Ibexa\Contracts\Core\Repository\Values\ValueObject $object - * @param \Ibexa\Contracts\Core\Repository\Values\ValueObject[]|null $targets An array of location, parent or "assignment" + * @param array|null $targets An array of location, parent or "assignment" * objects, if null: none where provided by caller * * @return bool|null Returns one of ACCESS_* constants, {@see Type::ACCESS_GRANTED}, {@see Type::ACCESS_ABSTAIN}, or {@see Type::ACCESS_DENIED}. From f39e25b0f93671ef62dae188660e67d9b8da7760 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Sun, 22 Dec 2024 13:16:03 +0100 Subject: [PATCH 79/92] ValueObject: Format desc --- src/contracts/Repository/Values/ValueObject.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/contracts/Repository/Values/ValueObject.php b/src/contracts/Repository/Values/ValueObject.php index d2827a8770..16ad2033da 100644 --- a/src/contracts/Repository/Values/ValueObject.php +++ b/src/contracts/Repository/Values/ValueObject.php @@ -13,9 +13,9 @@ /** * The base class for all value objects and structs. * - * Supports readonly properties by marking them as protected. + * Supports read-only properties by marking them as protected. * In this case they will only be writable using constructor, and need to be documented - * using property-read <$var> annotation in class doc in addition to inline property doc. + * using `@property-read <$var>` annotation in class doc in addition to inline property doc. * Writable properties must be public and must be documented inline. */ abstract class ValueObject From dd05db9a03e365946e18c55e1e6e348d011a4380 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Sun, 22 Dec 2024 19:54:27 +0100 Subject: [PATCH 80/92] ValueObject: Format desc --- src/contracts/Repository/Values/ValueObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Repository/Values/ValueObject.php b/src/contracts/Repository/Values/ValueObject.php index 16ad2033da..7e57f82dee 100644 --- a/src/contracts/Repository/Values/ValueObject.php +++ b/src/contracts/Repository/Values/ValueObject.php @@ -23,7 +23,7 @@ abstract class ValueObject /** * Construct object optionally with a set of properties. * - * Readonly properties values must be set using $properties as they are not writable anymore + * Readonly properties values must be set using `$properties` as they aren't writable anymore * after object has been created. * * @param array $properties From 2c09e9526db026c1416c4efa2f834170a1929a1d Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Sun, 22 Dec 2024 19:54:41 +0100 Subject: [PATCH 81/92] ValueObject: Format desc --- src/contracts/Repository/Values/ValueObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Repository/Values/ValueObject.php b/src/contracts/Repository/Values/ValueObject.php index 7e57f82dee..583cd307bd 100644 --- a/src/contracts/Repository/Values/ValueObject.php +++ b/src/contracts/Repository/Values/ValueObject.php @@ -64,7 +64,7 @@ protected function getProperties($dynamicProperties = []) } /** - * Magic set function handling writes to non public properties. + * Magic set function handling writes to non-public properties. * * @internal * From 44981a0b686eb55215d60c13e108c4ff27a74205 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:24:36 +0100 Subject: [PATCH 82/92] ValueObject.php: fix phpdoc_inline_tag_normalizer --- src/contracts/Repository/Values/ValueObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Repository/Values/ValueObject.php b/src/contracts/Repository/Values/ValueObject.php index 583cd307bd..ca880a8283 100644 --- a/src/contracts/Repository/Values/ValueObject.php +++ b/src/contracts/Repository/Values/ValueObject.php @@ -38,7 +38,7 @@ public function __construct(array $properties = []) /** * Returns list of available properties' names. * - * {@internal Used by {@see ValueObject::attributes()}} + * {@internal Used by {@see ValueObject::attributes()}.} * Override to add dynamic properties. * * @uses ValueObject::__isset() From 026cdcd52c5cc2ce3cde5c119868065c0ef21591 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:51:33 +0100 Subject: [PATCH 83/92] Reset \Ibexa\Contracts\Core\Limitation\Type::valueSchema() Too difficult to solve in this PR --- src/contracts/Limitation/Type.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/contracts/Limitation/Type.php b/src/contracts/Limitation/Type.php index 584cba60e1..d57a3af203 100644 --- a/src/contracts/Limitation/Type.php +++ b/src/contracts/Limitation/Type.php @@ -143,10 +143,9 @@ public function getCriterion(APILimitationValue $value, APIUserReference $curren /** * Returns info on valid $limitationValues. * - * @return array|Traversable|int In case of array, a hash with key as valid limitations value and value as human-readable name - * of that option. Note: The hash might be an instance of Traversable instead of a native PHP array. - * In case of int, one of VALUE_SCHEMA_* constants. Used in cases where a certain value is accepted - * but the options are too many to return as a hash of options. + * @return mixed[]|int In case of array, a hash with key as valid limitations value and value as human readable name + * of that option, in case of int on of VALUE_SCHEMA_* constants. + * Note: The hash might be an instance of Traversable, and not a native php array. */ public function valueSchema(); } From 212c88d38e510190cbc35aead433d4f0555bd972 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 18:14:04 +0100 Subject: [PATCH 84/92] LocationService.php: type iterable's values "return type has no value type specified in iterable type iterable" --- src/contracts/Repository/LocationService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Repository/LocationService.php b/src/contracts/Repository/LocationService.php index 5181d398d7..a86c990d5b 100644 --- a/src/contracts/Repository/LocationService.php +++ b/src/contracts/Repository/LocationService.php @@ -60,7 +60,7 @@ public function loadLocation(int $locationId, ?array $prioritizedLanguages = nul * @param array|null $prioritizedLanguages Filter on and use as prioritized language code on translated properties of returned objects. * @param bool|null $useAlwaysAvailable Respect always available flag on content when filtering on $prioritizedLanguages. * - * @return array|iterable + * @return array|iterable<\Ibexa\Contracts\Core\Repository\Values\Content\Location> */ public function loadLocationList(array $locationIds, ?array $prioritizedLanguages = null, ?bool $useAlwaysAvailable = null): iterable; From 6515cb27f11ef84bab2c9b0dcd041f44cbc8e58f Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 3 Feb 2025 18:39:44 +0100 Subject: [PATCH 85/92] SearchService.php: Fix $languageFilter usage --- src/contracts/Repository/SearchService.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/contracts/Repository/SearchService.php b/src/contracts/Repository/SearchService.php index 852ebd3149..b42d323700 100644 --- a/src/contracts/Repository/SearchService.php +++ b/src/contracts/Repository/SearchService.php @@ -137,7 +137,7 @@ interface SearchService * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query $query - * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. * Also used to define which field languages are loaded for the returned content. * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. @@ -159,7 +159,7 @@ public function findContent(Query $query, array $languageFilter = [], bool $filt * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query $query - * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. @@ -176,7 +176,7 @@ public function findContentInfo(Query $query, array $languageFilter = [], bool $ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if there is more than than one result matching the criterions * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion $filter - * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. @@ -201,7 +201,7 @@ public function suggest(string $prefix, array $fieldPaths = [], int $limit = 10, * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery $query - * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. * Also used to define which field languages are loaded for the returned content. * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. From 5f681f91ab3479c72fc2df2e2de2ba1c904a0fd1 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 4 Feb 2025 12:02:18 +0100 Subject: [PATCH 86/92] SearchService.php: Enh. $languageFilter usage's doc --- src/contracts/Repository/SearchService.php | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/contracts/Repository/SearchService.php b/src/contracts/Repository/SearchService.php index b42d323700..faa1cfc0bc 100644 --- a/src/contracts/Repository/SearchService.php +++ b/src/contracts/Repository/SearchService.php @@ -137,10 +137,11 @@ interface SearchService * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query $query - * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. * Also used to define which field languages are loaded for the returned content. - * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. - * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * Currently, supports two syntaxes: + * - `['languages' => [,…], 'useAlwaysAvailable' => ]` + * - `[,…]` where `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult @@ -159,9 +160,10 @@ public function findContent(Query $query, array $languageFilter = [], bool $filt * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query $query - * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. - * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. - * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * Currently, supports two syntaxes: + * - `['languages' => [,…], 'useAlwaysAvailable' => ]` + * - `[,…]` where `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult @@ -176,9 +178,10 @@ public function findContentInfo(Query $query, array $languageFilter = [], bool $ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if there is more than than one result matching the criterions * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion $filter - * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. - * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. - * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * Currently, supports two syntaxes: + * - `['languages' => [,…], 'useAlwaysAvailable' => ]` + * - `[,…]` where `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content @@ -201,10 +204,11 @@ public function suggest(string $prefix, array $fieldPaths = [], int $limit = 10, * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if query is not valid * * @param \Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery $query - * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. + * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. * Also used to define which field languages are loaded for the returned content. - * Currently, supports `['languages' => [,…], 'useAlwaysAvailable' => ]`. - * `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * Currently, supports two syntaxeses: + * - `['languages' => [,…], 'useAlwaysAvailable' => ]` + * - `[,…]` where `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult From e3968cf425fcaf4af8be8d1758686c22797da398 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 5 Feb 2025 18:40:49 +0100 Subject: [PATCH 87/92] =?UTF-8?q?phpstan-baseline.neon:=20=F0=9F=A4=9E=20F?= =?UTF-8?q?ix=20last=20PHP=208.1=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpstan-baseline.neon | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index cc61420b5a..85ba6adff4 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -17401,7 +17401,7 @@ parameters: path: src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php - - message: "#^Method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\Type\\\\MemoryCachingHandler\\:\\:loadContentTypeList\\(\\) should return array\\ but returns array\\\\.$#" + message: "#^Method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\Type\\\\MemoryCachingHandler\\:\\:loadContentTypeList\\(\\) should return array\\ but returns array\\\\.$#" count: 1 path: src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php @@ -17431,7 +17431,7 @@ parameters: path: src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php - - message: "#^Method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\Type\\\\MemoryCachingHandler\\:\\:loadGroups\\(\\) should return array\\ but returns array\\\\.$#" + message: "#^Method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\Type\\\\MemoryCachingHandler\\:\\:loadGroups\\(\\) should return array\\ but returns array\\\\.$#" count: 1 path: src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php @@ -18866,7 +18866,7 @@ parameters: path: src/lib/Persistence/Legacy/User/Handler.php - - message: "#^Cannot access offset mixed on non\\-empty\\-array\\\\|Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\User\\\\RoleAssignment\\.$#" + message: "#^Cannot access offset mixed on non\\-empty\\-array\\|Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\User\\\\RoleAssignment\\.$#" count: 1 path: src/lib/Persistence/Legacy/User/Mapper.php @@ -20516,7 +20516,7 @@ parameters: path: src/lib/Repository/RoleService.php - - message: "#^Method Ibexa\\\\Core\\\\Repository\\\\RoleService\\:\\:validateRoleCreateStruct\\(\\) should return iterable\\\\>\\> but returns array\\\\>\\>\\.$#" + message: "#^Method Ibexa\\\\Core\\\\Repository\\\\RoleService\\:\\:validateRoleCreateStruct\\(\\) should return iterable\\\\>\\> but returns array\\\\>\\>\\.$#" count: 1 path: src/lib/Repository/RoleService.php From e84cd6ec05992ef868a53ae2f43c5c1986a1e67d Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 12 Feb 2025 14:01:22 +0100 Subject: [PATCH 88/92] Apply suggestions from code review Co-authored-by: Konrad Oboza Co-authored-by: Andrew Longosz --- src/contracts/Repository/Values/Content/Location.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index 5eb5edd09a..583fad02ec 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -159,12 +159,12 @@ abstract class Location extends ValueObject protected $pathString; /** - * The list of ancestor Locations' IDs, ordered in increasing depths, + * The list of ancestor locations' IDs, ordered by increasing depth, * starting with '1', and ending with the current Location's ID. * * Same as {@see Location::$pathString} but as array, e.g.: `['1', '2', '4', '23']`. * - * @var array + * @var array */ protected array $path; @@ -270,7 +270,7 @@ public function getPathString(): string } /** - * The list of ancestor Locations' IDs, ordered in increasing depths, + * The list of ancestor locations' IDs, ordered by increasing depth, * starting with 1, and ending with the current Location's ID. * * Same as {@see Location::getPathString()} but as array, e.g.: `['1', '2', '4', '23']`. From 6b57adac52108d8ebe39c4af94a0f0d8c488c726 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 12 Feb 2025 14:25:53 +0100 Subject: [PATCH 89/92] =?UTF-8?q?=E2=80=A6\Content\Location:=20Rephrase=20?= =?UTF-8?q?magic=20getter=20deprecation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Repository/Values/Content/Location.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index 583fad02ec..a82c8e54ac 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -16,17 +16,17 @@ * This class represents a location in the repository. * * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo Calls {@see Location::getContentInfo()} - * @property-read int $contentId Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getContentId()} instead. - * @property-read int $id Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getId()} instead. + * @property-read int $contentId Accessing magic getter is deprecated since 4.6.7 and will be removed in 5.0.0. Use {@see Location::getContentId()} instead. + * @property-read int $id Accessing magic getter is deprecated since 4.6.7 and will be removed in 5.0.0. Use {@see Location::getId()} instead. * @property-read int $priority Position of the Location among its siblings when sorted using priority - * @property-read bool $hidden Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::isHidden()} instead. - * @property-read bool $invisible Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::isInvisible()} instead. + * @property-read bool $hidden Accessing magic getter is deprecated since 4.6.7 and will be removed in 5.0.0. Use {@see Location::isHidden()} instead. + * @property-read bool $invisible Accessing magic getter is deprecated since 4.6.7 and will be removed in 5.0.0. Use {@see Location::isInvisible()} instead. * @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 Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getPathString()} instead. - * @property-read array $path Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getPath()} instead. - * @property-read int $depth Since 4.6.7, accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getDepth()} instead. + * @property-read string $pathString Accessing magic getter is deprecated since 4.6.7 and will be removed in 5.0.0. Use {@see Location::getPathString()} instead. + * @property-read array $path Accessing magic getter is deprecated since 4.6.7 and will be removed in 5.0.0. Use {@see Location::getPath()} instead. + * @property-read int $depth Accessing magic getter is deprecated since 4.6.7 and will be removed in 5.0.0. Use {@see Location::getDepth()} instead. * @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_*} */ @@ -310,6 +310,7 @@ public function getDepth(): int return $this->depth; } + /** @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. */ public function __isset($property) { if ($property === 'path') { @@ -319,6 +320,7 @@ public function __isset($property) return parent::__isset($property); } + /** @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. */ public function __get($property) { if ($property === 'path') { From 45edb84859749833885a85f83c9fa42dbc629c8c Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 13 Feb 2025 12:22:17 +0100 Subject: [PATCH 90/92] SearchService.php: Fix PhpDoc indent for PhpStorm --- src/contracts/Repository/SearchService.php | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/contracts/Repository/SearchService.php b/src/contracts/Repository/SearchService.php index faa1cfc0bc..e99d3b013e 100644 --- a/src/contracts/Repository/SearchService.php +++ b/src/contracts/Repository/SearchService.php @@ -138,10 +138,10 @@ interface SearchService * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query $query * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. - * Also used to define which field languages are loaded for the returned content. - * Currently, supports two syntaxes: - * - `['languages' => [,…], 'useAlwaysAvailable' => ]` - * - `[,…]` where `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * Also used to define which field languages are loaded for the returned content. + * Currently, supports two syntaxes: + * - `['languages' => [,…], 'useAlwaysAvailable' => ]` + * - `[,…]` where `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult @@ -161,9 +161,9 @@ public function findContent(Query $query, array $languageFilter = [], bool $filt * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query $query * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. - * Currently, supports two syntaxes: - * - `['languages' => [,…], 'useAlwaysAvailable' => ]` - * - `[,…]` where `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * Currently, supports two syntaxes: + * - `['languages' => [,…], 'useAlwaysAvailable' => ]` + * - `[,…]` where `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult @@ -179,9 +179,9 @@ public function findContentInfo(Query $query, array $languageFilter = [], bool $ * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion $filter * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. - * Currently, supports two syntaxes: - * - `['languages' => [,…], 'useAlwaysAvailable' => ]` - * - `[,…]` where `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * Currently, supports two syntaxes: + * - `['languages' => [,…], 'useAlwaysAvailable' => ]` + * - `[,…]` where `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content @@ -205,10 +205,10 @@ public function suggest(string $prefix, array $fieldPaths = [], int $limit = 10, * * @param \Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery $query * @param array|array $languageFilter Configuration for specifying prioritized languages query will be performed on. - * Also used to define which field languages are loaded for the returned content. - * Currently, supports two syntaxeses: - * - `['languages' => [,…], 'useAlwaysAvailable' => ]` - * - `[,…]` where `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. + * Also used to define which field languages are loaded for the returned content. + * Currently, supports two syntaxeses: + * - `['languages' => [,…], 'useAlwaysAvailable' => ]` + * - `[,…]` where `useAlwaysAvailable` defaults to `true` to avoid exceptions on missing translations. * @param bool $filterOnUserPermissions if `true` (default), only the objects which the user is allowed to read are returned. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult From 9a456d6383463cec3a54d81d2c345b65527f1541 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 13 Feb 2025 14:36:42 +0100 Subject: [PATCH 91/92] Location.php: Location::$id is obviously the Location ID. --- src/contracts/Repository/Values/Content/Location.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/contracts/Repository/Values/Content/Location.php b/src/contracts/Repository/Values/Content/Location.php index a82c8e54ac..8f60c18696 100644 --- a/src/contracts/Repository/Values/Content/Location.php +++ b/src/contracts/Repository/Values/Content/Location.php @@ -87,8 +87,6 @@ abstract class Location extends ValueObject ]; /** - * Location ID. - * * @var int */ protected $id; From ba090e2d50d09e1f4871a414090a40efe5168fb0 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 13 Feb 2025 15:44:30 +0100 Subject: [PATCH 92/92] Type.php: Remove `@since` Confusing --- src/contracts/Limitation/Type.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/contracts/Limitation/Type.php b/src/contracts/Limitation/Type.php index d57a3af203..3e82b0008b 100644 --- a/src/contracts/Limitation/Type.php +++ b/src/contracts/Limitation/Type.php @@ -26,8 +26,6 @@ interface Type * Constant for return value of {@see Type::evaluate()}. * * Note: In future version constant values might change to 1, 0 and -1 as used in Symfony. - * - * @since 5.3.2 */ public const ACCESS_GRANTED = true; @@ -40,8 +38,6 @@ interface Type * this is only supported by role limitations as policy limitations should not allow this. * * Note: In future version constant values might change to 1, 0 and -1 as used in Symfony. - * - * @since 5.3.2 */ public const ACCESS_ABSTAIN = null; @@ -51,8 +47,6 @@ interface Type * Constant for return value of {@see Type::evaluate()}. * * Note: In future version constant values might change to 1, 0 and -1 as used in Symfony. - * - * @since 5.3.2 */ public const ACCESS_DENIED = false;