Skip to content

Commit ee31d5a

Browse files
committed
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
1 parent ccbff09 commit ee31d5a

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

src/contracts/Repository/Values/ValueObject.php

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ abstract class ValueObject
2525
* Readonly properties values must be set using $properties as they are not writable anymore
2626
* after object has been created.
2727
*
28-
* @param array $properties
28+
* @param array<string, mixed> $properties
2929
*/
3030
public function __construct(array $properties = [])
3131
{
@@ -35,17 +35,18 @@ public function __construct(array $properties = [])
3535
}
3636

3737
/**
38-
* Function where list of properties are returned.
38+
* Returns list of available properties' names.
3939
*
40-
* Used by {@see attributes()}, override to add dynamic properties
40+
* {@internal Used by {@see ValueObject::attributes()}}
41+
* Override to add dynamic properties.
4142
*
42-
* @uses ::__isset()
43+
* @uses ValueObject::__isset()
4344
*
4445
* @todo Make object traversable and reuse this function there (hence why this is not exposed)
4546
*
46-
* @param array $dynamicProperties Additional dynamic properties exposed on the object
47+
* @param array<int, string> $dynamicProperties Additional dynamic properties exposed on the object
4748
*
48-
* @return array
49+
* @return array<int, string>
4950
*/
5051
protected function getProperties($dynamicProperties = [])
5152
{
@@ -62,7 +63,7 @@ protected function getProperties($dynamicProperties = [])
6263
/**
6364
* Magic set function handling writes to non public properties.
6465
*
65-
* @ignore This method is for internal use
66+
* @internal
6667
*
6768
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException When property does not exist
6869
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\PropertyReadOnlyException When property is readonly (protected)
@@ -83,7 +84,7 @@ public function __set($property, $value)
8384
*
8485
* Returns value for all readonly (protected) properties.
8586
*
86-
* @ignore This method is for internal use
87+
* @internal
8788
*
8889
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException exception on all reads to undefined properties so typos are not silently accepted.
8990
*
@@ -104,7 +105,7 @@ public function __get($property)
104105
*
105106
* Returns true for all (public/)protected/private properties.
106107
*
107-
* @ignore This method is for internal use
108+
* @internal
108109
*
109110
* @param string $property Name of the property
110111
*
@@ -118,12 +119,12 @@ public function __isset($property)
118119
/**
119120
* Magic unset function handling unset() to non public properties.
120121
*
121-
* @ignore This method is for internal use
122+
* @internal
122123
*
123124
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException exception on all writes to undefined properties so typos are not silently accepted and
124125
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\PropertyReadOnlyException exception on readonly (protected) properties.
125126
*
126-
* @uses ::__set()
127+
* @uses ValueObject::__set()
127128
*
128129
* @param string $property Name of the property
129130
*
@@ -144,7 +145,7 @@ public function __unset($property)
144145
* var_export() generates code, that calls this method when it
145146
* is parsed with PHP.
146147
*
147-
* @ignore This method is for internal use
148+
* @internal
148149
*
149150
* @param mixed[] $array
150151
*
@@ -158,11 +159,11 @@ public static function __set_state(array $array)
158159
/**
159160
* Internal function for Legacy template engine compatibility to get property value.
160161
*
161-
* @ignore This method is for internal use
162+
* @internal
162163
*
163164
* @deprecated Since 5.0, available purely for legacy eZTemplate compatibility
164165
*
165-
* @uses ::__get()
166+
* @uses ValueObject::__get()
166167
*
167168
* @param string $property
168169
*
@@ -176,11 +177,12 @@ final public function attribute($property)
176177
/**
177178
* Internal function for Legacy template engine compatibility to get properties.
178179
*
179-
* @ignore This method is for internal use
180+
* @internal
180181
*
181182
* @deprecated Since 5.0, available purely for legacy eZTemplate compatibility
182183
*
183-
* @uses ::__isset()
184+
* @uses ValueObject::getProperties()
185+
* @uses ValueObject::__isset()
184186
*
185187
* @return array
186188
*/
@@ -192,11 +194,11 @@ final public function attributes()
192194
/**
193195
* Internal function for Legacy template engine compatibility to check existence of property.
194196
*
195-
* @ignore This method is for internal use
197+
* @internal
196198
*
197199
* @deprecated Since 5.0, available purely for legacy eZTemplate compatibility
198200
*
199-
* @uses ::__isset()
201+
* @uses ValueObject::__isset()
200202
*
201203
* @param string $property
202204
*

0 commit comments

Comments
 (0)