-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from inpsyde/modernize
Modernize codebase and QA
- Loading branch information
Showing
40 changed files
with
2,919 additions
and
1,817 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
* text eol=lf | ||
|
||
/.github/ export-ignore | ||
/tests/ export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/.travis.yml export-ignore | ||
/phpcs.xml.dist export-ignore | ||
/phpunit.xml.dist export-ignore | ||
/README.md export-ignore | ||
/tests/ export-ignore | ||
/psalm.xml export-ignore | ||
/CHANGELOG.md export-ignore | ||
/README.md export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Static Analysis | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**workflows/static-analysis.yml' | ||
- '**.php' | ||
- '**phpcs.xml.dist' | ||
- '**psalm.xml' | ||
pull_request: | ||
paths: | ||
- '**workflows/static-analysis.yml' | ||
- '**.php' | ||
- '**phpcs.xml.dist' | ||
- '**psalm.xml' | ||
workflow_dispatch: | ||
inputs: | ||
jobs: | ||
required: true | ||
type: choice | ||
default: 'Run all' | ||
description: 'Choose jobs to run' | ||
options: | ||
- 'Run all' | ||
- 'Run PHPCS only' | ||
- 'Run Psalm only' | ||
- 'Run lint only' | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
if: ${{ (github.event_name != 'workflow_dispatch') || ((github.event.inputs.jobs == 'Run all') || (github.event.inputs.jobs == 'Run lint only')) }} | ||
uses: inpsyde/reusable-workflows/.github/workflows/lint-php.yml@main | ||
strategy: | ||
matrix: | ||
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ] | ||
with: | ||
PHP_VERSION: ${{ matrix.php }} | ||
LINT_ARGS: '-e php --colors --show-deprecated ./inc ./src' | ||
|
||
coding-standards-analysis: | ||
if: ${{ (github.event_name != 'workflow_dispatch') || ((github.event.inputs.jobs == 'Run all') || (github.event.inputs.jobs == 'Run PHPCS only')) }} | ||
uses: inpsyde/reusable-workflows/.github/workflows/coding-standards-php.yml@main | ||
with: | ||
PHP_VERSION: '8.3' | ||
|
||
static-code-analysis: | ||
if: ${{ (github.event_name != 'workflow_dispatch') || ((github.event.inputs.jobs == 'Run all') || (github.event.inputs.jobs == 'Run Psalm only')) }} | ||
uses: inpsyde/reusable-workflows/.github/workflows/static-analysis-php.yml@main | ||
strategy: | ||
matrix: | ||
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ] | ||
with: | ||
PHP_VERSION: ${{ matrix.php }} | ||
PSALM_ARGS: --output-format=github --no-suggestions --no-cache --no-diff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**workflows/unit-tests.yml' | ||
- '**.php' | ||
- '**phpunit.xml.dist' | ||
pull_request: | ||
paths: | ||
- '**workflows/unit-tests.yml' | ||
- '**.php' | ||
- '**phpcs.xml.dist' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
unit-tests-php: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-ver: [ '7.4', '8.0', '8.1', '8.2', '8.3' ] | ||
wp-ver: [ '5.9', '6.0', '6.1', '6.2', '6.3', '6.4', '6' ] | ||
exclude: | ||
- php-ver: '8.2' | ||
wp-ver: '5.9' | ||
- php-ver: '8.3' | ||
wp-ver: '5.9' | ||
- php-ver: '8.2' | ||
wp-ver: '6.0' | ||
- php-ver: '8.3' | ||
wp-ver: '6.0' | ||
- php-ver: '8.3' | ||
wp-ver: '6.1' | ||
- php-ver: '8.3' | ||
wp-ver: '6.2' | ||
- php-ver: '8.3' | ||
wp-ver: '6.3' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-ver }} | ||
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On | ||
coverage: none | ||
|
||
- 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 | ||
- name: Install dependencies | ||
uses: ramsey/composer-install@v3 | ||
|
||
- name: Run unit tests | ||
run: ./vendor/bin/phpunit --no-coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/coverage/ | ||
composer.lock | ||
vendor/ | ||
/phpunit.xml | ||
/phpunit.xml | ||
/.phpunit.result.cache |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,29 @@ | ||
# Object Hooks Remover | ||
|
||
## Next | ||
|
||
- Modernize codebase to support recent PHP versions and up-to-date Syde coding standards. | ||
- Move logic from `utils.php` file to an internal `Functions` class (all-static, only for encapsulation and autoload). | ||
- Modernize QA: | ||
- Move out from Travis to GitHub actions. | ||
- Rewrite tests, update PHPUnit version, tests now include the real WordPress functions instead of stubs. | ||
- Added static analysis. | ||
- Introduced `remove_all_object_hooks()`. | ||
- Introduced `remove_static_method_hook()` to replace the now deprecated `remove_class_hook()` (which is converted to an alias). | ||
- In `remove_closure_hook()` is now possible to use `"mixed"` as target parameter type when the closure param declare no type. | ||
- License change from MIT to GPL due to usage of WordPress functions. | ||
- README refresh. | ||
|
||
--- | ||
|
||
## v0.1.1 (2017-12-19) | ||
|
||
### Fixed | ||
|
||
- Fix PHP 7 compatibility when removing hook with closures declaring param types. | ||
|
||
--- | ||
|
||
## v0.1.0 (2017-12-03) | ||
|
||
First release. |
Oops, something went wrong.