From ea0b55d968f92b99fcb5749a4b8ae5ab3f755382 Mon Sep 17 00:00:00 2001 From: Glynn Quelch Date: Thu, 16 Apr 2026 23:58:26 +0100 Subject: [PATCH 1/3] chore(deps): align with shared composer standard --- README.md | 1 + composer.json | 34 ++++++++++++++++++---------------- src/Application/App.php | 4 ++-- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 62d48e0..bf6f1db 100644 --- a/README.md +++ b/README.md @@ -363,6 +363,7 @@ http://www.opensource.org/licenses/mit-license.html ## Change Log ## +* 2.1.2 - Updated dev dependencies. * 2.1.1 - Remove the attempt to resolve dot notation in the base view path of the PHP_Engine, as this was causing issues when servers have . in folder names. * 2.1.0 - Updated to WP6.6, changed PHPCS rules and added a number of new helpers to App_Config. * App_Config::asset_url() - Returns the full URL to an asset. diff --git a/composer.json b/composer.json index 50effb0..41ab91c 100644 --- a/composer.json +++ b/composer.json @@ -23,42 +23,44 @@ "files": ["tests/Fixtures/functions.php"] }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.0", - "phpstan/phpstan": "1.*", - "szepeviktor/phpstan-wordpress": "<=1.3.2", - "php-stubs/wordpress-stubs": "6.6.*", - "roots/wordpress": "6.6.*", - "wp-phpunit/wp-phpunit": "6.6.*", + "phpunit/phpunit": "^8.0 || ^9.0", + "phpstan/phpstan": "^2.0", + "szepeviktor/phpstan-wordpress": "^2.0", + "php-stubs/wordpress-stubs": "6.9.*", + "roots/wordpress": "6.9.*", + "wp-phpunit/wp-phpunit": "6.9.*", "wp-cli/i18n-command": "*", "squizlabs/php_codesniffer": "3.*", "dealerdirect/phpcodesniffer-composer-installer": "*", "roave/security-advisories": "dev-latest", - "wp-coding-standards/wpcs": "^3", + "wp-coding-standards/wpcs": "*", "yoast/phpunit-polyfills": "^1.0.0 || ^2.0.0", - "symfony/var-dumper": "<=6.2.7", - "gin0115/wpunit-helpers": "1.1.*", - "vlucas/phpdotenv": "<=5.5.0", + "symfony/var-dumper": "*", + "gin0115/wpunit-helpers": "~1", + "vlucas/phpdotenv": "^5.4", "doctrine/instantiator": "^1.5", "phpcompatibility/php-compatibility": "*" }, "require": { - "php": ">=7.4.0", + "php": ">=8.0.0", "gin0115/dice": "4.1.*", "psr/container": "^1.0 || ^2.0", "pinkcrab/hook-loader": "^1.1", "pinkcrab/function-constructors": "0.2.*" }, "scripts": { - "test": "./vendor/bin/phpunit --coverage-clover clover.xml --testdox --colors=always", - "coverage": "./vendor/bin/phpunit --coverage-html coverage-report --testdox --colors=always", - "analyse": "./vendor/bin/phpstan analyse src -l8", + "test": "vendor/bin/phpunit --colors=always --testdox --coverage-clover clover.xml", + "coverage": "vendor/bin/phpunit --colors=always --testdox --coverage-html coverage-report", + "analyse": "vendor/bin/phpstan analyse src -l8", "sniff": "./vendor/bin/phpcs src/ -v", - "all": "composer test && composer analyse && composer sniff", + "all": "composer coverage && composer analyse && composer sniff", "format": "./vendor/bin/phpcbf src -v", "mutation": "./vendor/bin/infection", "coverage:unit": "./vendor/bin/phpunit --coverage-html coverage-report --testdox --colors=always --group unit", "coverage:integration": "./vendor/bin/phpunit --coverage-html coverage-report --testdox --colors=always --group integration" }, + "minimum-stability": "dev", + "prefer-stable": true, "config": { "allow-plugins": { "roots/wordpress-core-installer": true, @@ -66,4 +68,4 @@ "infection/extension-installer": true } } -} \ No newline at end of file +} diff --git a/src/Application/App.php b/src/Application/App.php index bc4b9e5..54cdee9 100644 --- a/src/Application/App.php +++ b/src/Application/App.php @@ -168,14 +168,14 @@ public function set_app_config( array $settings ): self { // Ensure the base path and url are defined from app. $settings['path'] = $settings['path'] ?? array(); $settings['path']['plugin'] = $this->base_path; - $settings['path']['view'] = $this->view_path ?? App_Config_Path_Helper::assume_view_path( $this->base_path ); + $settings['path']['view'] = $this->view_path; // Get the url from the base path. $settings['url'] = $settings['url'] ?? array(); $settings['url']['plugin'] = App_Config_Path_Helper::assume_base_url( $this->base_path ); $settings['url']['view'] = App_Config_Path_Helper::assume_view_url( $this->base_path, - $this->view_path ?? App_Config_Path_Helper::assume_view_path( $this->base_path ) + $this->view_path ); self::$app_config = new App_Config( $settings ); From 9999eb6ff7a5e40463965b10c03ac935fe8a3fa4 Mon Sep 17 00:00:00 2001 From: Glynn Quelch Date: Fri, 17 Apr 2026 00:06:11 +0100 Subject: [PATCH 2/3] chore(ci): align workflows with shared CI standard Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/WP_6_4.yaml | 64 ------------------ .github/workflows/WP_6_5.yaml | 65 ------------------- .github/workflows/WP_6_6.yaml | 24 ++++--- .../workflows/{WP_6_1.yaml => WP_6_7.yaml} | 30 ++++----- .../workflows/{WP_6_2.yaml => WP_6_8.yaml} | 33 +++++----- .../workflows/{WP_6_3.yaml => WP_6_9.yaml} | 33 +++++----- 6 files changed, 59 insertions(+), 190 deletions(-) delete mode 100644 .github/workflows/WP_6_4.yaml delete mode 100644 .github/workflows/WP_6_5.yaml rename .github/workflows/{WP_6_1.yaml => WP_6_7.yaml} (68%) rename .github/workflows/{WP_6_2.yaml => WP_6_8.yaml} (63%) rename .github/workflows/{WP_6_3.yaml => WP_6_9.yaml} (63%) diff --git a/.github/workflows/WP_6_4.yaml b/.github/workflows/WP_6_4.yaml deleted file mode 100644 index 8b56fae..0000000 --- a/.github/workflows/WP_6_4.yaml +++ /dev/null @@ -1,64 +0,0 @@ -name: WP6.4 [PHP7.4-8.3] Tests - -on: - push: - branches: [ master ] - pull_request: - branches: [ master, develop, feature/v2-sandbox ] - -jobs: - build: - strategy: - matrix: - operating-system: [ubuntu-latest] - php-versions: [ '7.4', '8.0', '8.1', '8.2', '8.3'] - runs-on: ${{ matrix.operating-system }} - services: - # Setup MYSQL - mysql-service: - image: 'mysql:5.7' - env: - MYSQL_ROOT_PASSWORD: 'crab' - MYSQL_DATABASE: pc_core_tests - ports: - - 3306:3306 - options: >- - --health-cmd="mysqladmin ping" - --health-interval=10s - --health-timeout=5s - --health-retries=3 - - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: mbstring, intl, pcov - ini-values: post_max_size=256M, log_errors=1 - tools: pecl - - - name: Check PHP Version - run: php -v - - - name: Clear existing composer - run: > - sudo rm -rf vendor - && rm -rf composer.lock - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Install dependencies - run: > - rm -rf composer.lock - && composer clearcache - && composer require php-stubs/wordpress-stubs:6.4.* --dev --no-update - && composer require roots/wordpress:6.4.* --dev --no-update - && composer require wp-phpunit/wp-phpunit:6.4.* --dev --no-update - && composer update --no-cache - - - name: Run Tests on Latest Version - WP6.4 - env: - environment_github: true - run: composer all diff --git a/.github/workflows/WP_6_5.yaml b/.github/workflows/WP_6_5.yaml deleted file mode 100644 index 6a01a4c..0000000 --- a/.github/workflows/WP_6_5.yaml +++ /dev/null @@ -1,65 +0,0 @@ -name: WP6.5 [PHP7.4-8.3] Tests - -on: - push: - branches: [ master ] - pull_request: - branches: [ master, develop, feature/v2-sandbox ] - -jobs: - build: - strategy: - matrix: - operating-system: [ubuntu-latest] - php-versions: [ '7.4', '8.0', '8.1', '8.2', '8.3'] - runs-on: ${{ matrix.operating-system }} - services: - # Setup MYSQL - mysql-service: - image: 'mysql:5.7' - env: - MYSQL_ROOT_PASSWORD: 'crab' - MYSQL_DATABASE: pc_core_tests - ports: - - 3306:3306 - options: >- - --health-cmd="mysqladmin ping" - --health-interval=10s - --health-timeout=5s - --health-retries=3 - - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: mbstring, intl, pcov - ini-values: post_max_size=256M, log_errors=1 - tools: pecl - - - name: Check PHP Version - run: php -v - - - name: Clear existing composer - run: > - sudo rm -rf vendor - && rm -rf composer.lock - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Install dependencies - run: > - rm -rf composer.lock - && composer clearcache - && composer require php-stubs/wordpress-stubs:6.5.* --dev --no-update - && composer require roots/wordpress:6.5.* --dev --no-update - && composer require wp-phpunit/wp-phpunit:6.5.* --dev --no-update - && composer update --no-cache - - - name: Run Tests on Latest Version - WP6.5 - env: - environment_github: true - run: composer all - \ No newline at end of file diff --git a/.github/workflows/WP_6_6.yaml b/.github/workflows/WP_6_6.yaml index 5e460e6..e04f7f9 100644 --- a/.github/workflows/WP_6_6.yaml +++ b/.github/workflows/WP_6_6.yaml @@ -1,4 +1,4 @@ -name: WP6.6 [PHP7.4-8.3] Tests +name: WordPress 6.6 Test Suite [PHP8.0-8.4] on: push: @@ -11,23 +11,22 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4'] runs-on: ${{ matrix.operating-system }} services: - # Setup MYSQL mysql-service: - image: 'mysql:5.7' + image: mysql:8.4 env: MYSQL_ROOT_PASSWORD: 'crab' MYSQL_DATABASE: pc_core_tests ports: - 3306:3306 options: >- - --health-cmd="mysqladmin ping" + --health-cmd="healthcheck.sh --connect || mysqladmin ping -uroot -pcrab" --health-interval=10s - --health-timeout=5s - --health-retries=3 - + --health-timeout=10s + --health-retries=10 + steps: - name: Checkout uses: actions/checkout@v2 @@ -44,25 +43,24 @@ jobs: - name: Clear existing composer run: > - sudo rm -rf vendor - && rm -rf composer.lock + sudo rm -rf vendor + && rm -rf composer.lock - name: Validate composer.json and composer.lock run: composer validate - name: Install dependencies run: > - rm -rf composer.lock + rm -rf composer.lock && composer clearcache && composer require php-stubs/wordpress-stubs:6.6.* --dev --no-update && composer require roots/wordpress:6.6.* --dev --no-update && composer require wp-phpunit/wp-phpunit:6.6.* --dev --no-update && composer update --no-cache - - name: Run Tests on Latest Version - WP6.6 + - name: Run Tests on WP6.6 env: environment_github: true run: composer all - name: Codecov run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CORE_CODEV }} - \ No newline at end of file diff --git a/.github/workflows/WP_6_1.yaml b/.github/workflows/WP_6_7.yaml similarity index 68% rename from .github/workflows/WP_6_1.yaml rename to .github/workflows/WP_6_7.yaml index f315abd..19b3988 100644 --- a/.github/workflows/WP_6_1.yaml +++ b/.github/workflows/WP_6_7.yaml @@ -1,4 +1,4 @@ -name: WP6.1 [PHP7.4-8.3] Tests +name: WordPress 6.7 Test Suite [PHP8.0-8.4] on: push: @@ -11,23 +11,22 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: [ '7.4', '8.0', '8.1', '8.2', '8.3'] + php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4'] runs-on: ${{ matrix.operating-system }} services: - # Setup MYSQL mysql-service: - image: 'mysql:5.7' + image: mysql:8.4 env: MYSQL_ROOT_PASSWORD: 'crab' MYSQL_DATABASE: pc_core_tests ports: - 3306:3306 options: >- - --health-cmd="mysqladmin ping" + --health-cmd="healthcheck.sh --connect || mysqladmin ping -uroot -pcrab" --health-interval=10s - --health-timeout=5s - --health-retries=3 - + --health-timeout=10s + --health-retries=10 + steps: - name: Checkout uses: actions/checkout@v2 @@ -44,25 +43,24 @@ jobs: - name: Clear existing composer run: > - sudo rm -rf vendor - && rm -rf composer.lock + sudo rm -rf vendor + && rm -rf composer.lock - name: Validate composer.json and composer.lock run: composer validate - name: Install dependencies run: > - rm -rf composer.lock + rm -rf composer.lock && composer clearcache - && composer require php-stubs/wordpress-stubs:6.1.* --dev --no-update - && composer require roots/wordpress:6.1.* --dev --no-update - && composer require wp-phpunit/wp-phpunit:6.1.* --dev --no-update + && composer require php-stubs/wordpress-stubs:6.7.* --dev --no-update + && composer require roots/wordpress:6.7.* --dev --no-update + && composer require wp-phpunit/wp-phpunit:6.7.* --dev --no-update && composer update --no-cache - - name: Run Tests on Latest Version - WP6.1 + - name: Run Tests on WP6.7 env: environment_github: true run: composer all - name: Codecov run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CORE_CODEV }} - \ No newline at end of file diff --git a/.github/workflows/WP_6_2.yaml b/.github/workflows/WP_6_8.yaml similarity index 63% rename from .github/workflows/WP_6_2.yaml rename to .github/workflows/WP_6_8.yaml index 229cf0d..4d2f9fe 100644 --- a/.github/workflows/WP_6_2.yaml +++ b/.github/workflows/WP_6_8.yaml @@ -1,4 +1,4 @@ -name: WP6.2 [PHP7.4-8.3] Tests +name: WordPress 6.8 Test Suite [PHP8.0-8.4] on: push: @@ -11,23 +11,22 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: [ '7.4', '8.0', '8.1', '8.2', '8.3'] + php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4'] runs-on: ${{ matrix.operating-system }} services: - # Setup MYSQL mysql-service: - image: 'mysql:5.7' + image: mysql:8.4 env: MYSQL_ROOT_PASSWORD: 'crab' MYSQL_DATABASE: pc_core_tests ports: - 3306:3306 options: >- - --health-cmd="mysqladmin ping" + --health-cmd="healthcheck.sh --connect || mysqladmin ping -uroot -pcrab" --health-interval=10s - --health-timeout=5s - --health-retries=3 - + --health-timeout=10s + --health-retries=10 + steps: - name: Checkout uses: actions/checkout@v2 @@ -44,22 +43,24 @@ jobs: - name: Clear existing composer run: > - sudo rm -rf vendor - && rm -rf composer.lock + sudo rm -rf vendor + && rm -rf composer.lock - name: Validate composer.json and composer.lock run: composer validate - name: Install dependencies run: > - rm -rf composer.lock + rm -rf composer.lock && composer clearcache - && composer require php-stubs/wordpress-stubs:6.2.* --dev --no-update - && composer require roots/wordpress:6.2.* --dev --no-update - && composer require wp-phpunit/wp-phpunit:6.2.* --dev --no-update + && composer require php-stubs/wordpress-stubs:6.8.* --dev --no-update + && composer require roots/wordpress:6.8.* --dev --no-update + && composer require wp-phpunit/wp-phpunit:6.8.* --dev --no-update && composer update --no-cache - - name: Run Tests on Latest Version - WP6.2 + - name: Run Tests on WP6.8 env: environment_github: true run: composer all - \ No newline at end of file + + - name: Codecov + run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CORE_CODEV }} diff --git a/.github/workflows/WP_6_3.yaml b/.github/workflows/WP_6_9.yaml similarity index 63% rename from .github/workflows/WP_6_3.yaml rename to .github/workflows/WP_6_9.yaml index 953d45b..f4da3e0 100644 --- a/.github/workflows/WP_6_3.yaml +++ b/.github/workflows/WP_6_9.yaml @@ -1,4 +1,4 @@ -name: WP6.3 [PHP7.4-8.3] Tests +name: WordPress 6.9 Test Suite [PHP8.0-8.4] on: push: @@ -11,23 +11,22 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: [ '7.4', '8.0', '8.1', '8.2', '8.3'] + php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4'] runs-on: ${{ matrix.operating-system }} services: - # Setup MYSQL mysql-service: - image: 'mysql:5.7' + image: mysql:8.4 env: MYSQL_ROOT_PASSWORD: 'crab' MYSQL_DATABASE: pc_core_tests ports: - 3306:3306 options: >- - --health-cmd="mysqladmin ping" + --health-cmd="healthcheck.sh --connect || mysqladmin ping -uroot -pcrab" --health-interval=10s - --health-timeout=5s - --health-retries=3 - + --health-timeout=10s + --health-retries=10 + steps: - name: Checkout uses: actions/checkout@v2 @@ -44,22 +43,24 @@ jobs: - name: Clear existing composer run: > - sudo rm -rf vendor - && rm -rf composer.lock + sudo rm -rf vendor + && rm -rf composer.lock - name: Validate composer.json and composer.lock run: composer validate - name: Install dependencies run: > - rm -rf composer.lock + rm -rf composer.lock && composer clearcache - && composer require php-stubs/wordpress-stubs:6.3.* --dev --no-update - && composer require roots/wordpress:6.3.* --dev --no-update - && composer require wp-phpunit/wp-phpunit:6.3.* --dev --no-update + && composer require php-stubs/wordpress-stubs:6.9.* --dev --no-update + && composer require roots/wordpress:6.9.* --dev --no-update + && composer require wp-phpunit/wp-phpunit:6.9.* --dev --no-update && composer update --no-cache - - name: Run Tests on Latest Version - WP6.3 + - name: Run Tests on WP6.9 env: environment_github: true run: composer all - \ No newline at end of file + + - name: Codecov + run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CORE_CODEV }} From 46de84c51df0d265adea17559fedddccc52427b7 Mon Sep 17 00:00:00 2001 From: Glynn Quelch Date: Fri, 17 Apr 2026 00:09:42 +0100 Subject: [PATCH 3/3] House Keeping --- .scrutinizer.yml | 85 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .scrutinizer.yml diff --git a/.scrutinizer.yml b/.scrutinizer.yml new file mode 100644 index 0000000..f45b34a --- /dev/null +++ b/.scrutinizer.yml @@ -0,0 +1,85 @@ +checks: + php: + code_rating: true + duplication: true + fix_php_opening_tag: false + remove_php_closing_tag: false + one_class_per_file: false + side_effects_or_types: false + no_mixed_inline_html: false + require_braces_around_control_structures: false + php5_style_constructor: false + no_global_keyword: false + avoid_usage_of_logical_operators: false + psr2_class_declaration: false + no_underscore_prefix_in_properties: false + no_underscore_prefix_in_methods: false + blank_line_after_namespace_declaration: false + single_namespace_per_use: false + psr2_switch_declaration: false + psr2_control_structure_declaration: false + avoid_superglobals: false + security_vulnerabilities: false + no_exit: false + +build: + dependencies: + override: + - 'composer install --no-interaction --prefer-dist' + nodes: + analysis: + project_setup: + override: + - 'true' + tests: + override: + - php-scrutinizer-run + +tools: + php_analyzer: + enabled: true + filter: + excluded_paths: ['tests/*', 'docs/*', 'template/*', 'node_modules/*', 'vendor/*'] + config: + checkstyle: + enabled: true + naming: + isser_method_name: ^.*$ + utility_class_name: ^.*$ + doc_comment_fixes: + enabled: false + reflection_fixes: + enabled: false + use_statement_fixes: + enabled: false + simplify_boolean_return: + enabled: true + php_changetracking: true + php_cpd: true + php_cs_fixer: false + php_mess_detector: true + php_pdepend: true + sensiolabs_security_checker: true + +filter: + paths: + - 'src/*' + excluded_paths: + - 'tests/*' + - 'docs/*' + - 'docs-gen/*' + - 'node_modules/*' + - 'vendor/*' + - 'template/*' + +coding_style: + php: + indentation: + general: + use_tabs: true + size: 4 + spaces: + before_parentheses: + closure_definition: true + around_operators: + concatenation: true