v1.0 Initial commit of project
This commit is contained in:
17
vendor/symfony/property-access/Tests/Fixtures/ExtendedUninitializedProperty.php
vendored
Normal file
17
vendor/symfony/property-access/Tests/Fixtures/ExtendedUninitializedProperty.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
class ExtendedUninitializedProperty extends UninitializedProperty
|
||||
{
|
||||
|
||||
}
|
||||
81
vendor/symfony/property-access/Tests/Fixtures/NonTraversableArrayObject.php
vendored
Normal file
81
vendor/symfony/property-access/Tests/Fixtures/NonTraversableArrayObject.php
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
/**
|
||||
* This class is a hand written simplified version of PHP native `ArrayObject`
|
||||
* class, to show that it behaves differently than the PHP native implementation.
|
||||
*/
|
||||
class NonTraversableArrayObject implements \ArrayAccess, \Countable, \Serializable
|
||||
{
|
||||
private $array;
|
||||
|
||||
public function __construct(?array $array = null)
|
||||
{
|
||||
$this->array = $array ?: [];
|
||||
}
|
||||
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return \array_key_exists($offset, $this->array);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return $this->array[$offset];
|
||||
}
|
||||
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (null === $offset) {
|
||||
$this->array[] = $value;
|
||||
} else {
|
||||
$this->array[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->array[$offset]);
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return \count($this->array);
|
||||
}
|
||||
|
||||
public function __serialize(): array
|
||||
{
|
||||
return $this->array;
|
||||
}
|
||||
|
||||
public function serialize(): string
|
||||
{
|
||||
return serialize($this->__serialize());
|
||||
}
|
||||
|
||||
public function __unserialize(array $data): void
|
||||
{
|
||||
$this->array = $data;
|
||||
}
|
||||
|
||||
public function unserialize($serialized): void
|
||||
{
|
||||
$this->__unserialize((array) unserialize((string) $serialized));
|
||||
}
|
||||
}
|
||||
36
vendor/symfony/property-access/Tests/Fixtures/ReturnTyped.php
vendored
Normal file
36
vendor/symfony/property-access/Tests/Fixtures/ReturnTyped.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
/**
|
||||
* @author Kévin Dunglas <dunglas@gmail.com>
|
||||
*/
|
||||
class ReturnTyped
|
||||
{
|
||||
public function getFoos(): array
|
||||
{
|
||||
return 'It doesn\'t respect the return type on purpose';
|
||||
}
|
||||
|
||||
public function addFoo(\DateTime $dateTime)
|
||||
{
|
||||
}
|
||||
|
||||
public function removeFoo(\DateTime $dateTime)
|
||||
{
|
||||
}
|
||||
|
||||
public function setName($name): self
|
||||
{
|
||||
return 'This does not respect the return type on purpose.';
|
||||
}
|
||||
}
|
||||
27
vendor/symfony/property-access/Tests/Fixtures/TestAdderRemoverInvalidArgumentLength.php
vendored
Normal file
27
vendor/symfony/property-access/Tests/Fixtures/TestAdderRemoverInvalidArgumentLength.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
class TestAdderRemoverInvalidArgumentLength
|
||||
{
|
||||
public function addFoo()
|
||||
{
|
||||
}
|
||||
|
||||
public function removeFoo($var1, $var2)
|
||||
{
|
||||
}
|
||||
|
||||
public function setBar($var1, $var2)
|
||||
{
|
||||
}
|
||||
}
|
||||
23
vendor/symfony/property-access/Tests/Fixtures/TestAdderRemoverInvalidMethods.php
vendored
Normal file
23
vendor/symfony/property-access/Tests/Fixtures/TestAdderRemoverInvalidMethods.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
class TestAdderRemoverInvalidMethods
|
||||
{
|
||||
public function addFoo($foo)
|
||||
{
|
||||
}
|
||||
|
||||
public function removeBar($foo)
|
||||
{
|
||||
}
|
||||
}
|
||||
204
vendor/symfony/property-access/Tests/Fixtures/TestClass.php
vendored
Normal file
204
vendor/symfony/property-access/Tests/Fixtures/TestClass.php
vendored
Normal file
@@ -0,0 +1,204 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
class TestClass
|
||||
{
|
||||
public $publicProperty;
|
||||
protected $protectedProperty;
|
||||
private $privateProperty;
|
||||
|
||||
private $publicAccessor;
|
||||
private $publicMethodAccessor;
|
||||
private $publicGetSetter;
|
||||
private $publicAccessorWithDefaultValue;
|
||||
private $publicAccessorWithRequiredAndDefaultValue;
|
||||
private $publicAccessorWithMoreRequiredParameters;
|
||||
private $publicIsAccessor;
|
||||
private $publicHasAccessor;
|
||||
private $publicCanAccessor;
|
||||
private $publicGetter;
|
||||
private $date;
|
||||
|
||||
public function __construct($value)
|
||||
{
|
||||
$this->publicProperty = $value;
|
||||
$this->publicAccessor = $value;
|
||||
$this->publicMethodAccessor = $value;
|
||||
$this->publicGetSetter = $value;
|
||||
$this->publicAccessorWithDefaultValue = $value;
|
||||
$this->publicAccessorWithRequiredAndDefaultValue = $value;
|
||||
$this->publicAccessorWithMoreRequiredParameters = $value;
|
||||
$this->publicIsAccessor = $value;
|
||||
$this->publicHasAccessor = $value;
|
||||
$this->publicCanAccessor = $value;
|
||||
$this->publicGetter = $value;
|
||||
}
|
||||
|
||||
public function setPublicAccessor($value)
|
||||
{
|
||||
$this->publicAccessor = $value;
|
||||
}
|
||||
|
||||
public function setPublicAccessorWithDefaultValue($value = null)
|
||||
{
|
||||
$this->publicAccessorWithDefaultValue = $value;
|
||||
}
|
||||
|
||||
public function setPublicAccessorWithRequiredAndDefaultValue($value, $optional = null)
|
||||
{
|
||||
$this->publicAccessorWithRequiredAndDefaultValue = $value;
|
||||
}
|
||||
|
||||
public function setPublicAccessorWithMoreRequiredParameters($value, $needed)
|
||||
{
|
||||
$this->publicAccessorWithMoreRequiredParameters = $value;
|
||||
}
|
||||
|
||||
public function getPublicAccessor()
|
||||
{
|
||||
return $this->publicAccessor;
|
||||
}
|
||||
|
||||
public function isPublicAccessor($param)
|
||||
{
|
||||
throw new \LogicException('This method should never have been called.');
|
||||
}
|
||||
|
||||
public function getPublicAccessorWithDefaultValue()
|
||||
{
|
||||
return $this->publicAccessorWithDefaultValue;
|
||||
}
|
||||
|
||||
public function getPublicAccessorWithRequiredAndDefaultValue()
|
||||
{
|
||||
return $this->publicAccessorWithRequiredAndDefaultValue;
|
||||
}
|
||||
|
||||
public function getPublicAccessorWithMoreRequiredParameters()
|
||||
{
|
||||
return $this->publicAccessorWithMoreRequiredParameters;
|
||||
}
|
||||
|
||||
public function setPublicIsAccessor($value)
|
||||
{
|
||||
$this->publicIsAccessor = $value;
|
||||
}
|
||||
|
||||
public function isPublicIsAccessor()
|
||||
{
|
||||
return $this->publicIsAccessor;
|
||||
}
|
||||
|
||||
public function setPublicHasAccessor($value)
|
||||
{
|
||||
$this->publicHasAccessor = $value;
|
||||
}
|
||||
|
||||
public function hasPublicHasAccessor()
|
||||
{
|
||||
return $this->publicHasAccessor;
|
||||
}
|
||||
|
||||
public function setPublicCanAccessor($value)
|
||||
{
|
||||
$this->publicCanAccessor = $value;
|
||||
}
|
||||
|
||||
public function canPublicCanAccessor()
|
||||
{
|
||||
return $this->publicCanAccessor;
|
||||
}
|
||||
|
||||
public function publicGetSetter($value = null)
|
||||
{
|
||||
if (null !== $value) {
|
||||
$this->publicGetSetter = $value;
|
||||
}
|
||||
|
||||
return $this->publicGetSetter;
|
||||
}
|
||||
|
||||
public function getPublicMethodMutator()
|
||||
{
|
||||
return $this->publicGetSetter;
|
||||
}
|
||||
|
||||
protected function setProtectedAccessor($value)
|
||||
{
|
||||
}
|
||||
|
||||
protected function getProtectedAccessor()
|
||||
{
|
||||
return 'foobar';
|
||||
}
|
||||
|
||||
protected function setProtectedIsAccessor($value)
|
||||
{
|
||||
}
|
||||
|
||||
protected function isProtectedIsAccessor()
|
||||
{
|
||||
return 'foobar';
|
||||
}
|
||||
|
||||
protected function setProtectedHasAccessor($value)
|
||||
{
|
||||
}
|
||||
|
||||
protected function hasProtectedHasAccessor()
|
||||
{
|
||||
return 'foobar';
|
||||
}
|
||||
|
||||
private function setPrivateAccessor($value)
|
||||
{
|
||||
}
|
||||
|
||||
private function getPrivateAccessor()
|
||||
{
|
||||
return 'foobar';
|
||||
}
|
||||
|
||||
private function setPrivateIsAccessor($value)
|
||||
{
|
||||
}
|
||||
|
||||
private function isPrivateIsAccessor()
|
||||
{
|
||||
return 'foobar';
|
||||
}
|
||||
|
||||
private function setPrivateHasAccessor($value)
|
||||
{
|
||||
}
|
||||
|
||||
private function hasPrivateHasAccessor()
|
||||
{
|
||||
return 'foobar';
|
||||
}
|
||||
|
||||
public function getPublicGetter()
|
||||
{
|
||||
return $this->publicGetter;
|
||||
}
|
||||
|
||||
public function setDate(\DateTimeInterface $date)
|
||||
{
|
||||
$this->date = $date;
|
||||
}
|
||||
|
||||
public function getDate()
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
}
|
||||
27
vendor/symfony/property-access/Tests/Fixtures/TestClassIsWritable.php
vendored
Normal file
27
vendor/symfony/property-access/Tests/Fixtures/TestClassIsWritable.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
class TestClassIsWritable
|
||||
{
|
||||
protected $value;
|
||||
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function __construct($value)
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
}
|
||||
39
vendor/symfony/property-access/Tests/Fixtures/TestClassMagicCall.php
vendored
Normal file
39
vendor/symfony/property-access/Tests/Fixtures/TestClassMagicCall.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
class TestClassMagicCall
|
||||
{
|
||||
private $magicCallProperty;
|
||||
|
||||
public function __construct($value)
|
||||
{
|
||||
$this->magicCallProperty = $value;
|
||||
}
|
||||
|
||||
public function __call(string $method, array $args)
|
||||
{
|
||||
if ('getMagicCallProperty' === $method) {
|
||||
return $this->magicCallProperty;
|
||||
}
|
||||
|
||||
if ('getConstantMagicCallProperty' === $method) {
|
||||
return 'constant value';
|
||||
}
|
||||
|
||||
if ('setMagicCallProperty' === $method) {
|
||||
$this->magicCallProperty = reset($args);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
42
vendor/symfony/property-access/Tests/Fixtures/TestClassMagicGet.php
vendored
Normal file
42
vendor/symfony/property-access/Tests/Fixtures/TestClassMagicGet.php
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
class TestClassMagicGet
|
||||
{
|
||||
private $magicProperty;
|
||||
|
||||
public $publicProperty;
|
||||
|
||||
public function __construct($value)
|
||||
{
|
||||
$this->magicProperty = $value;
|
||||
}
|
||||
|
||||
public function __set(string $property, $value)
|
||||
{
|
||||
if ('magicProperty' === $property) {
|
||||
$this->magicProperty = $value;
|
||||
}
|
||||
}
|
||||
|
||||
public function __get(string $property)
|
||||
{
|
||||
if ('magicProperty' === $property) {
|
||||
return $this->magicProperty;
|
||||
}
|
||||
|
||||
if ('constantMagicProperty' === $property) {
|
||||
return 'constant value';
|
||||
}
|
||||
}
|
||||
}
|
||||
36
vendor/symfony/property-access/Tests/Fixtures/TestClassSetValue.php
vendored
Normal file
36
vendor/symfony/property-access/Tests/Fixtures/TestClassSetValue.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
class TestClassSetValue
|
||||
{
|
||||
protected $value;
|
||||
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
public function __construct($value)
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
private function setFoo()
|
||||
{
|
||||
}
|
||||
}
|
||||
28
vendor/symfony/property-access/Tests/Fixtures/TestClassTypeErrorInsideCall.php
vendored
Normal file
28
vendor/symfony/property-access/Tests/Fixtures/TestClassTypeErrorInsideCall.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
class TestClassTypeErrorInsideCall
|
||||
{
|
||||
public function expectsDateTime(\DateTime $date)
|
||||
{
|
||||
}
|
||||
|
||||
public function getProperty()
|
||||
{
|
||||
}
|
||||
|
||||
public function setProperty($property)
|
||||
{
|
||||
$this->expectsDateTime(null); // throws TypeError
|
||||
}
|
||||
}
|
||||
17
vendor/symfony/property-access/Tests/Fixtures/TestClassTypedProperty.php
vendored
Normal file
17
vendor/symfony/property-access/Tests/Fixtures/TestClassTypedProperty.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
class TestClassTypedProperty
|
||||
{
|
||||
public float $publicProperty;
|
||||
}
|
||||
21
vendor/symfony/property-access/Tests/Fixtures/TestPublicPropertyDynamicallyCreated.php
vendored
Normal file
21
vendor/symfony/property-access/Tests/Fixtures/TestPublicPropertyDynamicallyCreated.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
#[\AllowDynamicProperties]
|
||||
class TestPublicPropertyDynamicallyCreated
|
||||
{
|
||||
public function __construct(string $bar)
|
||||
{
|
||||
$this->foo = $bar;
|
||||
}
|
||||
}
|
||||
18
vendor/symfony/property-access/Tests/Fixtures/TestPublicPropertyGetterOnObject.php
vendored
Normal file
18
vendor/symfony/property-access/Tests/Fixtures/TestPublicPropertyGetterOnObject.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
class TestPublicPropertyGetterOnObject
|
||||
{
|
||||
public $a = 'A';
|
||||
private $b = 'B';
|
||||
}
|
||||
25
vendor/symfony/property-access/Tests/Fixtures/TestPublicPropertyGetterOnObjectMagicGet.php
vendored
Normal file
25
vendor/symfony/property-access/Tests/Fixtures/TestPublicPropertyGetterOnObjectMagicGet.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
class TestPublicPropertyGetterOnObjectMagicGet
|
||||
{
|
||||
public $a = 'A';
|
||||
private $b = 'B';
|
||||
|
||||
public function __get($property)
|
||||
{
|
||||
if ('b' === $property) {
|
||||
return $this->b;
|
||||
}
|
||||
}
|
||||
}
|
||||
50
vendor/symfony/property-access/Tests/Fixtures/TestSingularAndPluralProps.php
vendored
Normal file
50
vendor/symfony/property-access/Tests/Fixtures/TestSingularAndPluralProps.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
/**
|
||||
* Notice we don't have getter/setter for emails
|
||||
* because we count on adder/remover.
|
||||
*/
|
||||
class TestSingularAndPluralProps
|
||||
{
|
||||
/** @var string|null */
|
||||
private $email;
|
||||
|
||||
/** @var array */
|
||||
private $emails = [];
|
||||
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail(?string $email)
|
||||
{
|
||||
$this->email = $email;
|
||||
}
|
||||
|
||||
public function getEmails(): array
|
||||
{
|
||||
return $this->emails;
|
||||
}
|
||||
|
||||
public function addEmail(string $email)
|
||||
{
|
||||
$this->emails[] = $email;
|
||||
}
|
||||
|
||||
public function removeEmail(string $email)
|
||||
{
|
||||
$this->emails = array_diff($this->emails, [$email]);
|
||||
}
|
||||
}
|
||||
31
vendor/symfony/property-access/Tests/Fixtures/Ticket5775Object.php
vendored
Normal file
31
vendor/symfony/property-access/Tests/Fixtures/Ticket5775Object.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
class Ticket5775Object
|
||||
{
|
||||
private $property;
|
||||
|
||||
public function getProperty()
|
||||
{
|
||||
return $this->property;
|
||||
}
|
||||
|
||||
private function setProperty()
|
||||
{
|
||||
}
|
||||
|
||||
public function __set(string $property, $value)
|
||||
{
|
||||
$this->$property = $value;
|
||||
}
|
||||
}
|
||||
86
vendor/symfony/property-access/Tests/Fixtures/TraversableArrayObject.php
vendored
Normal file
86
vendor/symfony/property-access/Tests/Fixtures/TraversableArrayObject.php
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
/**
|
||||
* This class is a hand written simplified version of PHP native `ArrayObject`
|
||||
* class, to show that it behaves differently than the PHP native implementation.
|
||||
*/
|
||||
class TraversableArrayObject implements \ArrayAccess, \IteratorAggregate, \Countable, \Serializable
|
||||
{
|
||||
private $array;
|
||||
|
||||
public function __construct(?array $array = null)
|
||||
{
|
||||
$this->array = $array ?: [];
|
||||
}
|
||||
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return \array_key_exists($offset, $this->array);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return $this->array[$offset];
|
||||
}
|
||||
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (null === $offset) {
|
||||
$this->array[] = $value;
|
||||
} else {
|
||||
$this->array[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->array[$offset]);
|
||||
}
|
||||
|
||||
public function getIterator(): \Traversable
|
||||
{
|
||||
return new \ArrayIterator($this->array);
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return \count($this->array);
|
||||
}
|
||||
|
||||
public function __serialize(): array
|
||||
{
|
||||
return $this->array;
|
||||
}
|
||||
|
||||
public function serialize(): string
|
||||
{
|
||||
return serialize($this->__serialize());
|
||||
}
|
||||
|
||||
public function __unserialize(array $data): void
|
||||
{
|
||||
$this->array = $data;
|
||||
}
|
||||
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
$this->__unserialize((array) unserialize((string) $serialized));
|
||||
}
|
||||
}
|
||||
45
vendor/symfony/property-access/Tests/Fixtures/TypeHinted.php
vendored
Normal file
45
vendor/symfony/property-access/Tests/Fixtures/TypeHinted.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
/**
|
||||
* @author Kévin Dunglas <dunglas@gmail.com>
|
||||
*/
|
||||
class TypeHinted
|
||||
{
|
||||
private $date;
|
||||
|
||||
/**
|
||||
* @var \Countable
|
||||
*/
|
||||
private $countable;
|
||||
|
||||
public function setDate(\DateTime $date)
|
||||
{
|
||||
$this->date = $date;
|
||||
}
|
||||
|
||||
public function getDate()
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
public function getCountable(): \Countable
|
||||
{
|
||||
return $this->countable;
|
||||
}
|
||||
|
||||
public function setCountable(\Countable $countable)
|
||||
{
|
||||
$this->countable = $countable;
|
||||
}
|
||||
}
|
||||
22
vendor/symfony/property-access/Tests/Fixtures/UninitializedPrivateProperty.php
vendored
Normal file
22
vendor/symfony/property-access/Tests/Fixtures/UninitializedPrivateProperty.php
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
class UninitializedPrivateProperty
|
||||
{
|
||||
private $uninitialized;
|
||||
|
||||
public function getUninitialized(): array
|
||||
{
|
||||
return $this->uninitialized;
|
||||
}
|
||||
}
|
||||
28
vendor/symfony/property-access/Tests/Fixtures/UninitializedProperty.php
vendored
Normal file
28
vendor/symfony/property-access/Tests/Fixtures/UninitializedProperty.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||
|
||||
class UninitializedProperty
|
||||
{
|
||||
public string $uninitialized;
|
||||
private string $privateUninitialized;
|
||||
|
||||
public function getPrivateUninitialized(): string
|
||||
{
|
||||
return $this->privateUninitialized;
|
||||
}
|
||||
|
||||
public function setPrivateUninitialized(string $privateUninitialized): void
|
||||
{
|
||||
$this->privateUninitialized = $privateUninitialized;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user