| Conditions | 5 |
| Paths | 4 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 14 | protected static function getVisibility(\Reflector $reflector): string |
|
| 19 | { |
||
| 20 | if ( |
||
| 21 | 14 | !$reflector instanceof \ReflectionMethod && |
|
| 22 | 14 | !$reflector instanceof \ReflectionProperty |
|
| 23 | ) { |
||
| 24 | 1 | throw new InvalidArgumentException( |
|
| 25 | 1 | sprintf( |
|
| 26 | 1 | 'Reflector must be an instance of "%s" or "%s"', |
|
| 27 | 1 | \ReflectionMethod::class, |
|
| 28 | 1 | \ReflectionProperty::class |
|
| 29 | ) |
||
| 30 | ); |
||
| 31 | } |
||
| 32 | |||
| 33 | 13 | foreach (['Public', 'Protected', 'Private'] as $visibility) { |
|
| 34 | 13 | if ($reflector->{'is' . $visibility}()) { |
|
| 35 | 13 | return strtolower($visibility); |
|
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | 1 | throw new \RuntimeException('Witness me!'); |
|
| 40 | } |
||
| 41 | } |
||
| 42 |