Debian Codegraph @

tests/phpunit/mocks/GhostFieldTestClass.php

raw symbols SCIP
1 <?php
2
3 namespace Wikimedia\Tests\Reflection;
4
5 use Wikimedia\Reflection\GhostFieldAccessTrait;
6 use Wikimedia\Reflection\GhostFieldTestClass as OldGhostFieldTestClass;
7
8 /**
9 * This class used to contain a $privateField, $protectedField and $publicField.
10 * This is used to test that unserialized instances still have the values of
11 * these ghost fields and the values can be accessed with GhostFieldAccessTrait.
12 *
13 */
14 #[\AllowDynamicProperties]
15 class GhostFieldTestClass {
16 use GhostFieldAccessTrait;
17
18 public function getPrivateField() {
19 return $this->getGhostFieldValue( 'privateField', OldGhostFieldTestClass::class );
20 }
21
22 public function getProtectedField() {
23 return $this->getGhostFieldValue( 'protectedField' );
24 }
25
26 public function getPublicField() {
27 return $this->getGhostFieldValue( 'publicField' );
28 }
29 }
30 // Do not delete this alias; it is needed for GhostFieldAccessTraitTest
31 class_alias( GhostFieldTestClass::class, 'Wikimedia\\Reflection\\GhostFieldTestClass' );