| Conditions | 6 |
| Paths | 5 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | protected function check($ref, $visibility) |
||
| 19 | { |
||
| 20 | if (!$ref instanceof \ReflectionMethod && !$ref instanceof \ReflectionProperty) { |
||
| 21 | throw new \InvalidArgumentException('The reflection param passed should be an instance of ReflectionMethod or RelfectionProperty'); |
||
| 22 | } |
||
| 23 | |||
| 24 | switch($visibility){ |
||
| 25 | case Visibility::AS_PUBLIC: |
||
| 26 | return $ref->isPublic(); |
||
| 27 | case Visibility::AS_PROTECTED: |
||
| 28 | return $ref->isProtected(); |
||
| 29 | case Visibility::AS_PRIVATE: |
||
| 30 | return $ref->isPrivate(); |
||
| 31 | default: |
||
| 32 | ShouldException::invalidVisibilityType($visibility); |
||
| 33 | } |
||
| 34 | } |
||
| 35 | } |