- The
checkstyle
andjunit
reporter now try to use absolute path rather than relative path. - In debug mode, the report now contains both the identifier and the message of the error.
- The position of
TrailingCommaMultiLineRule
error changed. - The position of
TrailingCommaSingleLineRule
error changed. TwigCsFixer\Command\TwigCsFixerCommand
class moved toTwigCsFixer\Console\Command
folder.TwigCsFixer\Report\Reporter\ReporterInterface
now require agetName
method.
If you never implemented a custom rule, nothing else changed. Otherwise, ...
- $this->isTokenMatching($token, $type, $value)
+ $token->isTokenMatching($type, $value)
- $this->findNext($type, $tokens, $start)
+ $tokens->findNext($type, $start)
- $this->findNext($type, $tokens, $start, true)
+ $tokens->findNext($type, $start, null, true)
- $this->findPrevious($type, $tokens, $start)
+ $tokens->findPrevious($type, $start)
- $this->findPrevious($type, $tokens, $start, true)
+ $tokens->findPrevious($type, $start, null, true)
- protected function process(int $tokenPosition, array $tokens): void;
+ protected function process(int $tokenIndex, Tokens $tokens): ?int;
- protected function getSpaceAfter(int $tokenPosition, array $tokens): ?int;
+ protected function getSpaceAfter(int $tokenIndex, Tokens $tokens): ?int;
- protected function getSpaceBefore(int $tokenPosition, array $tokens): ?int;
+ protected function getSpaceBefore(int $tokenIndex, Tokens $tokens): ?int;
- public function lintFile(array $tokens, Report $report, array $ignoredViolations = []): void;
+ public function lintFile(Tokens $tokens, Report $report): void;
- public function fixFile(array $tokens, FixerInterface $fixer, array $ignoredViolations = []): void;
+ public function fixFile(Tokens $tokens, FixerInterface $fixer): void;
- /**
- * @return array{list<Token>, list<ViolationId>}
- */
- public function tokenize(Source $source): array;
+ public function tokenize(Source $source): Tokens;
The Token::NAME_TYPE
has been split in four:
Token::FILTER_NAME_TYPE
Token::FUNCTION_NAME_TYPE
Token::TEST_NAME_TYPE
Token::NAME_TYPE
- $token->getPosition();
+ $token->getLinePosition();
- (new Directory($dir))->getRelativePathTo($file);
+ FileHelper::getRelativePath($file, $dir);