diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ab5e719 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +/.* export-ignore +/docs export-ignore +/tests export-ignore +/phpunit.xml.dist export-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3152a1..fa595fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,24 +12,38 @@ on: jobs: tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: php-version: - '8.0' - '8.1' + - '8.2' + - '8.3' symfony-version: - - '5.3.*' - '5.4.*' - - '6.0.*' + - '6.4.*' dependencies: - 'lowest' - 'highest' remove-dependencies: [ '' ] + include: + - php-version: '8.2' + symfony-version: '7.0.*' + dependencies: 'highest' + remove-dependencies: 'sensio/framework-extra-bundle' + - php-version: '8.3' + symfony-version: '7.0.*' + dependencies: 'highest' + remove-dependencies: 'sensio/framework-extra-bundle' + exclude: + - php-version: '8.0' + symfony-version: '6.4.*' + steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v4" - name: "Install PHP" uses: "shivammathur/setup-php@v2" @@ -48,10 +62,10 @@ jobs: - name: Remove dependencies if: "matrix.remove-dependencies != ''" - run: composer remove --no-update ${{ matrix.remove-dependencies }} + run: composer remove --dev --no-update ${{ matrix.remove-dependencies }} - name: "Install dependencies" - uses: ramsey/composer-install@1.3.0 + uses: ramsey/composer-install@3.0.0 with: dependency-versions: ${{ matrix.dependencies }} env: @@ -61,20 +75,20 @@ jobs: run: composer test coding-standard: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 name: Coding Standard steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v4" - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: tools: flex - php-version: "8.0" + php-version: "8.3" - name: "Install dependencies" - uses: ramsey/composer-install@1.3.0 + uses: ramsey/composer-install@3.0.0 - name: "Check coding standard" run: composer check-cs diff --git a/.gitignore b/.gitignore index f89622e..f26e2e6 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,6 @@ phpunit.xml composer.lock composer.phar .php_cs.cache -.php_cs +.php-cs-fixer.cache php-cs-fixer.phar /.phpunit.result.cache diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 53% rename from .php_cs.dist rename to .php-cs-fixer.dist.php index 1c2bebd..fc2d462 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.dist.php @@ -1,21 +1,21 @@ exclude('vendor') ->name('*.php') ->in(__DIR__) ; -return PhpCsFixer\Config::create() +return (new PhpCsFixer\Config()) ->setRules( [ '@Symfony' => true, - 'single_blank_line_before_namespace' => true, 'ordered_imports' => true, 'concat_space' => ['spacing' => 'none'], - 'phpdoc_no_alias_tag' => ['type' => 'var'], + 'phpdoc_no_alias_tag' => ['replacements' => ['type' => 'var']], 'no_mixed_echo_print' => ['use' => 'echo'], - 'binary_operator_spaces' => ['align_double_arrow' => false, 'align_equals' => false], + 'binary_operator_spaces' => ['operators' => ['=>' => 'single_space', '=' => 'single_space']], + 'no_superfluous_phpdoc_tags' => false, ] ) ->setFinder($finder) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a3450b0..c763672 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,13 +7,13 @@ Running tests In the bundle directory: ```bash -./vendor/bin/phpunit +./bin/phpunit ``` Giving some love to PHP CS --------------------------- ```bash -composer require --dev 'friendsofphp/php-cs-fixer:^2.0' +composer require --dev 'friendsofphp/php-cs-fixer:^3.53' bin/php-cs-fixer fix ``` diff --git a/composer.json b/composer.json index f20ab0c..ab2bbca 100644 --- a/composer.json +++ b/composer.json @@ -22,25 +22,24 @@ }, "require": { "php": "^8.0", - "symfony/http-foundation": "^5.3.7 || ^6.0", - "symfony/twig-bundle": "^5.3.7 || ^6.0", - "symfony/routing": "^5.3.7 || ^6.0" + "symfony/http-foundation": "^5.3.7 || ^6.0 || ^7.0", + "symfony/twig-bundle": "^5.3.7 || ^6.0 || ^7.0", + "symfony/routing": "^5.3.7 || ^6.0 || ^7.0" }, "require-dev": { - "overblog/graphql-bundle": "dev-master", - "webonyx/graphql-php": "dev-master", + "overblog/graphql-bundle": "^1.0", + "webonyx/graphql-php": "^15.4", "phpunit/phpunit": "^9.5.10", "sensio/framework-extra-bundle": "^6.2", - "symfony/browser-kit": "^5.3 || ^6.0", - "symfony/config": "^5.3.7 || ^6.0", - "symfony/console": "^5.3.7 || ^6.0", - "symfony/dependency-injection": "^5.3.7 || ^6.0", - "symfony/dom-crawler": "^5.3.7 || ^6.0", - "symfony/expression-language": "^5.3.7 || ^6.0", - "symfony/framework-bundle": "^5.3.7 || ^6.0", - "symfony/finder": "^5.3.7 || ^6.0", - "symfony/templating": "^5.3.7 || ^6.0", - "symfony/yaml": "^5.3.7 || ^6.0", + "symfony/browser-kit": "^5.3 || ^6.0 || ^7.0", + "symfony/config": "^5.3.7 || ^6.0 || ^7.0", + "symfony/console": "^5.3.7 || ^6.0 || ^7.0", + "symfony/dependency-injection": "^5.3.7 || ^6.0 || ^7.0", + "symfony/dom-crawler": "^5.3.7 || ^6.0 || ^7.0", + "symfony/expression-language": "^5.3.7 || ^6.0 || ^7.0", + "symfony/framework-bundle": "^5.3.7 || ^6.0 || ^7.0", + "symfony/finder": "^5.3.7 || ^6.0 || ^7.0", + "symfony/yaml": "^5.3.7 || ^6.0 || ^7.0", "twig/twig": "^3.3.3" }, "autoload": { @@ -56,7 +55,7 @@ }, "scripts": { "test": "bin/phpunit --color=always", - "install-cs": "test -f php-cs-fixer.phar || wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.18.7/php-cs-fixer.phar -O php-cs-fixer.phar", + "install-cs": "test -f php-cs-fixer.phar || wget https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/download/v3.53.0/php-cs-fixer.phar -O php-cs-fixer.phar", "fix-cs": [ "@install-cs", "@php php-cs-fixer.phar fix --diff -v --allow-risky=yes --ansi" diff --git a/src/DependencyInjection/Compiler/Endpoints/DefaultEndpointWiringPass.php b/src/DependencyInjection/Compiler/Endpoints/DefaultEndpointWiringPass.php index f0994e4..a9eaee6 100644 --- a/src/DependencyInjection/Compiler/Endpoints/DefaultEndpointWiringPass.php +++ b/src/DependencyInjection/Compiler/Endpoints/DefaultEndpointWiringPass.php @@ -9,8 +9,8 @@ final class DefaultEndpointWiringPass implements CompilerPassInterface { - //@todo https://github.com/symfony/symfony/blob/master/src/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php - public function process(ContainerBuilder $container) + // @todo https://github.com/symfony/symfony/blob/master/src/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php + public function process(ContainerBuilder $container): void { $endpointDefinition = $container->getDefinition('overblog_graphiql.controller.graphql.endpoint'); diff --git a/src/DependencyInjection/Compiler/Endpoints/OverblogGraphQLBundleEndpointWiringPass.php b/src/DependencyInjection/Compiler/Endpoints/OverblogGraphQLBundleEndpointWiringPass.php index 693f7b5..e0b91bd 100644 --- a/src/DependencyInjection/Compiler/Endpoints/OverblogGraphQLBundleEndpointWiringPass.php +++ b/src/DependencyInjection/Compiler/Endpoints/OverblogGraphQLBundleEndpointWiringPass.php @@ -9,7 +9,7 @@ final class OverblogGraphQLBundleEndpointWiringPass implements CompilerPassInterface { - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { $bundles = $container->getParameter('kernel.bundles_metadata');