Deprecated: Creation of dynamic property Wikimedia\Reflection\GhostFieldTestClass::$privateField is deprecated in /workspace/src/tests/phpunit/includes/libs/serialization/SerializationTestUtils.php on line 150 Bug: T314099 Change-Id: Ic1cd7a3560e6fe39e6c7b077f42c90fbc844c202
26 lines
692 B
PHP
26 lines
692 B
PHP
<?php
|
|
|
|
namespace Wikimedia\Reflection;
|
|
|
|
/**
|
|
* This class used to contain a $privateField, $protectedField and $publicField.
|
|
* This is used to test that unserialized instances still have the values of
|
|
* these ghost fields and the values can be accessed with GhostFieldAccessTrait.
|
|
* @package Wikimedia\Reflection
|
|
*/
|
|
#[\AllowDynamicProperties]
|
|
class GhostFieldTestClass {
|
|
use GhostFieldAccessTrait;
|
|
|
|
public function getPrivateField() {
|
|
return $this->getGhostFieldValue( 'privateField' );
|
|
}
|
|
|
|
public function getProtectedField() {
|
|
return $this->getGhostFieldValue( 'protectedField' );
|
|
}
|
|
|
|
public function getPublicField() {
|
|
return $this->getGhostFieldValue( 'publicField' );
|
|
}
|
|
}
|