1 | <?php |
||
15 | class Fixer |
||
16 | { |
||
17 | /** |
||
18 | * The PHP_CodeSniffer_Fixer |
||
19 | * |
||
20 | * @var PHP_CodeSniffer_Fixer |
||
21 | */ |
||
22 | private $baseFixer; |
||
23 | |||
24 | /** |
||
25 | * The wrapped PHP_CodeSniffer_File |
||
26 | * |
||
27 | * @var File |
||
28 | */ |
||
29 | private $file; |
||
30 | |||
31 | /** |
||
32 | * Fixer constructor. |
||
33 | * |
||
34 | * @param File $file The wrapped PHP_CodeSniffer_File |
||
35 | * @param PHP_CodeSniffer_Fixer $baseFixer The PHP_CodeSniffer_Fixer |
||
36 | */ |
||
37 | 121 | public function __construct(File $file, PHP_CodeSniffer_Fixer $baseFixer) |
|
42 | |||
43 | /** |
||
44 | * Start recording actions for a changeset. |
||
45 | * |
||
46 | * @return void |
||
47 | */ |
||
48 | 33 | public function beginChangeset(): void |
|
52 | |||
53 | /** |
||
54 | * Replace the entire contents of a token. |
||
55 | * |
||
56 | * @param int $stackPtr The position of the token in the token stack. |
||
57 | * @param string $content The new content of the token. |
||
58 | * |
||
59 | * @return bool If the change was accepted. |
||
60 | */ |
||
61 | 8 | public function replaceToken(int $stackPtr, string $content): bool |
|
65 | |||
66 | /** |
||
67 | * Adds content to the start of a token's current content. |
||
68 | * |
||
69 | * @param int $stackPtr The position of the token in the token stack. |
||
70 | * @param string $content The content to add. |
||
71 | * |
||
72 | * @return bool If the change was accepted. |
||
73 | */ |
||
74 | 2 | public function addContentBefore(int $stackPtr, string $content): bool |
|
78 | |||
79 | /** |
||
80 | * Adds content to the end of a token's current content. |
||
81 | * |
||
82 | * @param int $stackPtr The position of the token in the token stack. |
||
83 | * @param string $content The content to add. |
||
84 | * |
||
85 | * @return bool If the change was accepted. |
||
86 | */ |
||
87 | 12 | public function addContent(int $stackPtr, string $content): bool |
|
91 | |||
92 | /** |
||
93 | * Stop recording actions for a changeset, and apply logged changes. |
||
94 | * |
||
95 | * @return bool Returns false if the changeset is in conflict |
||
96 | */ |
||
97 | 33 | public function endChangeset(): bool |
|
101 | |||
102 | /** |
||
103 | * Removes the given line. |
||
104 | * |
||
105 | * @param int $line The line which is to be removed |
||
106 | * |
||
107 | * @return void |
||
108 | */ |
||
109 | 16 | public function removeLine(int $line): void |
|
119 | |||
120 | /** |
||
121 | * Removes lines by given start and end. |
||
122 | * |
||
123 | * @param int $startLine The first line which is to be removed |
||
124 | * @param int $endLine The last line which is to be removed |
||
125 | * |
||
126 | * @return void |
||
127 | */ |
||
128 | 16 | public function removeLines(int $startLine, int $endLine): void |
|
134 | } |
||
135 |