From f509b829bc0e68497054d1d62538b49566dfbcd4 Mon Sep 17 00:00:00 2001 From: Stefan Hagspiel Date: Mon, 18 Nov 2024 09:07:14 +0100 Subject: [PATCH 1/4] add cla check --- .github/workflows/cla-check.yml | 30 ++++ .github/workflows/codeception.yml | 19 ++- .github/workflows/ecs-fix.yml | 50 ++++++ .github/workflows/ecs.yml | 117 -------------- .github/workflows/php-stan.yml | 16 +- CLA.md | 36 +++++ ISSUE_TEMPLATE.md | 2 +- LICENSE.md | 46 ++++-- README.md | 11 +- composer.json | 6 +- ecs.php | 256 +++++++++++++++--------------- tests/_envs/github.yml | 7 +- tests/_envs/local.yml | 4 +- tests/_etc/config/app/config.yaml | 4 + 14 files changed, 313 insertions(+), 291 deletions(-) create mode 100644 .github/workflows/cla-check.yml create mode 100644 .github/workflows/ecs-fix.yml delete mode 100644 .github/workflows/ecs.yml create mode 100644 CLA.md diff --git a/.github/workflows/cla-check.yml b/.github/workflows/cla-check.yml new file mode 100644 index 00000000..289f6dd6 --- /dev/null +++ b/.github/workflows/cla-check.yml @@ -0,0 +1,30 @@ +name: CLA Check +on: + issue_comment: + types: [ created ] + pull_request_target: + types: [ opened, closed, synchronize ] + +permissions: + actions: write + contents: write + pull-requests: write + statuses: write + +jobs: + cla-assistant: + runs-on: ubuntu-latest + steps: + - name: 'CLA Assistant' + if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' + uses: contributor-assistant/github-action@v2.6.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ACTION_ACCESS_TOKEN }} + with: + path-to-signatures: 'signatures/version1/cla.json' + path-to-document: 'https://github.com/dachcom-digital/pimcore-secure-storage/blob/master/CLA.md' + branch: 'main' + allowlist: bot* + remote-organization-name: 'dachcom-digital' + remote-repository-name: 'cla' \ No newline at end of file diff --git a/.github/workflows/codeception.yml b/.github/workflows/codeception.yml index c3197408..d9a69bcc 100644 --- a/.github/workflows/codeception.yml +++ b/.github/workflows/codeception.yml @@ -40,12 +40,13 @@ jobs: matrix: php: [ 8.3 ] symfony: [ ^6.4 ] - pimcore: [ ~11.3.0 ] + pimcore: [ ~11.4.0 ] include: - - pimcore: ~11.3.0 - template_tag: v2024.2.1 + - pimcore: ~11.4.0 + template_tag: 2024.3 steps: - - uses: actions/checkout@v2 + - uses: nanasess/setup-chromedriver@v2 + - uses: actions/checkout@v4 with: path: lib/test-bundle @@ -98,9 +99,11 @@ jobs: - name: Setup Chromium run: | - nohup $CHROMEWEBDRIVER/chromedriver --url-base=/wd/hub /dev/null 2>&1 & + export DISPLAY=:99 + chromedriver --url-base=/wd/hub --port=9515 & + sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & - - name: Start Webserver and Chrome + - name: Start Symfony Server run: | curl -sS https://get.symfony.com/cli/installer | bash -s -- --install-dir=$HOME/.symfony/bin ~/.symfony/bin/symfony server:start --port=8080 --dir=public --allow-http --no-tls --daemon @@ -108,10 +111,10 @@ jobs: - name: Get Composer Cache Directory id: composer-cache run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" + echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache Composer Downloads - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} diff --git a/.github/workflows/ecs-fix.yml b/.github/workflows/ecs-fix.yml new file mode 100644 index 00000000..6315b70f --- /dev/null +++ b/.github/workflows/ecs-fix.yml @@ -0,0 +1,50 @@ +name: Easy Coding Standards +on: + schedule: + - cron: '0 0 * * SUN' + workflow_dispatch: ~ + +jobs: + ecs-fix: + runs-on: ubuntu-latest + name: "Coding standard refactor" + timeout-minutes: 5 + strategy: + fail-fast: false + matrix: + branch: [ '4.0' ] + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + + - name: Composer install + run: composer install --no-interaction --no-scripts + + - name: Run ECS + run: vendor/bin/ecs check --fix src --config src/ecs.php + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v4 + with: + commit-message: '[CS] Refactor' + author: DACHCOM Bot + title: '[CS] Refactor' + body: | + This PR has been generated automatically to fix code-styles + labels: | + Enhancement + branch: coding-standard/refactor-${{ matrix.branch }} + delete-branch: true + base: ${{ matrix.branch }} + + + - name: Easy Coding Standard Check + continue-on-error: true + run: | + vendor/bin/ecs check ${{ github.workspace }}/lib/test-bundle/src --config ${{ github.workspace }}/lib/test-bundle/ecs.php \ No newline at end of file diff --git a/.github/workflows/ecs.yml b/.github/workflows/ecs.yml deleted file mode 100644 index cfc84ade..00000000 --- a/.github/workflows/ecs.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: Easy Coding Standards -on: - push: - branches: [ 'master' ] - pull_request: - branches: [ 'master' ] - -jobs: - ecs: - runs-on: ubuntu-latest - env: - TEST_BUNDLE_NAME: "SecureStorageBundle" - TEST_BUNDLE_INSTALLER_CLASS: false - TEST_BUNDLE_TEST_DIR: "${{ github.workspace }}/lib/test-bundle/tests" - TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}" - - PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework" - PIMCORE_CODECEPTION_VERSION: "3.0" - - APP_ENV: test - PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/dachcom_bundle_test" - PIMCORE_TEST_URL: "http://localhost" - - SYMFONY_DEPRECATIONS_HELPER: "weak" - PIMCORE_PHP_ERROR_REPORTING: 32767 - - WEBDRIVER_HOST: localhost - WEBDRIVER_URL: "http://localhost:8080/" - - services: - mysql: - image: mysql:8.0 - env: - MYSQL_ROOT_PASSWORD: root - ports: - - 3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - strategy: - matrix: - php: [ 8.3 ] - symfony: [ ^6.4 ] - pimcore: [ ~11.3.0 ] - include: - - pimcore: ~11.3.0 - template_tag: v2024.2.1 - steps: - - uses: actions/checkout@v2 - with: - path: lib/test-bundle - - - name: Generate Application Structure - run: | - git clone -b ${{ matrix.template_tag }} --single-branch --depth 1 https://github.com/pimcore/skeleton.git - mv skeleton/composer.json . - mv skeleton/bin . - mv skeleton/config . - mv skeleton/public . - mv skeleton/src . - mv skeleton/templates . - mv skeleton/var . - rm -r skeleton - - - name: Setup Pimcore Codeception Framework - env: - MATRIX_PIMCORE_VERSION: ${{ matrix.pimcore }} - MATRIX_PIMCORE_TEMPLATE_TAG: ${{ matrix.template_tag }} - run: | - git clone -b ${{ env.PIMCORE_CODECEPTION_VERSION }} --single-branch --depth 1 https://github.com/dachcom-digital/pimcore-codeception-framework.git - ls -al pimcore-codeception-framework - chmod +x ./pimcore-codeception-framework/src/_etc/scripts/setup.sh - ./pimcore-codeception-framework/src/_etc/scripts/setup.sh - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: intl - coverage: none - - - name: Check PHP Version - run: php -v - - - name: Setup MySql - run: | - sudo systemctl start mysql - mysql -uroot -proot -h127.0.0.1 -e "CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;" - - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache Composer Downloads - uses: actions/cache@v1 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: | - ${{ runner.os }}-composer- - - - name: Composer install - env: - TEST_PIMCORE_VERSION: ${{ matrix.pimcore }} - TEST_SYMFONY_VERSION: ${{ matrix.symfony }} - run: | - chmod +x ./pimcore-codeception-framework/src/_etc/scripts/composer.sh - ./pimcore-codeception-framework/src/_etc/scripts/composer.sh - - - name: Assets Install - run: | - bin/console assets:install public --relative --symlink - - - name: Easy Coding Standard Check - continue-on-error: true - run: | - bin/console cache:warmup --env=test - vendor/bin/ecs check ${{ github.workspace }}/lib/test-bundle/src --config ${{ github.workspace }}/lib/test-bundle/ecs.php \ No newline at end of file diff --git a/.github/workflows/php-stan.yml b/.github/workflows/php-stan.yml index b2ba4146..8bc5ecb6 100644 --- a/.github/workflows/php-stan.yml +++ b/.github/workflows/php-stan.yml @@ -39,12 +39,12 @@ jobs: matrix: php: [ 8.3 ] symfony: [ ^6.4 ] - pimcore: [ ~11.3.0 ] + pimcore: [ ~11.4.0 ] include: - - pimcore: ~11.3.0 - template_tag: v2024.2.1 + - pimcore: ~11.4.0 + template_tag: 2024.3 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: path: lib/test-bundle @@ -88,10 +88,10 @@ jobs: - name: Get Composer Cache Directory id: composer-cache run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" + echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache Composer Downloads - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} @@ -110,6 +110,10 @@ jobs: run: | bin/console assets:install public --relative --symlink + - name: Validate Container + run: | + bin/console lint:container + - name: Php Stan run: | bin/console cache:warmup --env=test diff --git a/CLA.md b/CLA.md new file mode 100644 index 00000000..e9e91878 --- /dev/null +++ b/CLA.md @@ -0,0 +1,36 @@ +# Contributor License Agreement + +The following terms are used throughout this agreement: + +- **You** - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity +that controls or is controlled by the legal entity, or is under common control with it. +- **Project** - is an umbrella term that refers to any and all DACHCOM.DIGITAL AG open source projects. +- **Contribution** - any type of work that is submitted to a Project, including any modifications or additions to existing +work. +- **Submitted** - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal +communication with DACHCOM.DIGITAL AG, contributors or maintainers. + +## 1. Grant of Copyright License. +Subject to the terms and conditions of this agreement, You grant to the Projects’ maintainers, contributors, users and +to DACHCOM.DIGITAL AG a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, +prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your contributions and such +derivative works. Except for this license, You reserve all rights, title, and interest in your contributions. + +## 2. Grant of Patent License. +Subject to the terms and conditions of this agreement, You grant to the Projects’ maintainers, contributors, users and +to DACHCOM.DIGITAL AG a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this +section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer your contributions, +where such license applies only to those patent claims licensable by you that are necessarily infringed by your +contribution or by combination of your contribution with the project to which this contribution was submitted. + +If any entity institutes patent litigation - including cross-claim or counterclaim in a lawsuit - against You alleging +that your contribution or any project it was submitted to constitutes or is responsible for direct or contributory +patent infringement, then any patent licenses granted to that entity under this agreement shall terminate as of the date +such litigation is filed. + +## 3. Source of Contribution. +Your contribution is either your original creation, based upon previous work that, to the best of your knowledge, is +covered under an appropriate open source license, and you have the right under that license to submit that work with +modifications, whether created in whole or in part by you, or you have clearly identified the source of the contribution +and any license or other restriction (like related patents, trademarks, and license agreements) of which you are +personally aware. \ No newline at end of file diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 5c9e622a..b42afe3e 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -7,6 +7,6 @@ \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md index 56c1098b..e9e91878 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,22 +1,36 @@ -# License -Copyright (C) 2024 DACHCOM.DIGITAL +# Contributor License Agreement -This software is available under the GNU General Public License version 3 (GPLv3). +The following terms are used throughout this agreement: -### GNU General Public License version 3 (GPLv3) -If you decide to choose the GPLv3 license, you must comply with the following terms: +- **You** - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity +that controls or is controlled by the legal entity, or is under common control with it. +- **Project** - is an umbrella term that refers to any and all DACHCOM.DIGITAL AG open source projects. +- **Contribution** - any type of work that is submitted to a Project, including any modifications or additions to existing +work. +- **Submitted** - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal +communication with DACHCOM.DIGITAL AG, contributors or maintainers. -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. +## 1. Grant of Copyright License. +Subject to the terms and conditions of this agreement, You grant to the Projects’ maintainers, contributors, users and +to DACHCOM.DIGITAL AG a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, +prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your contributions and such +derivative works. Except for this license, You reserve all rights, title, and interest in your contributions. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +## 2. Grant of Patent License. +Subject to the terms and conditions of this agreement, You grant to the Projects’ maintainers, contributors, users and +to DACHCOM.DIGITAL AG a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this +section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer your contributions, +where such license applies only to those patent claims licensable by you that are necessarily infringed by your +contribution or by combination of your contribution with the project to which this contribution was submitted. -You should have received a copy of the GNU General Public License -along with this program. If not, see . +If any entity institutes patent litigation - including cross-claim or counterclaim in a lawsuit - against You alleging +that your contribution or any project it was submitted to constitutes or is responsible for direct or contributory +patent infringement, then any patent licenses granted to that entity under this agreement shall terminate as of the date +such litigation is filed. -[GNU General Public License](https://www.gnu.org/licenses/gpl-3.0.en.html) \ No newline at end of file +## 3. Source of Contribution. +Your contribution is either your original creation, based upon previous work that, to the best of your knowledge, is +covered under an appropriate open source license, and you have the right under that license to submit that work with +modifications, whether created in whole or in part by you, or you have clearly identified the source of the contribution +and any license or other restriction (like related patents, trademarks, and license agreements) of which you are +personally aware. \ No newline at end of file diff --git a/README.md b/README.md index b4dd3433..d058904e 100644 --- a/README.md +++ b/README.md @@ -97,9 +97,12 @@ secure_storage: *** -## Copyright and license -Copyright: [DACHCOM.DIGITAL](http://dachcom-digital.ch) -For licensing details please visit [LICENSE.md](LICENSE.md) - ## Upgrade Info Before updating, please [check our upgrade notes!](UPGRADE.md) + +## License +**DACHCOM.DIGITAL AG**, Löwenhofstrasse 15, 9424 Rheineck, Schweiz +[dachcom.com](https://www.dachcom.com), dcdi@dachcom.ch +Copyright © 2024 DACHCOM.DIGITAL. All rights reserved. + +For licensing details please visit [LICENSE.md](LICENSE.md) \ No newline at end of file diff --git a/composer.json b/composer.json index 786943d1..1341deb7 100755 --- a/composer.json +++ b/composer.json @@ -38,8 +38,8 @@ "codeception/codeception": "^5.0", "codeception/module-symfony": "^3.1", "codeception/module-webdriver": "^4.0", - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-symfony": "^1.0", - "symplify/easy-coding-standard": "~12.0.0" + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-symfony": "^2.0", + "symplify/easy-coding-standard": "~12.2.0" } } diff --git a/ecs.php b/ecs.php index b04a5740..169156ba 100644 --- a/ecs.php +++ b/ecs.php @@ -4,136 +4,130 @@ use Symplify\EasyCodingStandard\Config\ECSConfig; use Symplify\EasyCodingStandard\ValueObject\Set\SetList; -return static function (ECSConfig $ecsConfig): void { - - // B. full sets - $ecsConfig->sets([SetList::CLEAN_CODE, SetList::PSR_12]); - - $ecsConfig->ruleWithConfiguration(Fixer\Basic\BracesFixer::class, [ +$header = <<
withSets([SetList::CLEAN_CODE, SetList::PSR_12]) + ->withConfiguredRule(Fixer\Comment\HeaderCommentFixer::class, [ + 'header' => $header, + 'comment_type' => 'comment' + ]) + ->withConfiguredRule(Fixer\Basic\BracesFixer::class, [ 'allow_single_line_closure' => true, - ]); - - $ecsConfig->rule(Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); - - $ecsConfig->ruleWithConfiguration(Fixer\Operator\ConcatSpaceFixer::class, [ - 'spacing' => 'one', - ] - ); - - $ecsConfig->rule(Fixer\Operator\NewWithBracesFixer::class); - - $ecsConfig->ruleWithConfiguration(Fixer\Phpdoc\PhpdocAlignFixer::class, [ - 'tags' => ['method', 'param', 'property', 'return', 'throws', 'type', 'var'], - ] - ); - - $ecsConfig->ruleWithConfiguration(Fixer\Operator\BinaryOperatorSpacesFixer::class, [ - 'operators' => [ - '=' => 'single_space', - '=>' => 'align', - ] - ] - ); - - $ecsConfig->ruleWithConfiguration(Fixer\Operator\IncrementStyleFixer::class, [ - 'style' => 'post', - ] - ); - - $ecsConfig->rule(Fixer\Operator\UnaryOperatorSpacesFixer::class); - $ecsConfig->rule(Fixer\Whitespace\BlankLineBeforeStatementFixer::class); - $ecsConfig->rule(Fixer\CastNotation\CastSpacesFixer::class); - $ecsConfig->rule(Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); - $ecsConfig->rule(Fixer\FunctionNotation\FunctionTypehintSpaceFixer::class); - $ecsConfig->ruleWithConfiguration(Fixer\Comment\SingleLineCommentStyleFixer::class, [ - 'comment_types' => ['hash'], + ]) + ->withConfiguredRule(Fixer\Operator\ConcatSpaceFixer::class, [ + 'spacing' => 'one', + ]) + ->withConfiguredRule(Fixer\Phpdoc\PhpdocAlignFixer::class, [ + 'tags' => ['method', 'param', 'property', 'return', 'throws', 'type', 'var'], + ]) + ->withConfiguredRule(Fixer\Operator\BinaryOperatorSpacesFixer::class, [ + 'operators' => [ + '=' => 'single_space', + '=>' => 'align', ] - ); - - $ecsConfig->rule(Fixer\ControlStructure\IncludeFixer::class); - $ecsConfig->rule(Fixer\CastNotation\LowercaseCastFixer::class); - $ecsConfig->ruleWithConfiguration(Fixer\ClassNotation\ClassAttributesSeparationFixer::class, [ - 'elements' => [ - 'const' => 'none', - 'method' => 'one', - 'property' => 'none', - 'trait_import' => 'none' - ], - ] - ); - - $ecsConfig->rule(Fixer\Casing\NativeFunctionCasingFixer::class); - $ecsConfig->rule(Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer::class); - $ecsConfig->rule(Fixer\Comment\NoEmptyCommentFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\NoEmptyPhpdocFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocSeparationFixer::class); - $ecsConfig->rule(Fixer\Semicolon\NoEmptyStatementFixer::class); - $ecsConfig->rule(Fixer\Whitespace\ArrayIndentationFixer::class); - $ecsConfig->ruleWithConfiguration(Fixer\Whitespace\NoExtraBlankLinesFixer::class, [ - 'tokens' => ['curly_brace_block', 'extra', 'parenthesis_brace_block', 'square_brace_block', 'throw', 'use'], - ] - ); - - $ecsConfig->rule(Fixer\NamespaceNotation\NoLeadingNamespaceWhitespaceFixer::class); - $ecsConfig->rule(Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer::class); - $ecsConfig->rule(Fixer\CastNotation\NoShortBoolCastFixer::class); - $ecsConfig->rule(Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer::class); - $ecsConfig->rule(Fixer\Whitespace\NoSpacesAroundOffsetFixer::class); - $ecsConfig->rule(Fixer\ControlStructure\NoTrailingCommaInListCallFixer::class); - $ecsConfig->rule(Fixer\ControlStructure\NoUnneededControlParenthesesFixer::class); - $ecsConfig->rule(Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class); - $ecsConfig->rule(Fixer\Whitespace\NoWhitespaceInBlankLineFixer::class); - $ecsConfig->rule(Fixer\ArrayNotation\NormalizeIndexBraceFixer::class); - $ecsConfig->rule(Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocAnnotationWithoutDotFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocIndentFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocInlineTagNormalizerFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocNoAccessFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocNoEmptyReturnFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocNoPackageFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocReturnSelfReferenceFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocScalarFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocSummaryFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocToCommentFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocTrimFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocTypesFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocVarWithoutNameFixer::class); - $ecsConfig->rule(Fixer\FunctionNotation\ReturnTypeDeclarationFixer::class); - $ecsConfig->rule(Fixer\ClassNotation\SelfAccessorFixer::class); - $ecsConfig->rule(Fixer\CastNotation\ShortScalarCastFixer::class); - $ecsConfig->rule(Fixer\StringNotation\SingleQuoteFixer::class); - $ecsConfig->rule(Fixer\Semicolon\SpaceAfterSemicolonFixer::class); - $ecsConfig->rule(Fixer\Operator\StandardizeNotEqualsFixer::class); - $ecsConfig->rule(Fixer\Operator\TernaryOperatorSpacesFixer::class); - $ecsConfig->rule(Fixer\ArrayNotation\TrimArraySpacesFixer::class); - $ecsConfig->rule(Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer::class); - $ecsConfig->rule(Fixer\Import\NoUnusedImportsFixer::class); - - $ecsConfig->ruleWithConfiguration(Fixer\ClassNotation\ClassDefinitionFixer::class, [ - 'single_line' => true, - ] - ); - - $ecsConfig->rule(Fixer\Casing\MagicConstantCasingFixer::class); - $ecsConfig->rule(Fixer\FunctionNotation\MethodArgumentSpaceFixer::class); - $ecsConfig->ruleWithConfiguration(Fixer\Alias\NoMixedEchoPrintFixer::class, [ - 'use' => 'echo', - ] - ); - - $ecsConfig->rule(Fixer\Import\NoLeadingImportSlashFixer::class); - $ecsConfig->rule(Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer::class); - $ecsConfig->rule(Fixer\Phpdoc\PhpdocNoAliasTagFixer::class); - $ecsConfig->rule(Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer::class); - $ecsConfig->rule(Fixer\ClassNotation\SingleClassElementPerStatementFixer::class); - - # new since PHP-CS-Fixer 2.6 - $ecsConfig->rule(Fixer\ClassNotation\NoUnneededFinalMethodFixer::class); - $ecsConfig->rule(Fixer\Semicolon\SemicolonAfterInstructionFixer::class); - - # new since 2.11 - $ecsConfig->rule(Fixer\Operator\StandardizeIncrementFixer::class); -}; + ]) + ->withConfiguredRule(Fixer\Operator\IncrementStyleFixer::class, [ + 'style' => 'post', + ]) + ->withConfiguredRule(Fixer\ClassNotation\ClassAttributesSeparationFixer::class, [ + 'elements' => [ + 'const' => 'none', + 'method' => 'one', + 'property' => 'none', + 'trait_import' => 'none' + ], + ]) + ->withConfiguredRule(Fixer\ClassNotation\ClassDefinitionFixer::class, [ + 'single_line' => true, + ]) + ->withConfiguredRule(Fixer\Comment\SingleLineCommentStyleFixer::class, [ + 'comment_types' => ['hash'], + ]) + ->withConfiguredRule(Fixer\Alias\NoMixedEchoPrintFixer::class, [ + 'use' => 'echo', + ]) + ->withConfiguredRule(Fixer\Basic\NoTrailingCommaInSinglelineFixer::class, [ + 'elements' => ['array_destructuring'] + ]) + ->withConfiguredRule(Fixer\NamespaceNotation\BlankLinesBeforeNamespaceFixer::class, [ + 'min_line_breaks' => 2, + 'max_line_breaks' => 2 + ]) + ->withConfiguredRule(Fixer\Whitespace\TypeDeclarationSpacesFixer::class, [ + 'elements' => ['function'] + ]) + ->withConfiguredRule(Fixer\Whitespace\NoExtraBlankLinesFixer::class, [ + 'tokens' => ['curly_brace_block', 'extra', 'parenthesis_brace_block', 'square_brace_block', 'throw', 'use'], + ]) + ->withRules([ + Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class, + Fixer\Operator\NewWithParenthesesFixer::class, + Fixer\Operator\UnaryOperatorSpacesFixer::class, + Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer::class, + Fixer\Operator\StandardizeNotEqualsFixer::class, + Fixer\Operator\TernaryOperatorSpacesFixer::class, + Fixer\Operator\StandardizeIncrementFixer::class, + Fixer\Whitespace\BlankLineBeforeStatementFixer::class, + Fixer\Whitespace\ArrayIndentationFixer::class, + Fixer\Whitespace\NoSpacesAroundOffsetFixer::class, + Fixer\Whitespace\NoWhitespaceInBlankLineFixer::class, + Fixer\CastNotation\CastSpacesFixer::class, + Fixer\CastNotation\LowercaseCastFixer::class, + Fixer\CastNotation\NoShortBoolCastFixer::class, + Fixer\CastNotation\ShortScalarCastFixer::class, + Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class, + Fixer\ControlStructure\IncludeFixer::class, + Fixer\ControlStructure\NoUnneededControlParenthesesFixer::class, + Fixer\Casing\NativeFunctionCasingFixer::class, + Fixer\Casing\MagicConstantCasingFixer::class, + Fixer\Comment\NoEmptyCommentFixer::class, + Fixer\NamespaceNotation\NoLeadingNamespaceWhitespaceFixer::class, + Fixer\Semicolon\NoEmptyStatementFixer::class, + Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer::class, + Fixer\Semicolon\SpaceAfterSemicolonFixer::class, + Fixer\Semicolon\SemicolonAfterInstructionFixer::class, + Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class, + Fixer\ArrayNotation\NormalizeIndexBraceFixer::class, + Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer::class, + Fixer\ArrayNotation\TrimArraySpacesFixer::class, + Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer::class, + Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer::class, + Fixer\Phpdoc\PhpdocAnnotationWithoutDotFixer::class, + Fixer\Phpdoc\PhpdocIndentFixer::class, + Fixer\Phpdoc\PhpdocInlineTagNormalizerFixer::class, + Fixer\Phpdoc\PhpdocNoAccessFixer::class, + Fixer\Phpdoc\PhpdocNoEmptyReturnFixer::class, + Fixer\Phpdoc\PhpdocNoPackageFixer::class, + Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer::class, + Fixer\Phpdoc\PhpdocReturnSelfReferenceFixer::class, + Fixer\Phpdoc\PhpdocScalarFixer::class, + Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer::class, + Fixer\Phpdoc\PhpdocSummaryFixer::class, + Fixer\Phpdoc\PhpdocToCommentFixer::class, + Fixer\Phpdoc\PhpdocTrimFixer::class, + Fixer\Phpdoc\PhpdocTypesFixer::class, + Fixer\Phpdoc\NoEmptyPhpdocFixer::class, + Fixer\Phpdoc\PhpdocSeparationFixer::class, + Fixer\Phpdoc\PhpdocVarWithoutNameFixer::class, + Fixer\Phpdoc\PhpdocNoAliasTagFixer::class, + Fixer\FunctionNotation\ReturnTypeDeclarationFixer::class, + Fixer\FunctionNotation\MethodArgumentSpaceFixer::class, + Fixer\StringNotation\SingleQuoteFixer::class, + Fixer\Import\NoUnusedImportsFixer::class, + Fixer\Import\NoLeadingImportSlashFixer::class, + Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer::class, + Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer::class, + Fixer\ClassNotation\SelfAccessorFixer::class, + Fixer\ClassNotation\SingleClassElementPerStatementFixer::class, + Fixer\ClassNotation\NoUnneededFinalMethodFixer::class + ]); \ No newline at end of file diff --git a/tests/_envs/github.yml b/tests/_envs/github.yml index efc66736..99f9fbe0 100644 --- a/tests/_envs/github.yml +++ b/tests/_envs/github.yml @@ -1,12 +1,13 @@ modules: config: - \Dachcom\Codeception\Helper\Browser\WebDriver: + \Dachcom\Codeception\Support\Helper\Browser\WebDriver: browser: chrome port: 9515 restart: true wait: 1 + window_size: 1280x1024 capabilities: - chromeOptions: - args: ['--no-sandbox', '--disable-extensions', '--headless', '--disable-gpu', '--disable-dev-shm-usage', '--window-size=1024,768'] + 'goog:chromeOptions': + args: ['--no-sandbox', '--disable-extensions', '--headless', '--disable-gpu', '--disable-dev-shm-usage', '--window-size=1280,1024'] prefs: download.default_directory: '%TEST_BUNDLE_TEST_DIR%/_data/downloads' \ No newline at end of file diff --git a/tests/_envs/local.yml b/tests/_envs/local.yml index 8012f3c8..605a31f5 100644 --- a/tests/_envs/local.yml +++ b/tests/_envs/local.yml @@ -1,10 +1,10 @@ modules: config: - \Dachcom\Codeception\Helper\Browser\WebDriver: + \Dachcom\Codeception\Support\Helper\Browser\WebDriver: browser: chrome port: 4444 restart: true wait: 1 capabilities: chromeOptions: - args: ['--no-sandbox', '--disable-extensions', '--headless', '--disable-gpu', '--disable-dev-shm-usage', '--window-size=1024,768'] + args: ['--disable-extensions', '--headless', '--disable-gpu', '--disable-dev-shm-usage', '--window-size=1280,1024'] diff --git a/tests/_etc/config/app/config.yaml b/tests/_etc/config/app/config.yaml index 7ac9dbdf..b5f83ed0 100755 --- a/tests/_etc/config/app/config.yaml +++ b/tests/_etc/config/app/config.yaml @@ -11,6 +11,10 @@ services: - [setContainer, ['@service_container']] doctrine: + orm: + entity_managers: + default: + connection: default dbal: connections: default: From 8e706e3b65b20e8fcd72db984f354b9e34157693 Mon Sep 17 00:00:00 2001 From: Stefan Hagspiel Date: Mon, 18 Nov 2024 09:10:13 +0100 Subject: [PATCH 2/4] fix phpstan config --- phpstan.neon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 334b250e..652ce700 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,5 +5,5 @@ parameters: - %currentWorkingDirectory%/vendor/pimcore/pimcore/stubs/dynamic-constants.php reportUnmatchedIgnoredErrors: false symfony: - container_xml_path: %currentWorkingDirectory%/var/cache/test/TestKernelTestDebugContainer.xml - constant_hassers: false + containerXmlPath: %currentWorkingDirectory%/var/cache/test/TestKernelTestDebugContainer.xml + constantHassers: false From b35a0951fe845d89e83cdd4772d4c9968e628a60 Mon Sep 17 00:00:00 2001 From: Stefan Hagspiel Date: Mon, 18 Nov 2024 09:11:30 +0100 Subject: [PATCH 3/4] enable worfklow_dispatch --- .github/workflows/ecs-fix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ecs-fix.yml b/.github/workflows/ecs-fix.yml index 6315b70f..8d4a7e38 100644 --- a/.github/workflows/ecs-fix.yml +++ b/.github/workflows/ecs-fix.yml @@ -2,7 +2,7 @@ name: Easy Coding Standards on: schedule: - cron: '0 0 * * SUN' - workflow_dispatch: ~ + workflow_dispatch: jobs: ecs-fix: From b39af6f396cdfcb323dda03195a4f965c355c777 Mon Sep 17 00:00:00 2001 From: Stefan Hagspiel Date: Mon, 18 Nov 2024 09:49:42 +0100 Subject: [PATCH 4/4] fix phpstan issue --- src/Encrypter/OpenSslEncrypter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Encrypter/OpenSslEncrypter.php b/src/Encrypter/OpenSslEncrypter.php index f2081663..080033be 100644 --- a/src/Encrypter/OpenSslEncrypter.php +++ b/src/Encrypter/OpenSslEncrypter.php @@ -184,7 +184,7 @@ private function decryptClosingData(): mixed return $processed; } - private function handleIv($in, $out, &$consumed): void + private function handleIv($in, $out, int &$consumed): void { if ($this->iv !== null) { return;