| Conditions | 1 |
| Paths | 1 |
| Total Lines | 24 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 26 | public static function isProperty(PHP_CodeSniffer_File $file, $variablePtr) |
|
| 24 | { |
||
| 25 | 26 | $tokens = $file->getTokens(); |
|
| 26 | |||
| 27 | 26 | $propertyPointer = $file->findPrevious( |
|
| 28 | 26 | [T_STATIC, T_WHITESPACE, T_COMMENT], |
|
| 29 | 26 | $variablePtr - 1, |
|
| 30 | 26 | null, |
|
| 31 | 26 | true |
|
| 32 | ); |
||
| 33 | 26 | $propertyToken = $tokens[$propertyPointer]; |
|
| 34 | 26 | $propertyCode = $propertyToken['code']; |
|
| 35 | |||
| 36 | 26 | return in_array( |
|
| 37 | $propertyCode, |
||
| 38 | [ |
||
| 39 | 26 | T_PRIVATE, |
|
| 40 | 26 | T_PROTECTED, |
|
| 41 | 26 | T_PUBLIC, |
|
| 42 | 26 | T_VAR |
|
| 43 | ], |
||
| 44 | 26 | true |
|
| 45 | ); |
||
| 46 | } |
||
| 47 | } |
||
| 48 |