1 | <?php |
||
16 | final class PropertyHelper |
||
17 | { |
||
18 | /** |
||
19 | * The wrapped PHP_CodeSniffer_File |
||
20 | * |
||
21 | * @var File |
||
22 | */ |
||
23 | private $file; |
||
24 | |||
25 | /** |
||
26 | * PropertyHelper constructor. |
||
27 | * |
||
28 | * @param File $file The wrapped PHP_CodeSniffer_File |
||
29 | 121 | */ |
|
30 | public function __construct(File $file) |
||
34 | |||
35 | /** |
||
36 | * Returns the names of the class' properties. |
||
37 | * |
||
38 | * @param array $classToken The token array for the class like structure. |
||
39 | * @param File|null $file The used file. If not given then the file from the construct is used. |
||
40 | * |
||
41 | 26 | * @return array The names of the properties. |
|
42 | */ |
||
43 | 26 | public function getProperties(array $classToken, ?File $file = null): array |
|
63 | |||
64 | /** |
||
65 | * Determines if the given variable is a property of a class. |
||
66 | * |
||
67 | * @param int $variablePtr Pointer to the current variable |
||
68 | * |
||
69 | * @return bool Indicator if the current T_VARIABLE is a property of a class |
||
70 | */ |
||
71 | public function isProperty(int $variablePtr): bool |
||
95 | } |
||
96 |