@@ 32-47 (lines=16) @@ | ||
29 | $this->_reflector = new \Nette\Reflection\ClassType($this->_class); |
|
30 | } |
|
31 | ||
32 | public function getClassOptions() |
|
33 | { |
|
34 | $annotation = $this->_reflector->getAnnotation('jobbers'); |
|
35 | ||
36 | if (!$annotation) { |
|
37 | return []; |
|
38 | } |
|
39 | ||
40 | foreach ($annotation as $option => $value) { |
|
41 | if (!in_array($option, self::ALLOWED_METHOD_OPTIONS)) { |
|
42 | throw new \Exception("option [$option] unknown"); |
|
43 | } |
|
44 | } |
|
45 | ||
46 | return (array)$annotation; |
|
47 | } |
|
48 | ||
49 | public function getMethodOptions($method) |
|
50 | { |
|
@@ 49-64 (lines=16) @@ | ||
46 | return (array)$annotation; |
|
47 | } |
|
48 | ||
49 | public function getMethodOptions($method) |
|
50 | { |
|
51 | $annotation = $this->_reflector->getMethod($method)->getAnnotation('jobbers'); |
|
52 | ||
53 | if (!$annotation) { |
|
54 | return []; |
|
55 | } |
|
56 | ||
57 | foreach ($annotation as $option => $value) { |
|
58 | if (!in_array($option, self::ALLOWED_METHOD_OPTIONS)) { |
|
59 | throw new \Exception("option [$option] unknown"); |
|
60 | } |
|
61 | } |
|
62 | ||
63 | return (array)$annotation; |
|
64 | } |
|
65 | ||
66 | } |