Skip to content

Commit

Permalink
Enhance Criterion phpdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
adriendupuis committed Dec 12, 2024
1 parent 8f1ecce commit e7e9ec0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/contracts/Repository/Values/Content/Query/Criterion.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<int, scalar>|scalar $value
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Value|null $valueData
*
* @todo Add a dedicated exception
Expand Down Expand Up @@ -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<int, \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator\Specifications>
*/
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
*/
Expand Down

0 comments on commit e7e9ec0

Please sign in to comment.