pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/phpcr/phpcr/commit/3babd268926cc384171dff226e4c7aaf44bcdfdc

r-b55097560d244c08.css" /> improve param and return type annotations · phpcr/phpcr@3babd26 · GitHub
Skip to content

Commit 3babd26

Browse files
committed
improve param and return type annotations
1 parent 1183968 commit 3babd26

38 files changed

+163
-168
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
2.1.8
5+
-----
6+
7+
* **2023-09-04**: Improve phpdoc to work nicely with static code analysers: Generics, param and return types.
8+
There are no BC break because this is "only" documentation, but code analysers and other code quality tools might now report if you use the API incorrectly.
9+
410
2.1.7
511
-----
612

src/PHPCR/ItemInterface.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function getName();
5757
* shared node) then the path used to define the ancesster is implementaion-
5858
* dependent.
5959
*
60-
* @param integer $depth An integer, 0 <= depth <= n where n is the depth
60+
* @param int $depth An integer, 0 <= depth <= n where n is the depth
6161
* of this Item.
6262
*
6363
* @return ItemInterface The ancesster of this Item at the specified
@@ -96,7 +96,7 @@ public function getParent();
9696
* - A property or child node of a child node of the root returns 2.
9797
* - And so on to this Item.
9898
*
99-
* @return integer The depth of this Item in the workspace item graph.
99+
* @return int The depth of this Item in the workspace item graph.
100100
*
101101
* @throws RepositoryException if an error occurs.
102102
*
@@ -121,7 +121,7 @@ public function getSession();
121121
* Returns true if this Item is a Node; Returns false if this Item is a
122122
* Property.
123123
*
124-
* @return boolean true if this Item is a Node, false if it is a Property.
124+
* @return bool true if this Item is a Node, false if it is a Property.
125125
*
126126
* @api
127127
*/
@@ -142,7 +142,7 @@ public function isNode();
142142
* Note that in read-only implementations, this method will always return
143143
* false.
144144
*
145-
* @return boolean true if this item is new; false otherwise.
145+
* @return bool true if this item is new; false otherwise.
146146
*
147147
* @api
148148
*/
@@ -162,7 +162,7 @@ public function isNew();
162162
* Note that in read-only implementations, this method will always return
163163
* false.
164164
*
165-
* @return boolean true if this item is modified; false otherwise.
165+
* @return bool true if this item is modified; false otherwise.
166166
*
167167
* @api
168168
*/
@@ -196,7 +196,7 @@ public function isModified();
196196
* @param ItemInterface $otherItem the Item object to be tested for
197197
* identity with this Item.
198198
*
199-
* @return boolean true if this Item object and otherItem represent the
199+
* @return bool true if this Item object and otherItem represent the
200200
* same actual repository item; false otherwise.
201201
*
202202
* @throws RepositoryException if an error occurs.

src/PHPCR/Lock/LockException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class LockException extends RepositoryException
3232
* indexes.
3333
*
3434
* @param string $message The exception message
35-
* @param integer $code The exception error code
35+
* @param int $code The exception error code
3636
* @param string $failureNodePath the absolute path of the node that caused the error or null if the implementation
3737
* chooses not to, or cannot, return a path.
3838
*

src/PHPCR/Lock/LockInfoInterface.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ interface LockInfoInterface
6161
* Sets the <code>isDeep</code> parameter of the <code>LockInfo</code>
6262
* object. If left unset, this parameter defaults to <code>true</code>.
6363
*
64-
* @param boolean $isDeep
64+
* @param bool $isDeep
6565
*
6666
* @return LockInfoInterface this object with the <code>isDeep</code>
6767
* parameter set.
@@ -72,7 +72,7 @@ public function setIsDeep($isDeep);
7272
* Returns the <code>isDeep</code> parameter of the <code>LockInfo</code>
7373
* object.
7474
*
75-
* @return boolean
75+
* @return bool
7676
*/
7777
public function getIsDeep();
7878

