Skip to content

Commit

Permalink
Fix "creation of dynamic property" deprecation notices
Browse files Browse the repository at this point in the history
with PHP 8.2
  • Loading branch information
cweiske committed Jul 17, 2024
1 parent 4f401ab commit a59c579
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/OtherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ public function testUndefinedPropertyHandler()
new JsonMapperTest_Broken()
);

$this->assertSame(123, $sn->ADDundefinedProperty);
$this->assertSame(123, $sn->store['undefinedProperty']);
}

public function setUnknownProperty($object, $propName, $jsonValue)
{
$object->{'ADD' . $propName} = $jsonValue;
$object->store[$propName] = $jsonValue;
}

public function testPrivatePropertyWithPublicSetter()
Expand Down
2 changes: 2 additions & 0 deletions tests/support/JsonMapperTest/Broken.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ class JsonMapperTest_Broken
* @required
*/
public $pMissingData;

public $store;
}
?>
4 changes: 4 additions & 0 deletions tests/support/JsonMapperTest/Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class JsonMapperTest_Object
*/
public $pString;

public $nullableObject;

public $docblockNullableObject;

public function setNullableObject(JsonMapperTest_PlainObject $obj = null)
{
$this->nullableObject = $obj;
Expand Down
4 changes: 4 additions & 0 deletions tests/support/JsonMapperTest/PHP7Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

class JsonMapperTest_PHP7Object
{
public $nonNullableObject;

public $typeNullableObject;

public function setTypeNullableObject(?JsonMapperTest_PlainObject $obj)
{
$this->typeNullableObject = $obj;
Expand Down
2 changes: 2 additions & 0 deletions tests/support/JsonMapperTest/Simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*/
class JsonMapperTest_Simple
{
public $db;

/**
* @var bool
*/
Expand Down

0 comments on commit a59c579

Please sign in to comment.