@@ -78,7 +78,7 @@ public function clear() {
7878 *
7979 * @return int Returns the count of matched elements.
8080 */
81- public function count () {
81+ public function count (): int {
8282 return count ($ this ->nodes );
8383 }
8484
@@ -94,7 +94,7 @@ public function count() {
9494// return $formatter->format($dom);
9595// }
9696
97- public function getIterator () {
97+ public function getIterator (): Traversable {
9898 return new ArrayIterator ($ this ->nodes );
9999 }
100100
@@ -118,15 +118,15 @@ public function html($value = null) {
118118 return $ this ;
119119 }
120120
121- public function offsetExists ($ offset ) {
121+ public function offsetExists ($ offset ): bool {
122122 return isset ($ this ->nodes [$ offset ]);
123123 }
124124
125- public function offsetGet ($ offset ) {
125+ public function offsetGet ($ offset ): mixed {
126126 return isset ($ this ->nodes [$ offset ]) ? $ this ->nodes [$ offset ] : null ;
127127 }
128128
129- public function offsetSet ($ offset , $ value ) {
129+ public function offsetSet ($ offset , $ value ): void {
130130
131131 if (is_null ($ offset ) || !isset ($ this ->nodes [$ offset ])) {
132132 throw new \BadMethodCallException ("You are not allowed to add new nodes to the pQuery object. " );
@@ -135,7 +135,7 @@ public function offsetSet($offset, $value) {
135135 }
136136 }
137137
138- public function offsetUnset ($ offset ) {
138+ public function offsetUnset ($ offset ): void {
139139 if (isset ($ this ->nodes [$ offset ])) {
140140 $ this ->nodes [$ offset ]->remove ();
141141 unset($ this ->nodes [$ offset ]);
0 commit comments