Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Several improvements for fully_qualified_strict_types (respect declared symbols, relative imports, leading backslash in global namespace) #7679

Merged
merged 27 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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