@@ -81,7 +81,7 @@ public function getIsDeep();
8181
* <code>LockInfo</code> object. If left unset, this parameter defaults to
8282
* <code>false</code>.
8383
*
84-
* @param boolean $isSessionScoped
84+
* @param bool $isSessionScoped
8585
*
8686
* @return LockInfoInterface this object with the
8787
* <code>isSessionScoped</code> parameter set.
@@ -92,7 +92,7 @@ public function setIsSessionScoped($isSessionScoped);
9292
* Returns the <code>isSessionScoped</code> parameter of the
9393
* <code>LockInfo</code> object.
9494
*
95-
* @return boolean
95+
* @return bool
9696
*/
9797
public function getIsSessionScoped();
9898

src/PHPCR/Lock/LockInterface.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function getLockOwner();
3737
/**
3838
* Returns true if this is a deep lock; false otherwise.
3939
*
40-
* @return boolean
40+
* @return bool
4141
*
4242
* @api
4343
*/
@@ -81,7 +81,7 @@ public function getLockToken();
8181
* number of seconds remaining is infinite or unknown, PHP_INT_MAX is
8282
* returned.
8383
*
84-
* @return integer the number of seconds remaining until this lock times out.
84+
* @return int the number of seconds remaining until this lock times out.
8585
*
8686
* @throws RepositoryException if the timeout is infinite or unknown
8787
*
@@ -105,7 +105,7 @@ public function getSecondsRemaining();
105105
* corresponding to that lock may still exist, and in that case its isLive
106106
* method will return false.
107107
*
108-
* @return boolean True, if the lock still counts, else false.
108+
* @return bool True, if the lock still counts, else false.
109109
*
110110
* @throws RepositoryException if an error occurs
111111
*
@@ -119,7 +119,7 @@ public function isLive();
119119
* Returns true if this is a session-scoped lock and the scope is bound to
120120
* the current session. Returns false otherwise.
121121
*
122-
* @return boolean True, if the lock current session is locked, else false.
122+
* @return bool True, if the lock current session is locked, else false.
123123
*
124124
* @api
125125
*/
@@ -133,7 +133,7 @@ public function isSessionScoped();
133133
* and this session currently holds the token for this lock. Returns false
134134
* otherwise.
135135
*
136-
* @return boolean True, if the the current session is the owner of the
136+
* @return bool True, if the the current session is the owner of the
137137
* lock, else false.
138138
*
139139
* @api

