MagicIssetClass.php 650 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace Doctrine\Tests\Common\Proxy;
  3. /**
  4. * Test asset class
  5. */
  6. class MagicIssetClass
  7. {
  8. /**
  9. * @var string
  10. */
  11. public $id = 'id';
  12. /**
  13. * @var string
  14. */
  15. public $publicField = 'publicField';
  16. /**
  17. * @param string $name
  18. *
  19. * @return bool
  20. * @throws \BadMethodCallException
  21. */
  22. public function __isset($name)
  23. {
  24. if ('test' === $name) {
  25. return true;
  26. }
  27. if ('publicField' === $name || 'id' === $name) {
  28. throw new \BadMethodCallException('Should never be called for "publicField" or "id"');
  29. }
  30. return false;
  31. }
  32. }