Conditions | 1 |
Paths | 1 |
Total Lines | 24 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 16 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
41 | 26 | public function isProperty(int $variablePtr): bool |
|
42 | { |
||
43 | 26 | $tokens = $this->file->getTokens(); |
|
44 | |||
45 | 26 | $propertyPointer = $this->file->findPrevious( |
|
46 | 26 | [T_STATIC, T_WHITESPACE, T_COMMENT], |
|
47 | 26 | $variablePtr - 1, |
|
48 | 26 | null, |
|
49 | 26 | true |
|
50 | ); |
||
51 | 26 | $propertyToken = $tokens[$propertyPointer]; |
|
52 | 26 | $propertyCode = $propertyToken['code']; |
|
53 | |||
54 | 26 | return in_array( |
|
55 | 26 | $propertyCode, |
|
56 | [ |
||
57 | 26 | T_PRIVATE, |
|
58 | 26 | T_PROTECTED, |
|
59 | 26 | T_PUBLIC, |
|
60 | 26 | T_VAR |
|
61 | ], |
||
62 | 26 | true |
|
63 | ); |
||
64 | } |
||
65 | } |
||
66 |