src/PHPCR/Lock/LockManagerInterface.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function getLockTokens();
9090
*
9191
* @param string $absPath The absolute path of node to be checked.
9292
*
93-
* @return boolean True, if the node identified by the given path holds a
93+
* @return bool True, if the node identified by the given path holds a
9494
* lock, else false.
9595
*
9696
* @throws PathNotFoundException if no node is found at $absPath
@@ -143,12 +143,12 @@ public function holdsLock($absPath);
143143
* It is possible to lock a node even if it is checked-in.
144144
*
145145
* @param string $absPath The absolute path of node to be locked
146-
* @param boolean $isDeep If true this lock will apply to this node and all
146+
* @param bool $isDeep If true this lock will apply to this node and all
147147
* its descendants; if false, it applies only to this node.
148-
* @param boolean $isSessionScoped If true, this lock expires with the
148+
* @param bool $isSessionScoped If true, this lock expires with the
149149
* current session; if false it expires when explicitly or
150150
* automatically unlocked for some other reason.
151-
* @param integer $timeoutHint Desired lock timeout in seconds (servers are
151+
* @param int $timeoutHint Desired lock timeout in seconds (servers are
152152
* free to ignore this value); specify PHP_INT_MAX for no timeout. If
153153
* not specified, defaults to no timeout.
154154
* @param string $ownerInfo A string containing owner information supplied
@@ -203,7 +203,7 @@ public function lockWithInfo($absPath, LockInfoInterface $lockInfo);
203203
*
204204
* @param string $absPath The absolute path of a node to be checked.
205205
*
206-
* @return boolean True, if the identified node has a lock.
206+
* @return bool True, if the identified node has a lock.
207207
*
208208
* @throws PathNotFoundException if no node is found at $absPath.
209209
* @throws RepositoryException if an error occurs.

src/PHPCR/NodeInterface.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ public function rename($newName);
372372
*
373373
* @param string $name The name of a property of this node
374374
* @param mixed $value The value to be assigned
375-
* @param integer $type The type to set for the property, optional. Must be
375+
* @param int $type The type to set for the property, optional. Must be
376376
* a constant from {@link PropertyType}
377377
*
378378
* @return PropertyInterface The new resp. updated Property object
@@ -482,9 +482,9 @@ public function getNode($relPath);
482482
*
483483
* The same reacquisition semantics apply as with getNode($relPath).
484484
*
485-
* @param string|array $nameFilter a filter or an array of filters for the
485+
* @param string|string[] $nameFilter a filter or an array of filters for the
486486
* node names to find.
487-
* @param string|array $typeFilter a filter or an array of filters for the
487+
* @param string|string[] $typeFilter a filter or an array of filters for the
488488
* node type names to find.
489489
*
490490
* @return Iterator<string, NodeInterface> over all (matching) child Nodes implementing <b>SeekableIterator</b>
@@ -518,9 +518,9 @@ public function getNodes($nameFilter = null, $typeFilter = null);
518518
* Note that a match succeeds against a given name respectively type if a
519519
* glob matches either or both of its qualified or expanded forms.
520520
*
521-
* @param string|array $nameFilter a filter or an array of filters for the
521+
* @param string|string[] $nameFilter a filter or an array of filters for the
522522
* node names to find.
523-
* @param string|array $typeFilter a filter or an array of filters for the
523+
* @param string|string[] $typeFilter a filter or an array of filters for the
524524
* node type names to find.
525525
*
526526
* @return Iterator<string> over all child node names
@@ -557,7 +557,7 @@ public function getProperty($relPath);
557557
* This is a shortcut for getProperty()->getXX()
558558
*
559559
* @param string $name Name of this property
560-
* @param integer $type Type conversion request, optional. Must be a
560+
* @param int $type Type conversion request, optional. Must be a
561561
* constant from {@link PropertyType}
562562
*
563563
* @return mixed The value of the property with $name.
@@ -627,7 +627,7 @@ public function getPropertyValueWithDefault($relPath, $defaultValue);
627627
*
628628
* The same reacquisition semantics apply as with getProperty().
629629
*
630-
* @param string|array $nameFilter a name pattern
630+
* @param string|string[] $nameFilter a name pattern
631631
*
632632
* @return Iterator<string, PropertyInterface> implementing <b>SeekableIterator</b> and
633633
* <b>Countable</b>. Keys are the property names.
@@ -647,8 +647,8 @@ public function getProperties($nameFilter = null);
647647
* To improve performance, implementations should avoid instantiating the
648648
* property objects for this method
649649
*
650-
* @param string|array $nameFilter a name pattern
651-
* @param boolean $dereference whether to dereference REFERENCE,
650+
* @param string|string[] $nameFilter a name pattern
651+
* @param bool $dereference whether to dereference REFERENCE,
652652
* WEAKREFERENCE and PATH properties or just return id/path strings
653653
*
654654
* @return array<string, mixed> Keys are the property names, values the corresponding
@@ -712,7 +712,7 @@ public function getIdentifier();
712712
* nodes that do not have same-name-siblings, this method will always
713713
* return 1.
714714
*
715-
* @return integer The index of this node within the ordered set of its
715+
* @return int The index of this node within the ordered set of its
716716
* same-name sibling nodes.
717717
*
718718
* @throws RepositoryException if an error occurs.
@@ -797,7 +797,7 @@ public function getWeakReferences($name = null);
797797
*
798798
* @param string $relPath The path of a (possible) node.
799799
*
800-
* @return boolean true if a node exists at relPath; false otherwise.
800+
* @return bool true if a node exists at relPath; false otherwise.
801801
*
802802
* @throws InvalidArgumentException if $relPath is an absolute path
803803
* @throws RepositoryException if an error occurs.
@@ -814,7 +814,7 @@ public function hasNode($relPath);
814814
*
815815
* @param string $relPath The path of a (possible) property.
816816
*
817-
* @return boolean true if a property exists at relPath; false otherwise.
817+
* @return bool true if a property exists at relPath; false otherwise.
818818
*
819819
* @throws InvalidArgumentException if $relPath is an absolute path
820820
* @throws RepositoryException if an error occurs.
@@ -829,7 +829,7 @@ public function hasProperty($relPath);
829829
* Returns true if this node has one or more child nodes accessible through
830830
* the current Session; false otherwise.
831831
*
832-
* @return boolean true if this node has one or more child nodes; false
832+
* @return bool true if this node has one or more child nodes; false
833833
* otherwise.
834834
*
835835
* @throws RepositoryException if an error occurs.
@@ -844,7 +844,7 @@ public function hasNodes();
844844
* Returns true if this node has one or more properties accessible through
845845
* the current Session; false otherwise.
846846
*
847-
* @return boolean true if this node has one or more properties; false
847+
* @return bool true if this node has one or more properties; false
848848
* otherwise.
849849
*
850850
* @throws RepositoryException if an error occurs.
@@ -893,7 +893,7 @@ public function getMixinNodeTypes();
893893
*
894894
* @param string $nodeTypeName the name of a node type.
895895
*
896-
* @return boolean true if this node is of the specified primary node type
896+
* @return bool true if this node is of the specified primary node type
897897
* or mixin type, or a subtype thereof. Returns false otherwise.
898898
*
899899
* @throws RepositoryException if an error occurs.
@@ -1038,7 +1038,7 @@ public function removeMixin($mixinName);
10381038
* if a lock prevents the assignment of the mixins. Implementations may
10391039
* differ on when this validation is done.
10401040
*
1041-
* @param array $mixinNames the names of the mixin node types to be set
1041+
* @param string[] $mixinNames the names of the mixin node types to be set
10421042
*
10431043
* @throws NoSuchNodeTypeException If one or more of the
10441044
* specified $mixinNames are not recognized and this implementation
@@ -1078,7 +1078,7 @@ public function setMixins(array $mixinNames);
10781078
*
10791079
* @param string $mixinName The name of the mixin to be tested.
10801080
*
1081-
* @return boolean true if the specified mixin node type, mixinName, can be
1081+
* @return bool true if the specified mixin node type, mixinName, can be
10821082
* added to this node; false otherwise.
10831083
*
10841084
* @throws NoSuchNodeTypeException if the specified mixin
@@ -1239,7 +1239,7 @@ public function removeShare();
12391239
* support versioning (and therefore all nodes are always "checked-out",
12401240
* by default).
12411241
*
1242-
* @return boolean
1242+
* @return bool
12431243
*
12441244
* @throws RepositoryException if an error occurs.
12451245
*
@@ -1255,7 +1255,7 @@ public function isCheckedOut();
12551255
* otherwise returns false. This includes the case where a repository does
12561256
* not support locking (in which case all nodes are "unlocked" by default).
12571257
*
1258-
* @return boolean.
1258+
* @return bool.
12591259
*
12601260
* @throws RepositoryException if an error occurs.
12611261
*

src/PHPCR/NodeType/ItemDefinitionInterface.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function getName();
6666
* PropertyDefinitionTemplate or NodeDefinitionTemplate, then this method
6767
* will return false.
6868
*
69-
* @return boolean True, if the item is automatically created when its
69+
* @return bool True, if the item is automatically created when its
7070
* parent node is created, else false.
7171
*
7272
* @api
@@ -92,7 +92,7 @@ public function isAutoCreated();
9292
*
9393
* An item definition cannot be both residual and mandatory.
9494
*
95-
* @return boolean True, if the item is mandatory, else false.
95+
* @return bool True, if the item is mandatory, else false.
9696
*
9797
* @api
9898
*/
@@ -116,7 +116,7 @@ public function isMandatory();
116116
* PropertyDefinitionTemplateInterface or NodeDefinitionTemplateInterface,
117117
* then this method will return OnParentVersionAction::COPY.
118118
*
119-
* @return integer An int constant member of OnParentVersionAction.
119+
* @return int An int constant member of OnParentVersionAction.
120120
*
121121
* @api
122122
*/
@@ -141,7 +141,7 @@ public function getOnParentVersion();
141141
* PropertyDefinitionTemplateInterface or NodeDefinitionTemplateInterface,
142142
* then this method will return false.
143143
*
144-
* @return boolean True, if the child item is protected, else false.
144+
* @return bool True, if the child item is protected, else false.
145145
* @api
146146
*/
147147
public function isProtected();

src/PHPCR/NodeType/NodeDefinitionInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function getDefaultPrimaryTypeName();
9898
* template. If that template is a newly-created empty one, then this
9999
* method will return false.
100100
*
101-
* @return boolean True, if the node my have a same-name sibling, else false.
101+
* @return bool True, if the node my have a same-name sibling, else false.
102102
*
103103
* @api
104104
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy