Skip to content

Commit

Permalink
Merge pull request #10536 from kthaler/simplexml-set-method
Browse files Browse the repository at this point in the history
Implement __set method in SimpleXMLElement stub
  • Loading branch information
orklah authored Jan 10, 2024
2 parents 17cd6a7 + 138b47a commit 26ae950
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
2 changes: 2 additions & 0 deletions stubs/extensions/simplexml.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class SimpleXMLElement implements Traversable, Countable
public function count(): int {}

public function __get(string $name): SimpleXMLElement|SimpleXMLIterator|null {}

public function __set(string $name, $value): void {}
}

/**
Expand Down
16 changes: 0 additions & 16 deletions tests/PropertyTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3825,22 +3825,6 @@ class A {
',
'error_message' => 'UndefinedPropertyAssignment',
],
'setPropertiesOfSimpleXMLElement1' => [
'code' => '<?php
$a = new SimpleXMLElement("<person><child role=\"son\"></child></person>");
$a->b = "c";
',
'error_message' => 'UndefinedPropertyAssignment',
],
'setPropertiesOfSimpleXMLElement2' => [
'code' => '<?php
$a = new SimpleXMLElement("<person><child role=\"son\"></child></person>");
if (isset($a->b)) {
$a->b = "c";
}
',
'error_message' => 'UndefinedPropertyAssignment',
],
];
}
}

0 comments on commit 26ae950

Please sign in to comment.