Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/quality-assurance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'PHP Quality Assurance'
on:
pull_request:
paths:
- '**.php'
- 'composer.*'
- 'phpcs.*'
- 'phpstan.*'
jobs:
lint-php:
uses: inpsyde/reusable-workflows/.github/workflows/lint-php.yml@main
strategy:
matrix:
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
- '8.4'
with:
PHP_VERSION: '${{ matrix.php }}'
coding-standards-php:
uses: inpsyde/reusable-workflows/.github/workflows/coding-standards-php.yml@main
secrets:
COMPOSER_AUTH_JSON: '${{secrets.PACKAGIST_AUTH_JSON}}'
with:
PHP_VERSION: '8.4'
static-analysis-php:
uses: inpsyde/reusable-workflows/.github/workflows/static-analysis-php.yml@main
secrets:
COMPOSER_AUTH_JSON: '${{secrets.PACKAGIST_AUTH_JSON}}'
with:
PHP_VERSION: '8.4'
58 changes: 0 additions & 58 deletions .github/workflows/static-analysis.yml

This file was deleted.

22 changes: 19 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ jobs:
strategy:
fail-fast: false
matrix:
php-ver: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
php-ver: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
wp-ver: [ '5.9', '6.0', '6.1', '6.2', '6.3', '6.4', '6' ]
exclude:
- php-ver: '7.4'
wp-ver: '6.3'
- php-ver: '7.4'
wp-ver: '6.4'
- php-ver: '7.4'
wp-ver: '6'
- php-ver: '8.2'
wp-ver: '5.9'
- php-ver: '8.3'
Expand All @@ -40,6 +46,13 @@ jobs:
wp-ver: '6.2'
- php-ver: '8.3'
wp-ver: '6.3'
- php-ver: '8.4'
wp-ver: '6.3'
include:
- php-ver: '7.4'
composer: '--ignore-platform-req=php'
- php-ver: '8.0'
composer: '--ignore-platform-req=php'
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -53,11 +66,14 @@ jobs:

- name: Adjust dependencies in 'composer.json'
run: |
composer remove roots/wordpress-no-content inpsyde/php-coding-standards vimeo/psalm --dev --no-update
composer require "roots/wordpress-no-content:~${{ matrix.wp-ver }}.0" --dev --no-update
composer remove roots/wordpress-no-content inpsyde/php-coding-standards vimeo/psalm syde/phpcs phpstan/phpstan --dev --no-update
composer require "roots/wordpress-no-content:~${{ matrix.wp-ver }}.0" --dev

- name: Install dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependency-versions }}
composer-options: ${{ matrix.composer || '' }}

- name: Run unit tests
run: ./vendor/bin/phpunit --no-coverage
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ It is tested and guaranteed to work with WP 5.9+, but _should_ work, at least, w
---


## License
## Copyright and License

This package is [free software](https://www.gnu.org/philosophy/free-sw.en.html) distributed under the terms of the GNU General Public License version 2 or (at your option) any later version. For the full license, see [LICENSE](./LICENSE).

This repository is free software released under the terms of the GNU General Public License version 2 or (at your option) any later version. See [LICENSE](./LICENSE) for the complete license.
14 changes: 9 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@
],
"minimum-stability": "dev",
"require": {
"php": ">=7.4 < 8.4"
"php": ">=7.4 < 8.5"
},
"require-dev": {
"roots/wordpress-no-content": ">=6.5.3",
"roots/wordpress-no-content": "dev-main",
"phpunit/phpunit": "^9.6.19",
"inpsyde/php-coding-standards": "^2",
"vimeo/psalm": "^5.24.0"
"phpstan/phpstan": "2.2.x-dev",
"phpstan/phpstan-mockery": "2.0.x-dev",
"phpstan/phpstan-deprecation-rules": "2.0.x-dev",
"php-stubs/wp-cli-stubs": "dev-master",
"syde/phpcs": "dev-main",
"php-stubs/wordpress-stubs": "^6.9"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -54,7 +58,7 @@
},
"scripts": {
"cs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs",
"psalm": "@php ./vendor/vimeo/psalm/psalm --no-suggestions --report-show-info=false --find-unused-psalm-suppress --no-diff --no-cache --no-file-cache --output-format=compact",
"stan": "@php ./vendor/bin/phpstan analyse --no-progress --memory-limit=1G",
"tests": "@php ./vendor/phpunit/phpunit/phpunit --no-coverage",
"qa": [
"@cs",
Expand Down
38 changes: 16 additions & 22 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset>
<arg name="colors" />
<arg value="sp" />
<arg name="warning-severity" value="0"/>

<file>./inc/</file>
<file>./src/</file>
<file>./tests/</file>

<arg value="sp"/>
<config name="testVersion" value="7.4-"/>

<rule ref="Inpsyde" />
<config name="testVersion" value="8.4-"/>

<rule ref="Inpsyde.CodeQuality.Psr4">
<properties>
<property
name="psr4"
type="array"
value="
Inpsyde\ObjectHooksRemover=>src,
Inpsyde\ObjectHooksRemover\Tests=>tests/src|tests/cases
"
/>
</properties>
</rule>
<rule ref="Syde-Extra" />

<rule ref="Squiz.PHP.Eval.Discouraged">
<exclude-pattern>./tests/</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.PHP.DiscouragedPHPFunctions">
<exclude-pattern>./tests/</exclude-pattern>
</rule>
<rule ref="WordPress.PHP.DevelopmentFunctions">
<exclude-pattern>./tests/</exclude-pattern>

<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
<properties>
<property name="rootNamespaces" type="array">
<element key="src" value="Inpsyde\ObjectHooksRemover"/>
<element key="tests/src" value="Inpsyde\ObjectHooksRemover\Tests"/>
<element key="tests/cases" value="Inpsyde\ObjectHooksRemover\Tests"/>
</property>
</properties>
</rule>
</ruleset>
12 changes: 12 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
includes:
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
- vendor/phpstan/phpstan-mockery/extension.neon
parameters:
level: 1
scanFiles:
- vendor/php-stubs/wp-cli-stubs/wp-cli-stubs.php
- vendor/php-stubs/wordpress-stubs/wordpress-stubs.php
paths:
- src/
- inc/
treatPhpDocTypesAsCertain: false
27 changes: 0 additions & 27 deletions psalm.xml

This file was deleted.

2 changes: 1 addition & 1 deletion src/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ private static function matchClosureParams(array $params, array $targetArgs): bo
* @param array $array
* @return list{bool, array<non-empty-string, non-empty-string>}
*
* phpcs:disable Inpsyde.CodeQuality.NestingLevel
* phpcs:disable SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh
*/
private static function normalizeTargetArgsList(array $array): array
{
Expand Down
1 change: 0 additions & 1 deletion tests/cases/RemoveClosureHookTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Inpsyde\ObjectHooksRemover\Tests;

use function Inpsyde\remove_closure_hook;
use function Inpsyde\remove_instance_hook;

/**
* @runTestsInSeparateProcesses
Expand Down