From 06d46f2ed1c423f1f21cbd19006637561c046ee6 Mon Sep 17 00:00:00 2001 From: Christopher Hertel Date: Wed, 24 Dec 2025 23:51:41 +0100 Subject: [PATCH] House keeping in cs fixer config and makefile --- .php-cs-fixer.dist.php | 36 ++++++++++++++++-------------------- Makefile | 2 +- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 36bd6480..b4da5e23 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,45 +1,41 @@ + * A collaboration between Symfony and the PHP Foundation. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +use PhpCsFixer\Config; +use PhpCsFixer\Finder; +use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; + if (!file_exists(__DIR__.'/src')) { exit(0); } -$fileHeaderParts = [ - <<<'EOF' - This file is part of the official PHP MCP SDK. - - A collaboration between Symfony and the PHP Foundation. +$fileHeader = <<<'EOF' + This file is part of the official PHP MCP SDK. - EOF, - <<<'EOF' + A collaboration between Symfony and the PHP Foundation. - For the full copyright and license information, please view the LICENSE - file that was distributed with this source code. - EOF, -]; + For the full copyright and license information, please view the LICENSE + file that was distributed with this source code. + EOF; -return (new PhpCsFixer\Config()) - // @see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7777 - ->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) +return (new Config()) + ->setParallelConfig(ParallelConfigFactory::detect()) ->setRules([ '@Symfony' => true, '@Symfony:risky' => true, 'protected_to_private' => false, 'declare_strict_types' => false, - 'header_comment' => [ - 'header' => implode('', $fileHeaderParts), - ], + 'header_comment' => ['header' => $fileHeader], 'php_unit_test_case_static_method_calls' => ['call_type' => 'this'], ]) ->setRiskyAllowed(true) - ->setFinder((new PhpCsFixer\Finder())->in(__DIR__)) + ->setFinder((new Finder())->in(__DIR__)) ; diff --git a/Makefile b/Makefile index 119e9d40..c76e0df6 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: deps-stable deps-low cs rector phpstan tests coverage run-examples ci ci-stable ci-lowest +.PHONY: deps-stable deps-low cs phpstan tests unit-tests inspector-tests coverage ci ci-stable ci-lowest deps-stable: composer update --prefer-stable