This repository has been archived on 2025-08-22. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dumbo/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicSetClass.php
2014-11-25 16:42:40 +01:00

44 rivejä
765 B
PHP

<?php
namespace Doctrine\Tests\Common\Proxy;
/**
* Test asset class
*/
class MagicSetClass
{
/**
* @var string
*/
public $id = 'id';
/**
* @var string
*/
public $publicField = 'publicField';
/**
* @var string|null
*/
public $testAttribute;
/**
* @param string $name
* @param mixed $value
*
* @throws \BadMethodCallException
*/
public function __set($name, $value)
{
if ($name === 'test') {
$this->testAttribute = $value;
}
if ($name === 'publicField' || $name === 'id') {
throw new \BadMethodCallException('Should never be called for "publicField" or "id"');
}
$this->testAttribute = $value;
}
}