1: <?php
2:
3: 4: 5: 6:
7:
8: namespace Nette\Application\UI;
9:
10: use Nette;
11: use Nette\Reflection\Method;
12:
13:
14: 15: 16:
17: class MethodReflection extends \ReflectionMethod
18: {
19: use Nette\SmartObject;
20:
21: 22: 23: 24: 25:
26: public function hasAnnotation($name)
27: {
28: return (bool) ComponentReflection::parseAnnotation($this, $name);
29: }
30:
31:
32: 33: 34: 35: 36:
37: public function getAnnotation($name)
38: {
39: $res = ComponentReflection::parseAnnotation($this, $name);
40: return $res ? end($res) : null;
41: }
42:
43:
44: public function __toString()
45: {
46: trigger_error(__METHOD__ . ' is deprecated.', E_USER_DEPRECATED);
47: return parent::getDeclaringClass()->getName() . '::' . $this->getName() . '()';
48: }
49:
50:
51: public function __get($name)
52: {
53: trigger_error("getMethod('{$this->getName()}')->$name is deprecated.", E_USER_DEPRECATED);
54: return (new Method(parent::getDeclaringClass()->getName(), $this->getName()))->$name;
55: }
56:
57:
58: public function __call($name, $args)
59: {
60: trigger_error("getMethod('{$this->getName()}')->$name() is deprecated, use Nette\\Reflection\\Method::from(\$presenter, '{$this->getName()}')->$name()", E_USER_DEPRECATED);
61: return call_user_func_array([new Method(parent::getDeclaringClass()->getName(), $this->getName()), $name], $args);
62: }
63: }
64: