Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Enhanced contracts PHPDoc #463

Merged
merged 97 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
37d0a18
Enhance `DateMetadata::TRASHED` phpdoc
adriendupuis Dec 6, 2024
cd00840
Enhance `Criterion::getSpecifications()` phpdoc
adriendupuis Dec 10, 2024
7e87d09
Enhance `Specifications` phpdoc
adriendupuis Dec 10, 2024
8cc9116
Capable.php: Fix phpdoc summary
adriendupuis Dec 11, 2024
67284d4
VersionBuilder.php: Fix phpdoc summary, arrays and self usages
adriendupuis Dec 11, 2024
bc939e0
ConstraintViolationAdapter's PHPDoc: Add a summary, reword description
adriendupuis Dec 12, 2024
8c3cacf
Enhance `Criterion::getSpecifications()` phpdoc
adriendupuis Dec 12, 2024
57d427f
Enhance `DateMetadata::TRASHED` phpdoc
adriendupuis Dec 12, 2024
81d53dd
Enhance `DateMetadata` phpdoc
adriendupuis Dec 12, 2024
d6fb1bd
Enhance `UserMetadata` phpdoc
adriendupuis Dec 12, 2024
88cba98
Enhance `DateMetadata` phpdoc
adriendupuis Dec 12, 2024
89887f3
Enhance `Capable` phpdoc
adriendupuis Dec 12, 2024
e235282
Enhance `Criterion` phpdoc
adriendupuis Dec 12, 2024
6b315d1
Enhance `UserMetadata` phpdoc (fix typo)
adriendupuis Dec 12, 2024
d61337e
Enhance `UserMetadata` phpdoc
adriendupuis Dec 12, 2024
159b622
Enhance `FieldType\Generic\Type` phpdoc
adriendupuis Dec 13, 2024
429bf86
Enhance `Limitation\Type` phpdoc
adriendupuis Dec 13, 2024
9ce4618
LocationService: Fix count() phpdoc
adriendupuis Dec 16, 2024
586acec
Enhance `LocationService` phpdoc
adriendupuis Dec 16, 2024
5ffa696
Enhance `Location` phpdoc
adriendupuis Dec 16, 2024
1927fcb
Enhance `Location` phpdoc: @deprecated can't be nested nor used inline.
adriendupuis Dec 16, 2024
c15cfaf
Enhance `Location` phpdoc: Add an internal link
adriendupuis Dec 16, 2024
d8c2aed
Enhance `ValueObject` phpdoc
adriendupuis Dec 16, 2024
6dfba07
Enhance `FieldType\Generic\Type` phpdoc: Fix internal links
adriendupuis Dec 17, 2024
bc7ccb2
Enhance `FieldType\FieldType` phpdoc: Fix code blocks
adriendupuis Dec 17, 2024
748309b
Values\Content\Location: Set protected/read-only property as internal
adriendupuis Dec 19, 2024
49b6243
Revert "Values\Content\Location: Set protected/read-only property as …
adriendupuis Dec 19, 2024
1e847ae
Revert src/lib/Limitation/
adriendupuis Dec 20, 2024
0b82f1a
`Limitation\Type`: type array keys
adriendupuis Dec 20, 2024
f2cefa6
ValueObject: Format desc
adriendupuis Dec 22, 2024
effbcf7
ValueObject: Format desc
adriendupuis Dec 22, 2024
98c2411
ValueObject: Format desc
adriendupuis Dec 22, 2024
b1ede48
ValueObject.php: fix phpdoc_inline_tag_normalizer
adriendupuis Feb 3, 2025
6ce145d
phpstan-baseline.neon: Update after LocationService::loadLocationList…
adriendupuis Feb 3, 2025
99be2c0
phpstan-baseline.neon: Update after ValueObject::__construct() @param…
adriendupuis Feb 3, 2025
478b0b0
Type::valueSchema(): Can it return generic \Traversable?
adriendupuis Feb 3, 2025
768fd7e
phpstan-baseline.neon: Update after ValueObject::__construct() @param…
adriendupuis Feb 3, 2025
796a62c
phpstan-baseline.neon: Update
adriendupuis Feb 3, 2025
70cd985
Reset \Ibexa\Contracts\Core\Limitation\Type::valueSchema()
adriendupuis Feb 3, 2025
9f61def
Merge branch 'enh-phpdoc' into enh-phpdoc-fix-phpstan
adriendupuis Feb 3, 2025
f835b29
phpstan-baseline.neon: Remove or update not matched
adriendupuis Feb 3, 2025
59d8c29
phpstan-baseline.neon: Remove or update not matched
adriendupuis Feb 3, 2025
7dcfc0e
phpstan-baseline-gte-8.0.neon: Update not matched
adriendupuis Feb 3, 2025
6678e46
phpstan-baseline.neon: Remove or update not matched
adriendupuis Feb 3, 2025
3e34297
LocationService.php: type iterable's values
adriendupuis Feb 3, 2025
d5a2df7
Merge branch 'enh-phpdoc' into enh-phpdoc-fix-phpstan
adriendupuis Feb 3, 2025
dae892b
phpstan-baseline.neonp: type iterable's values
adriendupuis Feb 3, 2025
0cb55b8
SearchService.php: Fix $languageFilter usage
adriendupuis Feb 3, 2025
4aaeeea
SearchService.php: Enh. $languageFilter usage's doc
adriendupuis Feb 4, 2025
f4482fb
Merge branch 'enh-phpdoc' into enh-phpdoc-fix-phpstan
adriendupuis Feb 4, 2025
4349876
Fix SearchServiceTest::testUserMetadataGroupHorizontalFilterContent
adriendupuis Feb 4, 2025
e294a23
Fix SearchServiceTest::testUserMetadataGroupHorizontalFilterContent
adriendupuis Feb 4, 2025
5b5f9fa
Enhance `DateMetadata::TRASHED` phpdoc
adriendupuis Dec 6, 2024
08737f0
Enhance `Criterion::getSpecifications()` phpdoc
adriendupuis Dec 10, 2024
c98dc48
Enhance `Specifications` phpdoc
adriendupuis Dec 10, 2024
1053589
Capable.php: Fix phpdoc summary
adriendupuis Dec 11, 2024
d784a17
VersionBuilder.php: Fix phpdoc summary, arrays and self usages
adriendupuis Dec 11, 2024
c11bef7
ConstraintViolationAdapter's PHPDoc: Add a summary, reword description
adriendupuis Dec 12, 2024
5712894
Enhance `Criterion::getSpecifications()` phpdoc
adriendupuis Dec 12, 2024
70aeff1
Enhance `DateMetadata::TRASHED` phpdoc
adriendupuis Dec 12, 2024
3be5241
Enhance `DateMetadata` phpdoc
adriendupuis Dec 12, 2024
a5d0f32
Enhance `UserMetadata` phpdoc
adriendupuis Dec 12, 2024
c1be1e8
Enhance `DateMetadata` phpdoc
adriendupuis Dec 12, 2024
3676bff
Enhance `Capable` phpdoc
adriendupuis Dec 12, 2024
9018dcc
Enhance `Criterion` phpdoc
adriendupuis Dec 12, 2024
2054817
Enhance `UserMetadata` phpdoc (fix typo)
adriendupuis Dec 12, 2024
f6c4fc4
Enhance `UserMetadata` phpdoc
adriendupuis Dec 12, 2024
12ed22c
Enhance `FieldType\Generic\Type` phpdoc
adriendupuis Dec 13, 2024
a59306d
Enhance `Limitation\Type` phpdoc
adriendupuis Dec 13, 2024
54b3fec
LocationService: Fix count() phpdoc
adriendupuis Dec 16, 2024
04986f5
Enhance `LocationService` phpdoc
adriendupuis Dec 16, 2024
f264267
Enhance `Location` phpdoc
adriendupuis Dec 16, 2024
8035083
Enhance `Location` phpdoc: @deprecated can't be nested nor used inline.
adriendupuis Dec 16, 2024
44cfae0
Enhance `Location` phpdoc: Add an internal link
adriendupuis Dec 16, 2024
a315a36
Enhance `ValueObject` phpdoc
adriendupuis Dec 16, 2024
7d64601
Enhance `FieldType\Generic\Type` phpdoc: Fix internal links
adriendupuis Dec 17, 2024
bf0ce81
Enhance `FieldType\FieldType` phpdoc: Fix code blocks
adriendupuis Dec 17, 2024
da00d1f
Values\Content\Location: Set protected/read-only property as internal
adriendupuis Dec 19, 2024
c1befcf
Revert "Values\Content\Location: Set protected/read-only property as …
adriendupuis Dec 19, 2024
ae1eaff
Revert src/lib/Limitation/
adriendupuis Dec 20, 2024
d609a8d
`Limitation\Type`: type array keys
adriendupuis Dec 20, 2024
f39e25b
ValueObject: Format desc
adriendupuis Dec 22, 2024
dd05db9
ValueObject: Format desc
adriendupuis Dec 22, 2024
2c09e95
ValueObject: Format desc
adriendupuis Dec 22, 2024
44981a0
ValueObject.php: fix phpdoc_inline_tag_normalizer
adriendupuis Feb 3, 2025
026cdcd
Reset \Ibexa\Contracts\Core\Limitation\Type::valueSchema()
adriendupuis Feb 3, 2025
212c88d
LocationService.php: type iterable's values
adriendupuis Feb 3, 2025
6515cb2
SearchService.php: Fix $languageFilter usage
adriendupuis Feb 3, 2025
5f681f9
SearchService.php: Enh. $languageFilter usage's doc
adriendupuis Feb 4, 2025
66bb70d
Merge branch 'enh-phpdoc' into enh-phpdoc-fix-phpstan
adriendupuis Feb 5, 2025
e3968cf
phpstan-baseline.neon: 🤞 Fix last PHP 8.1 errors
adriendupuis Feb 5, 2025
91f989f
Fix/Update PHPStan after PHPDoc enhancement (#473)
adriendupuis Feb 6, 2025
e84cd6e
Apply suggestions from code review
adriendupuis Feb 12, 2025
6b57ada
…\Content\Location: Rephrase magic getter deprecation
adriendupuis Feb 12, 2025
45edb84
SearchService.php: Fix PhpDoc indent for PhpStorm
adriendupuis Feb 13, 2025
9a456d6
Location.php: Location::$id is obviously the Location ID.
adriendupuis Feb 13, 2025
ba090e2
Type.php: Remove `@since`
adriendupuis Feb 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 2 additions & 112 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -5275,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
Expand Down Expand Up @@ -5575,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
Expand Down Expand Up @@ -6865,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
Expand Down Expand Up @@ -7265,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
Expand Down Expand Up @@ -7415,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
Expand Down Expand Up @@ -20141,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\\<int, mixed\\>, array\\|null given\\.$#"
count: 2
path: src/lib/Repository/Mapper/RoleDomainMapper.php

Expand Down Expand Up @@ -20321,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\\<int, mixed\\>, array\\|null given\\.$#"
count: 1
path: src/lib/Repository/Permission/PermissionResolver.php

Expand Down Expand Up @@ -20760,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
Expand Down Expand Up @@ -21195,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
Expand Down Expand Up @@ -37835,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
Expand Down
56 changes: 28 additions & 28 deletions src/contracts/FieldType/FieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
* <code>
* array(
* 'stringLength' => array(
* 'minStringLength' => array(
* 'type' => 'int',
* 'default' => 0,
* ),
* 'maxStringLength' => array(
* 'type' => 'int'
* 'default' => null,
* )
* ),
* );
* </code>
* ```
* [
* 'stringLength' => [
* 'minStringLength' => [
* 'type' => 'int',
* 'default' => 0,
* ],
* 'maxStringLength' => [
* 'type' => 'int'
* 'default' => null,
* ],
* ],
* ];
* ```
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved
*
* @return mixed
*/
Expand Down Expand Up @@ -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:
* <code>
* 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 )
* )
* </code>
* ```
* [
* \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);
}
Expand Down
24 changes: 12 additions & 12 deletions src/contracts/FieldType/Generic/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,20 +260,20 @@ 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:
* <code>
* protected function createValueFromInput( $inputValue )
* ```
* protected function createValueFromInput($inputValue)
* {
* if ( is_array( $inputValue ) )
* if (is_array($inputValue))
* {
* $inputValue = \My\FieldType\CookieJar\Value( $inputValue );
* $inputValue = \My\FieldType\CookieJar\Value($inputValue);
* }
*
* return $inputValue;
* }
* </code>
* ```
*
* @param mixed $inputValue
*
Expand Down Expand Up @@ -304,23 +304,23 @@ 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".
*
* Example implementation:
* <code>
* ```
* 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.");
* }
* }
* </code>
* ```
*
* @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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Loading
Loading