Skip to content

Commit

Permalink
fix: Several improvements for fully_qualified_strict_types (respect…
Browse files Browse the repository at this point in the history
… declared symbols, relative imports, leading backslash in global namespace) (#7679)
  • Loading branch information
mvorisek committed Jan 9, 2024
1 parent 4a8c0f6 commit d2906cd
Show file tree
Hide file tree
Showing 6 changed files with 563 additions and 264 deletions.
7 changes: 5 additions & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
* with this source code in the file LICENSE.
*/

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$header = <<<'EOF'
This file is part of PHP CS Fixer.
Expand All @@ -22,14 +25,14 @@
with this source code in the file LICENSE.
EOF;

$finder = (new PhpCsFixer\Finder())
$finder = (new Finder())
->ignoreDotFiles(false)
->ignoreVCSIgnored(true)
->exclude(['dev-tools/phpstan', 'tests/Fixtures'])
->in(__DIR__)
;

return (new PhpCsFixer\Config())
return (new Config())
->setRiskyAllowed(true)
->setRules([
'@PHP74Migration' => true,
Expand Down
8 changes: 5 additions & 3 deletions dev-tools/info-extractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
* with this source code in the file LICENSE.
*/

use PhpCsFixer\Console\Application;

require_once __DIR__.'/../vendor/autoload.php';

$version = [
'number' => PhpCsFixer\Console\Application::VERSION,
'vnumber' => 'v'.PhpCsFixer\Console\Application::VERSION,
'codename' => PhpCsFixer\Console\Application::VERSION_CODENAME,
'number' => Application::VERSION,
'vnumber' => 'v'.Application::VERSION,
'codename' => Application::VERSION_CODENAME,
];

echo json_encode([
Expand Down
3 changes: 1 addition & 2 deletions src/Doctrine/Annotation/Tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

namespace PhpCsFixer\Doctrine\Annotation;

use PhpCsFixer\Doctrine\Annotation\Token as AnnotationToken;
use PhpCsFixer\Preg;
use PhpCsFixer\Tokenizer\Token as PhpToken;

Expand Down Expand Up @@ -103,7 +102,7 @@ public static function createFromDocComment(PhpToken $input, array $ignoredTags
$lastTokenEndIndex = 0;
foreach (\array_slice($scannedTokens, 0, $nbScannedTokensToUse) as $token) {
if ($token->isType(DocLexer::T_STRING)) {
$token = new AnnotationToken(
$token = new Token(
$token->getType(),
'"'.str_replace('"', '""', $token->getContent()).'"',
$token->getPosition()
Expand Down

0 comments on commit d2906cd

Please sign in to comment.