Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tburry/pquery",
"name": "guyavatrade/pquery",
"type": "library",
"description": "A jQuery like html dom parser written in php.",
"description": "A jQuery like html dom parser written in php. This fork add fixes for php 8.1",
"keywords": ["php", "dom", "ganon"],
"license": "LGPL-2.1",
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion gan_node_html.php
Original file line number Diff line number Diff line change
Expand Up @@ -2352,7 +2352,7 @@ public function before($content) {
return $this;
}

public function count() {
public function count(): int{
return 1;
}

Expand Down
12 changes: 6 additions & 6 deletions pQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function clear() {
*
* @return int Returns the count of matched elements.
*/
public function count() {
public function count(): int {
return count($this->nodes);
}

Expand All @@ -94,7 +94,7 @@ public function count() {
// return $formatter->format($dom);
// }

public function getIterator() {
public function getIterator(): Traversable {
return new ArrayIterator($this->nodes);
}

Expand All @@ -118,15 +118,15 @@ public function html($value = null) {
return $this;
}

public function offsetExists($offset) {
public function offsetExists($offset): bool {
return isset($this->nodes[$offset]);
}

public function offsetGet($offset) {
public function offsetGet($offset): mixed {
return isset($this->nodes[$offset]) ? $this->nodes[$offset] : null;
}

public function offsetSet($offset, $value) {
public function offsetSet($offset, $value): void {

if (is_null($offset) || !isset($this->nodes[$offset])) {
throw new \BadMethodCallException("You are not allowed to add new nodes to the pQuery object.");
Expand All @@ -135,7 +135,7 @@ public function offsetSet($offset, $value) {
}
}

public function offsetUnset($offset) {
public function offsetUnset($offset): void {
if (isset($this->nodes[$offset])) {
$this->nodes[$offset]->remove();
unset($this->nodes[$offset]);
Expand Down