PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/www/libs/nette-dev/Reflection/ExtensionReflection.php

https://github.com/bazo/Mokuji
PHP | 107 lines | 44 code | 39 blank | 24 comment | 0 complexity | 575d2021c1dc5681ddd1cd9d2f900b29 MD5 | raw file
Possible License(s): BSD-3-Clause, MIT
  1. <?php
  2. /**
  3. * Nette Framework
  4. *
  5. * @copyright Copyright (c) 2004, 2010 David Grudl
  6. * @license http://nettephp.com/license Nette license
  7. * @link http://nettephp.com
  8. * @category Nette
  9. * @package Nette\Reflection
  10. */
  11. /**
  12. * Reports information about a extension.
  13. *
  14. * @copyright Copyright (c) 2004, 2010 David Grudl
  15. * @package Nette\Reflection
  16. */
  17. class ExtensionReflection extends ReflectionExtension
  18. {
  19. public function __toString()
  20. {
  21. return 'Extension ' . $this->getName();
  22. }
  23. /********************* Reflection layer ****************d*g**/
  24. /**
  25. * @return ExtensionReflection
  26. * @ignore internal
  27. */
  28. public static function import(ReflectionExtension $ref)
  29. {
  30. return new self($ref->getName());
  31. }
  32. public function getClasses()
  33. {
  34. return array_map(array('ClassReflection', 'import'), parent::getClasses());
  35. }
  36. public function getFunctions()
  37. {
  38. return array_map(array('FunctionReflection', 'import'), parent::getFunctions());
  39. }
  40. /********************* Nette\Object behaviour ****************d*g**/
  41. /**
  42. * @return ClassReflection
  43. */
  44. public function getReflection()
  45. {
  46. return new ClassReflection($this);
  47. }
  48. public function __call($name, $args)
  49. {
  50. return ObjectMixin::call($this, $name, $args);
  51. }
  52. public function &__get($name)
  53. {
  54. return ObjectMixin::get($this, $name);
  55. }
  56. public function __set($name, $value)
  57. {
  58. return ObjectMixin::set($this, $name, $value);
  59. }
  60. public function __isset($name)
  61. {
  62. return ObjectMixin::has($this, $name);
  63. }
  64. public function __unset($name)
  65. {
  66. throw new MemberAccessException("Cannot unset the property {$this->reflection->name}::\$$name.");
  67. }
  68. }