diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 12b7c32..d4712bc 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -12,18 +12,21 @@ ->phpCsFixer(true) ->php(7.4, true) ->pedrotroller(true) - ->enable('ordered_imports') - ->enable('ordered_interfaces') ->enable('align_multiline_comment') ->enable('array_indentation') - ->enable('no_superfluous_phpdoc_tags') - ->enable('simplified_null_return') ->enable('binary_operator_spaces', [ 'operators' => [ '=' => 'align_single_space_minimal', '=>' => 'align_single_space_minimal', ], ]) + ->enable('global_namespace_import', [ + 'import_classes' => true, 'import_constants' => false, 'import_functions' => false, + ]) + ->enable('no_superfluous_phpdoc_tags') + ->enable('ordered_imports') + ->enable('ordered_interfaces') + ->enable('simplified_null_return') ->disable('simplified_null_return') ->getRules() ) diff --git a/bin/doc b/bin/doc index 93f44af..8089d0a 100755 --- a/bin/doc +++ b/bin/doc @@ -18,8 +18,8 @@ $fixers = array_map(function (AbstractFixer $fixer) { $samples = $fixer->getDefinition()->getCodeSamples(); return [ - 'name' => $fixer->getName(), - 'doc' => [ + 'name' => $fixer->getName(), + 'doc' => [ 'summary' => $fixer->getDefinition()->getSummary(), ], 'deprecated' => $fixer->isDeprecated(), @@ -39,7 +39,7 @@ $fixers = array_map(function (AbstractFixer $fixer) { ? $fixer->getConfigurationDefinition()->getOptions() : [] ), - 'samples' => array_map(function (CodeSample $sample) use ($fixer) { + 'samples' => array_map(function (CodeSample $sample) use ($fixer) { if ($fixer instanceof ConfigurableFixerInterface) { $fixer->configure($sample->getConfiguration()); } diff --git a/composer.json b/composer.json index 9db60fd..387b6a0 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "license": "MIT", "require": { "php": "^7.4 || ^8.0", - "friendsofphp/php-cs-fixer": "^3.7" + "friendsofphp/php-cs-fixer": "^3.13" }, "require-dev": { "phpspec/phpspec": "^7.0", diff --git a/tests/TokensAnalyzerIntegration/MethodArguments.php b/tests/TokensAnalyzerIntegration/MethodArguments.php index d379637..a8ea0b7 100644 --- a/tests/TokensAnalyzerIntegration/MethodArguments.php +++ b/tests/TokensAnalyzerIntegration/MethodArguments.php @@ -66,7 +66,7 @@ public function assertions(TokensAnalyzer $analyzer, Tokens $tokens): void Assert::eq( $arguments, [ - ($theFunction + 5) => [ + ($theFunction + 5) => [ 'type' => 'Domain\\Model\\User', 'name' => '$user', 'nullable' => false,