diff --git a/.github/workflows/along_with_symfony_deprecations.yaml b/.github/workflows/along_with_symfony_deprecations.yaml index a858f15d522..454ac68502b 100644 --- a/.github/workflows/along_with_symfony_deprecations.yaml +++ b/.github/workflows/along_with_symfony_deprecations.yaml @@ -13,7 +13,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 8.2 + php-version: 8.3 coverage: none - run: mkdir nested-dir diff --git a/.github/workflows/code_analysis.yaml b/.github/workflows/code_analysis.yaml index 49b1a0ce710..84a9f321c53 100644 --- a/.github/workflows/code_analysis.yaml +++ b/.github/workflows/code_analysis.yaml @@ -44,7 +44,7 @@ jobs: # see https://github.com/shivammathur/setup-php - uses: shivammathur/setup-php@v2 with: - php-version: 8.2 + php-version: 8.3 coverage: none # composer install cache - https://github.com/ramsey/composer-install diff --git a/.github/workflows/downgraded_release.yaml b/.github/workflows/downgraded_release.yaml index 2a52ab8356a..1562d36fec1 100644 --- a/.github/workflows/downgraded_release.yaml +++ b/.github/workflows/downgraded_release.yaml @@ -19,7 +19,7 @@ jobs: - uses: "shivammathur/setup-php@v2" with: - php-version: 8.2 + php-version: 8.3 coverage: none # invoke patches @@ -54,7 +54,7 @@ jobs: - uses: "shivammathur/setup-php@v2" with: - php-version: 8.2 + php-version: 8.3 coverage: none # fix coding standard, so code looks nice diff --git a/bin/ecs.php b/bin/ecs.php index 22a07c1f95c..a661abad582 100755 --- a/bin/ecs.php +++ b/bin/ecs.php @@ -37,7 +37,7 @@ final class ECSAutoloadIncluder /** * @var string[] */ - private const POSSIBLE_AUTOLOAD_PATHS = [ + private const array POSSIBLE_AUTOLOAD_PATHS = [ // after split package __DIR__ . '/../vendor', // dependency diff --git a/composer.json b/composer.json index 65b91c4e324..a8e2fefd903 100644 --- a/composer.json +++ b/composer.json @@ -12,17 +12,17 @@ "bin/ecs" ], "require": { - "php": ">=8.2", + "php": ">=8.3", "composer/pcre": "^3.3.2", "composer/xdebug-handler": "^3.0.5", - "friendsofphp/php-cs-fixer": "^3.89", - "illuminate/container": "^12.35", + "friendsofphp/php-cs-fixer": "^3.92.4", + "illuminate/container": "12.39", "nette/utils": "^4.0.7", "sebastian/diff": "^6.0.2", "squizlabs/php_codesniffer": "^4.0", "symfony/console": "^6.4.24", "symfony/finder": "^7.3.0", - "symplify/coding-standard": "^13.0.0", + "symplify/coding-standard": "^13.0", "symplify/easy-parallel": "^11.2.2", "webmozart/assert": "^1.12" }, diff --git a/phpstan.neon b/phpstan.neon index 57804437f25..88a1d924312 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,7 +1,7 @@ parameters: level: 8 - # reportUnmatchedIgnoredErrors: false + reportUnmatchedIgnoredErrors: false # requires exact closure types checkMissingCallableSignature: true diff --git a/src/Application/EasyCodingStandardApplication.php b/src/Application/EasyCodingStandardApplication.php index 084e3ec7ce1..07fcdfa813a 100644 --- a/src/Application/EasyCodingStandardApplication.php +++ b/src/Application/EasyCodingStandardApplication.php @@ -27,10 +27,7 @@ final readonly class EasyCodingStandardApplication { - /** - * @var string - */ - private const ARGV = 'argv'; + private const string ARGV = 'argv'; public function __construct( private EasyCodingStandardStyle $easyCodingStandardStyle, diff --git a/src/Application/Version/StaticVersionResolver.php b/src/Application/Version/StaticVersionResolver.php index 95c3cdc6781..a04e1c2ae8f 100644 --- a/src/Application/Version/StaticVersionResolver.php +++ b/src/Application/Version/StaticVersionResolver.php @@ -15,20 +15,15 @@ final class StaticVersionResolver { /** * @api - * @var string */ - public const PACKAGE_VERSION = '@package_version@'; + public const string PACKAGE_VERSION = '@package_version@'; /** * @api - * @var string */ - public const RELEASE_DATE = '@release_date@'; + public const string RELEASE_DATE = '@release_date@'; - /** - * @var int - */ - private const SUCCESS_CODE = 0; + private const int SUCCESS_CODE = 0; /** * @api diff --git a/src/Caching/ChangedFilesDetector.php b/src/Caching/ChangedFilesDetector.php index 873c75d3552..3e703eb8fe1 100644 --- a/src/Caching/ChangedFilesDetector.php +++ b/src/Caching/ChangedFilesDetector.php @@ -12,15 +12,9 @@ */ final readonly class ChangedFilesDetector { - /** - * @var string - */ - private const CONFIGURATION_HASH_KEY = 'configuration_hash'; + private const string CONFIGURATION_HASH_KEY = 'configuration_hash'; - /** - * @var string - */ - private const FILE_HASH = 'file_hash'; + private const string FILE_HASH = 'file_hash'; public function __construct( private FileHashComputer $fileHashComputer, diff --git a/src/Config/ECSConfig.php b/src/Config/ECSConfig.php index 07e7d577462..fbe8e7a5a60 100644 --- a/src/Config/ECSConfig.php +++ b/src/Config/ECSConfig.php @@ -5,6 +5,7 @@ namespace Symplify\EasyCodingStandard\Config; use Illuminate\Container\Container; +use Override; use PHP_CodeSniffer\Sniffs\Sniff; use PhpCsFixer\Fixer\ConfigurableFixerInterface; use PhpCsFixer\Fixer\FixerInterface; @@ -30,7 +31,7 @@ final class ECSConfig extends Container /** * @var string[] */ - private const AUTOTAG_INTERFACES = [Sniff::class, FixerInterface::class, OutputFormatterInterface::class]; + private const array AUTOTAG_INTERFACES = [Sniff::class, FixerInterface::class, OutputFormatterInterface::class]; public static function configure(): ECSConfigBuilder { @@ -254,6 +255,7 @@ public function boot(): void /** * @param string $abstract */ + #[Override] public function singleton($abstract, mixed $concrete = null): void { parent::singleton($abstract, $concrete); diff --git a/src/Configuration/EditorConfig/EndOfLine.php b/src/Configuration/EditorConfig/EndOfLine.php index c84913ca4fd..6e65fecd775 100644 --- a/src/Configuration/EditorConfig/EndOfLine.php +++ b/src/Configuration/EditorConfig/EndOfLine.php @@ -6,9 +6,9 @@ final class EndOfLine { - public const Posix = 'lf'; + public const string Posix = 'lf'; - public const Legacy = 'cr'; + public const string Legacy = 'cr'; - public const Windows = 'crlf'; + public const string Windows = 'crlf'; } diff --git a/src/Configuration/EditorConfig/IndentStyle.php b/src/Configuration/EditorConfig/IndentStyle.php index bcedcd389c2..43dbf79904a 100644 --- a/src/Configuration/EditorConfig/IndentStyle.php +++ b/src/Configuration/EditorConfig/IndentStyle.php @@ -6,7 +6,7 @@ final class IndentStyle { - public const Space = 'space'; + public const string Space = 'space'; - public const Tab = 'tab'; + public const string Tab = 'tab'; } diff --git a/src/Configuration/EditorConfig/QuoteType.php b/src/Configuration/EditorConfig/QuoteType.php index 7cc281b38a1..b06d847a4da 100644 --- a/src/Configuration/EditorConfig/QuoteType.php +++ b/src/Configuration/EditorConfig/QuoteType.php @@ -9,9 +9,9 @@ */ final class QuoteType { - public const Single = 'single'; + public const string Single = 'single'; - public const Double = 'double'; + public const string Double = 'double'; - public const Auto = 'auto'; + public const string Auto = 'auto'; } diff --git a/src/Console/Command/CheckCommand.php b/src/Console/Command/CheckCommand.php index 03a49eee372..6429fdc47df 100644 --- a/src/Console/Command/CheckCommand.php +++ b/src/Console/Command/CheckCommand.php @@ -4,6 +4,7 @@ namespace Symplify\EasyCodingStandard\Console\Command; +use Override; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symplify\EasyCodingStandard\Application\EasyCodingStandardApplication; @@ -24,6 +25,7 @@ public function __construct( parent::__construct(); } + #[Override] protected function configure(): void { $this->setName('check'); diff --git a/src/Console/Command/ScriptsCommand.php b/src/Console/Command/ScriptsCommand.php index e1dc8a6ddaf..87609611749 100644 --- a/src/Console/Command/ScriptsCommand.php +++ b/src/Console/Command/ScriptsCommand.php @@ -4,6 +4,7 @@ namespace Symplify\EasyCodingStandard\Console\Command; +use Override; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; @@ -17,6 +18,7 @@ public function __construct( parent::__construct(); } + #[Override] protected function configure(): void { $this->setName('scripts'); diff --git a/src/Console/Command/WorkerCommand.php b/src/Console/Command/WorkerCommand.php index b59d1566464..31e7dd83872 100644 --- a/src/Console/Command/WorkerCommand.php +++ b/src/Console/Command/WorkerCommand.php @@ -6,6 +6,7 @@ use Clue\React\NDJson\Decoder; use Clue\React\NDJson\Encoder; +use Override; use React\EventLoop\StreamSelectLoop; use React\Socket\ConnectionInterface; use React\Socket\TcpConnector; @@ -34,6 +35,7 @@ public function __construct( parent::__construct(); } + #[Override] protected function configure(): void { $this->setName('worker'); diff --git a/src/Console/EasyCodingStandardConsoleApplication.php b/src/Console/EasyCodingStandardConsoleApplication.php index 30dcc8724b3..8c4da501678 100644 --- a/src/Console/EasyCodingStandardConsoleApplication.php +++ b/src/Console/EasyCodingStandardConsoleApplication.php @@ -5,6 +5,7 @@ namespace Symplify\EasyCodingStandard\Console; use Composer\XdebugHandler\XdebugHandler; +use Override; use PHP_CodeSniffer\Config as PHP_CodeSniffer; use PhpCsFixer\Console\Application as PhpCsFixer; use Symfony\Component\Console\Application; @@ -48,6 +49,7 @@ public function __construct( $this->setDefaultCommand('check'); } + #[Override] public function doRun(InputInterface $input, OutputInterface $output): int { // @fixes https://github.com/rectorphp/rector/issues/2205 @@ -74,6 +76,7 @@ public function doRun(InputInterface $input, OutputInterface $output): int return $exitCode; } + #[Override] protected function getDefaultInputDefinition(): InputDefinition { $inputDefinition = parent::getDefaultInputDefinition(); diff --git a/src/Console/ExitCode.php b/src/Console/ExitCode.php index 42b26abfb6e..da3e952b38e 100644 --- a/src/Console/ExitCode.php +++ b/src/Console/ExitCode.php @@ -8,18 +8,9 @@ final class ExitCode { - /** - * @var int - */ - public const SUCCESS = Command::SUCCESS; + public const int SUCCESS = Command::SUCCESS; - /** - * @var int - */ - public const FAILURE = Command::FAILURE; + public const int FAILURE = Command::FAILURE; - /** - * @var int - */ - public const CHANGED_CODE_OR_FOUND_ERRORS = 2; + public const int CHANGED_CODE_OR_FOUND_ERRORS = 2; } diff --git a/src/Console/Formatter/ColorConsoleDiffFormatter.php b/src/Console/Formatter/ColorConsoleDiffFormatter.php index ff41f3461ee..41bbe1385ed 100644 --- a/src/Console/Formatter/ColorConsoleDiffFormatter.php +++ b/src/Console/Formatter/ColorConsoleDiffFormatter.php @@ -16,28 +16,24 @@ final readonly class ColorConsoleDiffFormatter { /** - * @var string * @see https://regex101.com/r/ovLMDF/1 */ - private const PLUS_START_REGEX = '#^(\+.*)#'; + private const string PLUS_START_REGEX = '#^(\+.*)#'; /** - * @var string * @see https://regex101.com/r/xwywpa/1 */ - private const MINUT_START_REGEX = '#^(\-.*)#'; + private const string MINUT_START_REGEX = '#^(\-.*)#'; /** - * @var string * @see https://regex101.com/r/CMlwa8/1 */ - private const AT_START_REGEX = '#^(@.*)#'; + private const string AT_START_REGEX = '#^(@.*)#'; /** - * @var string * @see https://regex101.com/r/qduj2O/1 */ - private const NEWLINES_REGEX = "#\n\r|\n#"; + private const string NEWLINES_REGEX = "#\n\r|\n#"; private string $template; diff --git a/src/Console/Output/ConsoleOutputFormatter.php b/src/Console/Output/ConsoleOutputFormatter.php index fd6cb29226c..c29a4e02a00 100644 --- a/src/Console/Output/ConsoleOutputFormatter.php +++ b/src/Console/Output/ConsoleOutputFormatter.php @@ -14,10 +14,7 @@ final readonly class ConsoleOutputFormatter implements OutputFormatterInterface { - /** - * @var string - */ - public const NAME = 'console'; + public const string NAME = 'console'; public function __construct( private EasyCodingStandardStyle $easyCodingStandardStyle, diff --git a/src/Console/Output/GitlabOutputFormatter.php b/src/Console/Output/GitlabOutputFormatter.php index d8fa34fb59a..8a7990ff88d 100644 --- a/src/Console/Output/GitlabOutputFormatter.php +++ b/src/Console/Output/GitlabOutputFormatter.php @@ -4,6 +4,8 @@ namespace Symplify\EasyCodingStandard\Console\Output; +use function array_map as map; +use function array_merge as merge; use SebastianBergmann\Diff\Chunk; use SebastianBergmann\Diff\Line; use SebastianBergmann\Diff\Parser as DiffParser; @@ -14,8 +16,6 @@ use Symplify\EasyCodingStandard\ValueObject\Configuration; use Symplify\EasyCodingStandard\ValueObject\Error\ErrorAndDiffResult; use Symplify\EasyCodingStandard\ValueObject\Error\FileDiff; -use function array_map as map; -use function array_merge as merge; /** * Generates a JSON file containing the Gitlab-supported variant of diff --git a/src/Console/Output/JsonOutputFormatter.php b/src/Console/Output/JsonOutputFormatter.php index 78af335328c..e5eeaf4dda4 100644 --- a/src/Console/Output/JsonOutputFormatter.php +++ b/src/Console/Output/JsonOutputFormatter.php @@ -16,10 +16,7 @@ */ final readonly class JsonOutputFormatter implements OutputFormatterInterface { - /** - * @var string - */ - private const FILES = 'files'; + private const string FILES = 'files'; public function __construct( private EasyCodingStandardStyle $easyCodingStandardStyle, diff --git a/src/Console/Style/EasyCodingStandardStyle.php b/src/Console/Style/EasyCodingStandardStyle.php index bcd7ce7f61f..b38a1a6a0a0 100644 --- a/src/Console/Style/EasyCodingStandardStyle.php +++ b/src/Console/Style/EasyCodingStandardStyle.php @@ -14,10 +14,8 @@ final class EasyCodingStandardStyle extends SymfonyStyle { /** * To fit in Linux/Windows terminal windows to prevent overflow. - * - * @var int */ - private const BULGARIAN_CONSTANT = 8; + private const int BULGARIAN_CONSTANT = 8; public function __construct( InputInterface $input, diff --git a/src/DependencyInjection/CompilerPass/ConflictingCheckersCompilerPass.php b/src/DependencyInjection/CompilerPass/ConflictingCheckersCompilerPass.php index 22e17821cdb..759dc6f1f0b 100644 --- a/src/DependencyInjection/CompilerPass/ConflictingCheckersCompilerPass.php +++ b/src/DependencyInjection/CompilerPass/ConflictingCheckersCompilerPass.php @@ -29,7 +29,7 @@ final class ConflictingCheckersCompilerPass * * @var string[][] */ - private const CONFLICTING_CHECKER_GROUPS = [ + private const array CONFLICTING_CHECKER_GROUPS = [ [StandaloneLineConstructorParamFixer::class, StandaloneLinePromotedPropertyFixer::class], ['SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff', YodaStyleFixer::class], [LowerCaseConstantSniff::class, UpperCaseConstantSniff::class], diff --git a/src/DependencyInjection/CompilerPass/RemoveMutualCheckersCompilerPass.php b/src/DependencyInjection/CompilerPass/RemoveMutualCheckersCompilerPass.php index 05811e64696..a74cb0f533a 100644 --- a/src/DependencyInjection/CompilerPass/RemoveMutualCheckersCompilerPass.php +++ b/src/DependencyInjection/CompilerPass/RemoveMutualCheckersCompilerPass.php @@ -16,6 +16,7 @@ use PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff; use PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowSpaceIndentSniff; use PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff; +use PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\LanguageConstructSpacingSniff; use PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff; use PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ScopeClosingBraceSniff; use PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff; @@ -27,7 +28,6 @@ use PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\LowercaseClassKeywordsSniff; use PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationArgumentSpacingSniff; use PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\DoubleQuoteUsageSniff; -use PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\LanguageConstructSpacingSniff; use PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff; use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer; use PhpCsFixer\Fixer\Basic\BracesFixer; @@ -65,7 +65,7 @@ final class RemoveMutualCheckersCompilerPass * * @var string[][] */ - private const DUPLICATED_CHECKER_GROUPS = [ + private const array DUPLICATED_CHECKER_GROUPS = [ [IndentationTypeFixer::class, ScopeIndentSniff::class], [IndentationTypeFixer::class, DisallowTabIndentSniff::class], [IndentationTypeFixer::class, DisallowSpaceIndentSniff::class], diff --git a/src/DependencyInjection/EasyCodingStandardContainerFactory.php b/src/DependencyInjection/EasyCodingStandardContainerFactory.php index 8df5ef0555d..00df680b2b6 100644 --- a/src/DependencyInjection/EasyCodingStandardContainerFactory.php +++ b/src/DependencyInjection/EasyCodingStandardContainerFactory.php @@ -4,10 +4,10 @@ namespace Symplify\EasyCodingStandard\DependencyInjection; -use Symplify\EasyCodingStandard\Config\ECSConfig; use Illuminate\Container\Container; use Symfony\Component\Console\Input\ArgvInput; use Symplify\EasyCodingStandard\Caching\ChangedFilesDetector; +use Symplify\EasyCodingStandard\Config\ECSConfig; /** * @api diff --git a/src/FileSystem/PathNormalizer.php b/src/FileSystem/PathNormalizer.php index b949835d6be..bd82d0e301f 100644 --- a/src/FileSystem/PathNormalizer.php +++ b/src/FileSystem/PathNormalizer.php @@ -19,20 +19,15 @@ final class PathNormalizer { /** * @see https://regex101.com/r/d4F5Fm/1 - * @var string */ - private const SCHEME_PATH_REGEX = '#^([a-z]+)\\:\\/\\/(.+)#'; + private const string SCHEME_PATH_REGEX = '#^([a-z]+)\\:\\/\\/(.+)#'; /** * @see https://regex101.com/r/no28vw/1 - * @var string */ - private const TWO_AND_MORE_SLASHES_REGEX = '#/{2,}#'; + private const string TWO_AND_MORE_SLASHES_REGEX = '#/{2,}#'; - /** - * @var string - */ - private const SCHEME_UNDEFINED = 'undefined'; + private const string SCHEME_UNDEFINED = 'undefined'; public function normalizePath(string $originalPath): string { diff --git a/src/Finder/SourceFinder.php b/src/Finder/SourceFinder.php index 0c307d1487f..626ee6543b3 100644 --- a/src/Finder/SourceFinder.php +++ b/src/Finder/SourceFinder.php @@ -7,7 +7,6 @@ use Symfony\Component\Finder\Finder; use Symplify\EasyCodingStandard\DependencyInjection\SimpleParameterProvider; use Symplify\EasyCodingStandard\ValueObject\Option; -use Webmozart\Assert\Assert; /** * @see \Symplify\EasyCodingStandard\Tests\Finder\SourceFinderTest diff --git a/src/FixerRunner/ValueObject/Spacing.php b/src/FixerRunner/ValueObject/Spacing.php index aed915de5b7..9bb309ca6dc 100644 --- a/src/FixerRunner/ValueObject/Spacing.php +++ b/src/FixerRunner/ValueObject/Spacing.php @@ -6,18 +6,9 @@ final class Spacing { - /** - * @var string - */ - public const FOUR_SPACES = ' '; + public const string FOUR_SPACES = ' '; - /** - * @var string - */ - public const ONE_TAB = ' '; + public const string ONE_TAB = ' '; - /** - * @var string - */ - public const TWO_SPACES = ' '; + public const string TWO_SPACES = ' '; } diff --git a/src/FixerRunner/WhitespacesFixerConfigFactory.php b/src/FixerRunner/WhitespacesFixerConfigFactory.php index 5a6ffdd888a..641391fa37d 100644 --- a/src/FixerRunner/WhitespacesFixerConfigFactory.php +++ b/src/FixerRunner/WhitespacesFixerConfigFactory.php @@ -18,7 +18,7 @@ final class WhitespacesFixerConfigFactory /** * @var string[] */ - private const ALLOWED_VALUES = ['tab', 'spaces', Spacing::TWO_SPACES, Spacing::FOUR_SPACES, Spacing::ONE_TAB]; + private const array ALLOWED_VALUES = ['tab', 'spaces', Spacing::TWO_SPACES, Spacing::FOUR_SPACES, Spacing::ONE_TAB]; /** * @api diff --git a/src/MemoryLimitter.php b/src/MemoryLimitter.php index 0a1cfa56646..28369a8dabb 100644 --- a/src/MemoryLimitter.php +++ b/src/MemoryLimitter.php @@ -14,10 +14,9 @@ final class MemoryLimitter { /** - * @var string * @see https://regex101.com/r/pmiGUM/1 */ - private const VALID_MEMORY_LIMIT_REGEX = '#^-?\d+[kMG]?$#i'; + private const string VALID_MEMORY_LIMIT_REGEX = '#^-?\d+[kMG]?$#i'; public function adjust(Configuration $configuration): void { diff --git a/src/Parallel/Application/ParallelFileProcessor.php b/src/Parallel/Application/ParallelFileProcessor.php index 48095b9c08f..f62eeb6f34a 100644 --- a/src/Parallel/Application/ParallelFileProcessor.php +++ b/src/Parallel/Application/ParallelFileProcessor.php @@ -37,10 +37,7 @@ */ final class ParallelFileProcessor { - /** - * @var int - */ - private const SYSTEM_ERROR_LIMIT = 50; + private const int SYSTEM_ERROR_LIMIT = 50; private ProcessPool|null $processPool = null; diff --git a/src/Parallel/ValueObject/Bridge.php b/src/Parallel/ValueObject/Bridge.php index db2574e243e..7041cc2858b 100644 --- a/src/Parallel/ValueObject/Bridge.php +++ b/src/Parallel/ValueObject/Bridge.php @@ -9,28 +9,13 @@ */ final class Bridge { - /** - * @var string - */ - public const FILE_DIFFS = 'file_diffs'; + public const string FILE_DIFFS = 'file_diffs'; - /** - * @var string - */ - public const CODING_STANDARD_ERRORS = 'coding_standard_errors'; + public const string CODING_STANDARD_ERRORS = 'coding_standard_errors'; - /** - * @var string - */ - public const SYSTEM_ERRORS = 'system_errors'; + public const string SYSTEM_ERRORS = 'system_errors'; - /** - * @var string - */ - public const SYSTEM_ERRORS_COUNT = 'system_errors_count'; + public const string SYSTEM_ERRORS_COUNT = 'system_errors_count'; - /** - * @var string - */ - public const FILES_COUNT = 'files_count'; + public const string FILES_COUNT = 'files_count'; } diff --git a/src/Parallel/ValueObject/Name.php b/src/Parallel/ValueObject/Name.php index 4738c2e2227..a8c4d42ffe1 100644 --- a/src/Parallel/ValueObject/Name.php +++ b/src/Parallel/ValueObject/Name.php @@ -9,43 +9,19 @@ */ final class Name { - /** - * @var string - */ - public const LINE = 'line'; - - /** - * @var string - */ - public const MESSAGE = 'message'; - - /** - * @var string - */ - public const CHECKER_CLASS = 'checker_class'; - - /** - * @var string - */ - public const RELATIVE_FILE_PATH = 'relative_file_path'; - - /** - * @var string - */ - public const ABSOLUTE_FILE_PATH = 'absolute_file_path'; - - /** - * @var string - */ - public const DIFF = 'diff'; - - /** - * @var string - */ - public const DIFF_CONSOLE_FORMATTED = 'diff_console_formatted'; - - /** - * @var string - */ - public const APPLIED_CHECKERS = 'applied_checkers'; + public const string LINE = 'line'; + + public const string MESSAGE = 'message'; + + public const string CHECKER_CLASS = 'checker_class'; + + public const string RELATIVE_FILE_PATH = 'relative_file_path'; + + public const string ABSOLUTE_FILE_PATH = 'absolute_file_path'; + + public const string DIFF = 'diff'; + + public const string DIFF_CONSOLE_FORMATTED = 'diff_console_formatted'; + + public const string APPLIED_CHECKERS = 'applied_checkers'; } diff --git a/src/Skipper/Skipper/Skipper.php b/src/Skipper/Skipper/Skipper.php index 52b3e2ef70f..5e82240bebb 100644 --- a/src/Skipper/Skipper/Skipper.php +++ b/src/Skipper/Skipper/Skipper.php @@ -16,10 +16,7 @@ */ final class Skipper { - /** - * @var string - */ - private const FILE_ELEMENT = 'file_elements'; + private const string FILE_ELEMENT = 'file_elements'; /** * @var SkipVoterInterface[] diff --git a/src/SniffRunner/Application/SniffFileProcessor.php b/src/SniffRunner/Application/SniffFileProcessor.php index f261744eecf..44da5b0a9e7 100644 --- a/src/SniffRunner/Application/SniffFileProcessor.php +++ b/src/SniffRunner/Application/SniffFileProcessor.php @@ -31,15 +31,12 @@ */ final class SniffFileProcessor implements FileProcessorInterface { - /** - * @var int - */ - private const MAX_FIXER_LOOPS = 100; + private const int MAX_FIXER_LOOPS = 100; /** * @var array */ - private const ESCALATE_WARNINGS_SNIFF = [ + private const array ESCALATE_WARNINGS_SNIFF = [ AssignmentInConditionSniff::class, PropertyDeclarationSniff::class, MethodDeclarationSniff::class, diff --git a/src/SniffRunner/ValueObject/File.php b/src/SniffRunner/ValueObject/File.php index e7cfcaee5af..62271331f15 100644 --- a/src/SniffRunner/ValueObject/File.php +++ b/src/SniffRunner/ValueObject/File.php @@ -121,8 +121,13 @@ public function process(): void * * @param mixed[] $data */ - public function addFixableError(string $error, int $stackPtr, string $code, array $data = [], int $severity = 0): bool - { + public function addFixableError( + string $error, + int $stackPtr, + string $code, + array $data = [], + int $severity = 0 + ): bool { $fullyQualifiedCode = $this->resolveFullyQualifiedCode($code); $this->sniffMetadataCollector->addAppliedSniff($fullyQualifiedCode); @@ -132,8 +137,14 @@ public function addFixableError(string $error, int $stackPtr, string $code, arra /** * @param mixed[] $data */ - public function addError(string $error, ?int $stackPtr, string $code, array $data = [], int $severity = 0, bool $fixable = false): bool - { + public function addError( + string $error, + ?int $stackPtr, + string $code, + array $data = [], + int $severity = 0, + bool $fixable = false + ): bool { if ($this->shouldSkipError($error, $code, $data)) { return false; } @@ -145,8 +156,14 @@ public function addError(string $error, ?int $stackPtr, string $code, array $dat * @param mixed[] $data * Allow only specific classes */ - public function addWarning(string $warning, ?int $stackPtr, string $code, array $data = [], int $severity = 0, bool $fixable = false): bool - { + public function addWarning( + string $warning, + ?int $stackPtr, + string $code, + array $data = [], + int $severity = 0, + bool $fixable = false + ): bool { if ($this->activeSniffClass === null) { throw new ShouldNotHappenException(); } diff --git a/src/Testing/PHPUnit/AbstractCheckerTestCase.php b/src/Testing/PHPUnit/AbstractCheckerTestCase.php index 464470dbff8..f1b927a72ab 100644 --- a/src/Testing/PHPUnit/AbstractCheckerTestCase.php +++ b/src/Testing/PHPUnit/AbstractCheckerTestCase.php @@ -7,6 +7,7 @@ use Iterator; use Nette\Utils\FileSystem; use Nette\Utils\Strings; +use Override; use Symplify\EasyCodingStandard\Exception\ShouldNotHappenException; use Symplify\EasyCodingStandard\FixerRunner\Application\FixerFileProcessor; use Symplify\EasyCodingStandard\SniffRunner\Application\SniffFileProcessor; @@ -24,15 +25,12 @@ */ abstract class AbstractCheckerTestCase extends AbstractTestCase implements ConfigAwareInterface { - /** - * @var string - */ - private const SPLIT_LINE_REGEX = "#\-\-\-\-\-\r?\n#"; + private const string SPLIT_LINE_REGEX = "#\-\-\-\-\-\r?\n#"; /** * @var string[] */ - private const POSSIBLE_CODE_SNIFFER_AUTOLOAD_PATHS = [ + private const array POSSIBLE_CODE_SNIFFER_AUTOLOAD_PATHS = [ __DIR__ . '/../../../../../vendor/squizlabs/php_codesniffer/autoload.php', __DIR__ . '/../../../../vendor/squizlabs/php_codesniffer/autoload.php', ]; @@ -41,6 +39,7 @@ abstract class AbstractCheckerTestCase extends AbstractTestCase implements Confi private SniffFileProcessor $sniffFileProcessor; + #[Override] protected function setUp(): void { // autoload php code sniffer before Kernel boot diff --git a/src/ValueObject/Option.php b/src/ValueObject/Option.php index fcb97a5fa97..bb28fb7a413 100644 --- a/src/ValueObject/Option.php +++ b/src/ValueObject/Option.php @@ -6,158 +6,107 @@ final class Option { - /** - * @var string - */ - public const FIX = 'fix'; + public const string FIX = 'fix'; - /** - * @var string - */ - public const CLEAR_CACHE = 'clear-cache'; + public const string CLEAR_CACHE = 'clear-cache'; - /** - * @var string - */ - public const NO_PROGRESS_BAR = 'no-progress-bar'; + public const string NO_PROGRESS_BAR = 'no-progress-bar'; - /** - * @var string - */ - public const NO_ERROR_TABLE = 'no-error-table'; + public const string NO_ERROR_TABLE = 'no-error-table'; - /** - * @var string - */ - public const OUTPUT_FORMAT = 'output-format'; + public const string OUTPUT_FORMAT = 'output-format'; - /** - * @var string - */ - public const NO_DIFFS = 'no-diffs'; + public const string NO_DIFFS = 'no-diffs'; /** * @api * @deprecated Use @see \Symplify\EasyCodingStandard\Config\ECSConfig::skip() - * @var string */ - public const SKIP = 'skip'; + public const string SKIP = 'skip'; /** * Alias for SOURCE * * @api * @deprecated Use @see \Symplify\EasyCodingStandard\Config\ECSConfig::paths() - * @var string */ - public const PATHS = 'paths'; + public const string PATHS = 'paths'; /** * @api * @deprecated Use @see \Symplify\EasyCodingStandard\Config\ECSConfig::skip() - * @var string */ - public const ONLY = 'only'; + public const string ONLY = 'only'; /** * @deprecated Use @see \Symplify\EasyCodingStandard\Config\ECSConfig::cacheDirectory() - * @var string */ - public const CACHE_DIRECTORY = 'cache_directory'; + public const string CACHE_DIRECTORY = 'cache_directory'; /** * @deprecated Use @see \Symplify\EasyCodingStandard\Config\ECSConfig::lineEnding() - * @var string */ - public const LINE_ENDING = 'line_ending'; + public const string LINE_ENDING = 'line_ending'; /** * @deprecated Use @see \Symplify\EasyCodingStandard\Config\ECSConfig::indentation() - * @var string */ - public const INDENTATION = 'indentation'; + public const string INDENTATION = 'indentation'; /** * @deprecated Use @see \Symplify\EasyCodingStandard\Config\ECSConfig::cacheNamespace() - * @var string */ - public const CACHE_NAMESPACE = 'cache_namespace'; + public const string CACHE_NAMESPACE = 'cache_namespace'; /** * @deprecated Use @see \Symplify\EasyCodingStandard\Config\ECSConfig::fileExtensions() - * @var string */ - public const FILE_EXTENSIONS = 'file_extensions'; + public const string FILE_EXTENSIONS = 'file_extensions'; /** * @api - * @var string */ - public const INDENTATION_SPACES = 'spaces'; + public const string INDENTATION_SPACES = 'spaces'; /** * @api - * @var string */ - public const INDENTATION_TAB = 'tab'; + public const string INDENTATION_TAB = 'tab'; - /** - * @var string - */ - public const XDEBUG = 'xdebug'; + public const string XDEBUG = 'xdebug'; - /** - * @var string - */ - public const DEBUG = 'debug'; + public const string DEBUG = 'debug'; /** * @see \Symplify\EasyCodingStandard\Config\ECSConfig::parallel() - * @var string */ - public const PARALLEL = 'parallel'; + public const string PARALLEL = 'parallel'; - /** - * @var string - */ - public const CONFIG = 'config'; + public const string CONFIG = 'config'; /** * @see \Symplify\EasyCodingStandard\Config\ECSConfig::parallel() - * @var string */ - public const PARALLEL_JOB_SIZE = 'parallel_job_size'; + public const string PARALLEL_JOB_SIZE = 'parallel_job_size'; - /** - * @var string - */ - public const PARALLEL_PORT = 'port'; + public const string PARALLEL_PORT = 'port'; - /** - * @var string - */ - public const PARALLEL_IDENTIFIER = 'identifier'; + public const string PARALLEL_IDENTIFIER = 'identifier'; /** * @see \Symplify\EasyCodingStandard\Config\ECSConfig::parallel() - * @var string */ - public const PARALLEL_MAX_NUMBER_OF_PROCESSES = 'max-number-of-processes'; + public const string PARALLEL_MAX_NUMBER_OF_PROCESSES = 'max-number-of-processes'; - /** - * @var string - */ - public const MEMORY_LIMIT = 'memory-limit'; + public const string MEMORY_LIMIT = 'memory-limit'; /** * @see \Symplify\EasyCodingStandard\Config\ECSConfig::parallel() - * @var string */ - public const PARALLEL_TIMEOUT_IN_SECONDS = 'parallel-timeout-in-seconds'; + public const string PARALLEL_TIMEOUT_IN_SECONDS = 'parallel-timeout-in-seconds'; /** * @see \Symplify\EasyCodingStandard\Config\ECSConfig::reportingRealPath() - * @var string */ - public const REPORTING_REALPATH = 'reporting-realpath'; + public const string REPORTING_REALPATH = 'reporting-realpath'; } diff --git a/src/ValueObject/Set/SetList.php b/src/ValueObject/Set/SetList.php index 14bb4e5b697..17d00bb4934 100644 --- a/src/ValueObject/Set/SetList.php +++ b/src/ValueObject/Set/SetList.php @@ -10,86 +10,72 @@ final class SetList { /** - * @var string * @api */ - public const PSR_12 = __DIR__ . '/../../../config/set/psr12.php'; + public const string PSR_12 = __DIR__ . '/../../../config/set/psr12.php'; /** - * @var string * @api */ - public const CLEAN_CODE = __DIR__ . '/../../../config/set/clean-code.php'; + public const string CLEAN_CODE = __DIR__ . '/../../../config/set/clean-code.php'; /** - * @var string * @api */ - public const SYMPLIFY = __DIR__ . '/../../../config/set/symplify.php'; + public const string SYMPLIFY = __DIR__ . '/../../../config/set/symplify.php'; /** - * @var string * @api */ - public const ARRAY = __DIR__ . '/../../../config/set/common/array.php'; + public const string ARRAY = __DIR__ . '/../../../config/set/common/array.php'; /** - * @var string * @api */ - public const COMMON = __DIR__ . '/../../../config/set/common.php'; + public const string COMMON = __DIR__ . '/../../../config/set/common.php'; /** - * @var string * @api */ - public const COMMENTS = __DIR__ . '/../../../config/set/common/comments.php'; + public const string COMMENTS = __DIR__ . '/../../../config/set/common/comments.php'; /** - * @var string * @api */ - public const CONTROL_STRUCTURES = __DIR__ . '/../../../config/set/common/control-structures.php'; + public const string CONTROL_STRUCTURES = __DIR__ . '/../../../config/set/common/control-structures.php'; /** - * @var string * @api */ - public const DOCBLOCK = __DIR__ . '/../../../config/set/common/docblock.php'; + public const string DOCBLOCK = __DIR__ . '/../../../config/set/common/docblock.php'; /** - * @var string * @api */ - public const NAMESPACES = __DIR__ . '/../../../config/set/common/namespaces.php'; + public const string NAMESPACES = __DIR__ . '/../../../config/set/common/namespaces.php'; /** - * @var string * @api */ - public const PHPUNIT = __DIR__ . '/../../../config/set/common/phpunit.php'; + public const string PHPUNIT = __DIR__ . '/../../../config/set/common/phpunit.php'; /** - * @var string * @api */ - public const SPACES = __DIR__ . '/../../../config/set/common/spaces.php'; + public const string SPACES = __DIR__ . '/../../../config/set/common/spaces.php'; /** - * @var string * @api */ - public const STRICT = __DIR__ . '/../../../config/set/common/strict.php'; + public const string STRICT = __DIR__ . '/../../../config/set/common/strict.php'; /** - * @var string * @api */ - public const DOCTRINE_ANNOTATIONS = __DIR__ . '/../../../config/set/doctrine-annotations.php'; + public const string DOCTRINE_ANNOTATIONS = __DIR__ . '/../../../config/set/doctrine-annotations.php'; /** - * @var string * @api */ - public const LARAVEL = __DIR__ . '/../../../config/set/laravel.php'; + public const string LARAVEL = __DIR__ . '/../../../config/set/laravel.php'; } diff --git a/tests/ChangedFilesDetector/ChangedFilesDetector/ChangedFilesDetectorTest.php b/tests/ChangedFilesDetector/ChangedFilesDetector/ChangedFilesDetectorTest.php index 2a39196a2ea..f0f71bd932a 100644 --- a/tests/ChangedFilesDetector/ChangedFilesDetector/ChangedFilesDetectorTest.php +++ b/tests/ChangedFilesDetector/ChangedFilesDetector/ChangedFilesDetectorTest.php @@ -4,6 +4,7 @@ namespace Symplify\EasyCodingStandard\Tests\ChangedFilesDetector\ChangedFilesDetector; +use Override; use Symplify\EasyCodingStandard\Caching\ChangedFilesDetector; use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractTestCase; @@ -13,6 +14,7 @@ final class ChangedFilesDetectorTest extends AbstractTestCase private ChangedFilesDetector $changedFilesDetector; + #[Override] protected function setUp(): void { parent::setUp(); diff --git a/tests/ChangedFilesDetector/FileHashComputer/FileHashComputerTest.php b/tests/ChangedFilesDetector/FileHashComputer/FileHashComputerTest.php index 3d0a89d2979..4dd304bf9ca 100644 --- a/tests/ChangedFilesDetector/FileHashComputer/FileHashComputerTest.php +++ b/tests/ChangedFilesDetector/FileHashComputer/FileHashComputerTest.php @@ -4,21 +4,20 @@ namespace Symplify\EasyCodingStandard\Tests\ChangedFilesDetector\FileHashComputer; +use Override; use Symfony\Component\Filesystem\Filesystem; use Symplify\EasyCodingStandard\Caching\FileHashComputer; use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractTestCase; final class FileHashComputerTest extends AbstractTestCase { - /** - * @var string - */ - private const INCLUDED_CONFIG_FILE = __DIR__ . '/Fixture/another-one.php'; + private const string INCLUDED_CONFIG_FILE = __DIR__ . '/Fixture/another-one.php'; private FileHashComputer $fileHashComputer; private Filesystem $filesystem; + #[Override] protected function setUp(): void { parent::setUp(); diff --git a/tests/Console/Output/CheckstyleOutputFormatterTest.php b/tests/Console/Output/CheckstyleOutputFormatterTest.php index d1193fa9ab8..01bf28c6616 100644 --- a/tests/Console/Output/CheckstyleOutputFormatterTest.php +++ b/tests/Console/Output/CheckstyleOutputFormatterTest.php @@ -4,6 +4,7 @@ namespace Symplify\EasyCodingStandard\Tests\Console\Output; +use Override; use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer; use Symplify\EasyCodingStandard\Console\Formatter\ColorConsoleDiffFormatter; use Symplify\EasyCodingStandard\Console\Output\CheckstyleOutputFormatter; @@ -18,6 +19,7 @@ final class CheckstyleOutputFormatterTest extends AbstractTestCase private ColorConsoleDiffFormatter $colorConsoleDiffFormatter; + #[Override] protected function setUp(): void { parent::setUp(); diff --git a/tests/Console/Output/GitlabOutputFormatterTest.php b/tests/Console/Output/GitlabOutputFormatterTest.php index 8d5cb4b4710..93a091f7a57 100644 --- a/tests/Console/Output/GitlabOutputFormatterTest.php +++ b/tests/Console/Output/GitlabOutputFormatterTest.php @@ -4,6 +4,7 @@ namespace Symplify\EasyCodingStandard\Tests\Console\Output; +use Override; use PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff; use PhpCsFixer\Differ\DifferInterface; use PHPUnit\Framework\Attributes\Depends; @@ -25,6 +26,7 @@ final class GitlabOutputFormatterTest extends AbstractTestCase private DifferInterface $differ; + #[Override] protected function setUp(): void { parent::setUp(); diff --git a/tests/Console/Output/JUnitOutputFormatterTest.php b/tests/Console/Output/JUnitOutputFormatterTest.php index a52b4db335d..204ea77fa15 100644 --- a/tests/Console/Output/JUnitOutputFormatterTest.php +++ b/tests/Console/Output/JUnitOutputFormatterTest.php @@ -4,6 +4,7 @@ namespace Symplify\EasyCodingStandard\Tests\Console\Output; +use Override; use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer; use Symplify\EasyCodingStandard\Console\Formatter\ColorConsoleDiffFormatter; use Symplify\EasyCodingStandard\Console\Output\JUnitOutputFormatter; @@ -18,6 +19,7 @@ final class JUnitOutputFormatterTest extends AbstractTestCase private ColorConsoleDiffFormatter $colorConsoleDiffFormatter; + #[Override] protected function setUp(): void { parent::setUp(); diff --git a/tests/Console/Output/JsonOutputFormatterTest.php b/tests/Console/Output/JsonOutputFormatterTest.php index 754789bc52d..dd3caa8c276 100644 --- a/tests/Console/Output/JsonOutputFormatterTest.php +++ b/tests/Console/Output/JsonOutputFormatterTest.php @@ -4,6 +4,7 @@ namespace Symplify\EasyCodingStandard\Tests\Console\Output; +use Override; use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer; use Symplify\EasyCodingStandard\Console\Formatter\ColorConsoleDiffFormatter; use Symplify\EasyCodingStandard\Console\Output\JsonOutputFormatter; @@ -18,6 +19,7 @@ final class JsonOutputFormatterTest extends AbstractTestCase private ColorConsoleDiffFormatter $colorConsoleDiffFormatter; + #[Override] protected function setUp(): void { parent::setUp(); diff --git a/tests/FixerRunner/Application/FileProcessorTest.php b/tests/FixerRunner/Application/FileProcessorTest.php index aa81eb5e6e5..43af3bcd305 100644 --- a/tests/FixerRunner/Application/FileProcessorTest.php +++ b/tests/FixerRunner/Application/FileProcessorTest.php @@ -4,6 +4,7 @@ namespace Symplify\EasyCodingStandard\Tests\FixerRunner\Application; +use Override; use PhpCsFixer\Fixer\ArrayNotation\NoTrailingCommaInSinglelineArrayFixer; use PhpCsFixer\Fixer\Basic\EncodingFixer; use PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer; @@ -14,6 +15,7 @@ final class FileProcessorTest extends AbstractTestCase { private FixerFileProcessor $fixerFileProcessor; + #[Override] protected function setUp(): void { parent::setUp(); diff --git a/tests/Skipper/FileSystem/FnMatchPathNormalizerTest.php b/tests/Skipper/FileSystem/FnMatchPathNormalizerTest.php index 676987b8f82..d9befb9577d 100644 --- a/tests/Skipper/FileSystem/FnMatchPathNormalizerTest.php +++ b/tests/Skipper/FileSystem/FnMatchPathNormalizerTest.php @@ -5,6 +5,7 @@ namespace Symplify\EasyCodingStandard\Tests\Skipper\FileSystem; use Iterator; +use Override; use PHPUnit\Framework\Attributes\DataProvider; use Symplify\EasyCodingStandard\Skipper\FileSystem\FnMatchPathNormalizer; use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractTestCase; @@ -13,6 +14,7 @@ final class FnMatchPathNormalizerTest extends AbstractTestCase { private FnMatchPathNormalizer $fnMatchPathNormalizer; + #[Override] protected function setUp(): void { parent::setUp(); diff --git a/tests/Skipper/SkipCriteriaResolver/SkippedPathsResolver/SkippedPathsResolverTest.php b/tests/Skipper/SkipCriteriaResolver/SkippedPathsResolver/SkippedPathsResolverTest.php index 8edd4fe4af5..6b595049973 100644 --- a/tests/Skipper/SkipCriteriaResolver/SkippedPathsResolver/SkippedPathsResolverTest.php +++ b/tests/Skipper/SkipCriteriaResolver/SkippedPathsResolver/SkippedPathsResolverTest.php @@ -4,6 +4,7 @@ namespace Symplify\EasyCodingStandard\Tests\Skipper\SkipCriteriaResolver\SkippedPathsResolver; +use Override; use Symplify\EasyCodingStandard\Skipper\SkipCriteriaResolver\SkippedPathsResolver; use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractTestCase; @@ -11,6 +12,7 @@ final class SkippedPathsResolverTest extends AbstractTestCase { private SkippedPathsResolver $skippedPathsResolver; + #[Override] protected function setUp(): void { $this->createContainerWithConfigs([__DIR__ . '/config/config.php']); diff --git a/tests/Skipper/Skipper/Skip/SkipSkipperTest.php b/tests/Skipper/Skipper/Skip/SkipSkipperTest.php index e7de925edb0..4d6d7f61f6e 100644 --- a/tests/Skipper/Skipper/Skip/SkipSkipperTest.php +++ b/tests/Skipper/Skipper/Skip/SkipSkipperTest.php @@ -5,6 +5,7 @@ namespace Symplify\EasyCodingStandard\Tests\Skipper\Skipper\Skip; use Iterator; +use Override; use PHPUnit\Framework\Attributes\DataProvider; use Symplify\EasyCodingStandard\Skipper\Skipper\Skipper; use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractTestCase; @@ -16,6 +17,7 @@ final class SkipSkipperTest extends AbstractTestCase { private Skipper $skipper; + #[Override] protected function setUp(): void { $this->createContainerWithConfigs([__DIR__ . '/config/config.php']); diff --git a/tests/Skipper/Skipper/Skipper/SkipperTest.php b/tests/Skipper/Skipper/Skipper/SkipperTest.php index 4a97e9423de..1ec052badaa 100644 --- a/tests/Skipper/Skipper/Skipper/SkipperTest.php +++ b/tests/Skipper/Skipper/Skipper/SkipperTest.php @@ -5,6 +5,7 @@ namespace Symplify\EasyCodingStandard\Tests\Skipper\Skipper\Skipper; use Iterator; +use Override; use PHPUnit\Framework\Attributes\DataProvider; use Symplify\EasyCodingStandard\Skipper\Skipper\Skipper; use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractTestCase; @@ -16,6 +17,7 @@ final class SkipperTest extends AbstractTestCase { private Skipper $skipper; + #[Override] protected function setUp(): void { $this->createContainerWithConfigs([__DIR__ . '/config/config.php']); diff --git a/tests/SniffRunner/Application/FixerTest.php b/tests/SniffRunner/Application/FixerTest.php index 3b43b14e63f..5cece00ccca 100644 --- a/tests/SniffRunner/Application/FixerTest.php +++ b/tests/SniffRunner/Application/FixerTest.php @@ -4,6 +4,7 @@ namespace Symplify\EasyCodingStandard\Tests\SniffRunner\Application; +use Override; use PHP_CodeSniffer\Fixer; use Symplify\EasyCodingStandard\SniffRunner\File\FileFactory; use Symplify\EasyCodingStandard\SniffRunner\ValueObject\File; @@ -15,6 +16,7 @@ final class FixerTest extends AbstractTestCase private File $file; + #[Override] protected function setUp(): void { parent::setUp(); @@ -118,7 +120,10 @@ public function testAddNewline(): void $this->fixer->addNewlineBefore(14); $token = $this->fixer->getTokenContent(14); - $this->assertSame(PHP_EOL . 'Symplify\EasyCodingStandard\Tests\SniffRunner\Application\FixerSource' . PHP_EOL, $token); + $this->assertSame( + PHP_EOL . 'Symplify\EasyCodingStandard\Tests\SniffRunner\Application\FixerSource' . PHP_EOL, + $token + ); } public function testSubstrToken(): void