1 | <?php |
||
21 | class File extends AbstractFileDecorator |
||
22 | { |
||
23 | /** |
||
24 | * Returns the position of the next specified token(s). |
||
25 | * |
||
26 | * If a value is specified, the next token of the specified type(s) |
||
27 | * containing the specified value will be returned. |
||
28 | * |
||
29 | * Returns false if no token can be found. |
||
30 | * |
||
31 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
||
32 | * |
||
33 | * @param array $types The type(s) of tokens to search for. |
||
34 | * @param int $start The position to start searching from in the token stack. |
||
35 | * @param int|null $end The end position to fail if no token is found. if not specified or null, end will default to the end of the token stack. |
||
36 | * @param bool $exclude If true, find the next token that is NOT of a type specified in $types. |
||
37 | * @param string|null $value The value that the token(s) must be equal to. If value is omitted, tokens with any value will be returned. |
||
38 | * @param bool $local If true, tokens outside the current statement will not be checked. i.e., checking will stop at the next semi-colon found. |
||
39 | * |
||
40 | * @return int Returns the pointer of the token or -1 |
||
41 | */ |
||
42 | public function findNext( |
||
54 | |||
55 | /** |
||
56 | * Returns the position of the previous specified token(s). |
||
57 | * |
||
58 | * If a value is specified, the previous token of the specified type(s) |
||
59 | 121 | * containing the specified value will be returned. |
|
60 | * |
||
61 | 121 | * Returns -1 if no token can be found. |
|
62 | * |
||
63 | 121 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
|
64 | 121 | * |
|
65 | 121 | * @param array $types The type(s) of tokens to search for. |
|
66 | * @param int $start The position to start searching from in the token stack. |
||
67 | * @param int|null $end The end position to fail if no token is found. if not specified or null, end will default to the start of the token stack. |
||
68 | 121 | * @param bool $exclude If true, find the previous token that are NOT of the types specified in $types. |
|
69 | * @param string|null $value The value that the token(s) must be equal to. If value is omitted, tokens with any value will be returned. |
||
70 | * @param bool $local If true, tokens outside the current statement will not be checked. IE. checking will stop at the previous semi-colon found. |
||
71 | * |
||
72 | * @return int Pointer to the found token |
||
73 | */ |
||
74 | public function findPrevious( |
||
86 | |||
87 | /** |
||
88 | * Returns the eol char of the file |
||
89 | * |
||
90 | 68 | * @return string Returns the EndOfLine-Character of the processed file |
|
91 | */ |
||
92 | public function getEolChar(): string |
||
96 | |||
97 | /** |
||
98 | 121 | * Returns the Wrapped PHP_CodeSniffer_Fixer |
|
99 | * |
||
100 | 121 | * @return Fixer Returns the fixer class. |
|
101 | */ |
||
102 | public function getFixer(): Fixer |
||
106 | |||
107 | /** |
||
108 | * Returns the token stack for this file. |
||
109 | * |
||
110 | * @return array Return array of token data |
||
111 | */ |
||
112 | public function getTokens(): array |
||
116 | |||
117 | /** |
||
118 | * Returns an integer even if the search in the code sniffer file returns a bool. |
||
119 | * |
||
120 | * @param int|bool $searchResult Pointer of a token or false. |
||
121 | * |
||
122 | * @return int The real Pointer or -1 when not found. |
||
123 | */ |
||
124 | public function harmonizeFindResult($searchResult): int |
||
128 | } |
||
129 |