Skip to content

Commit

Permalink
Merge pull request #2945 from 10up/tests/phpcs-unified-call
Browse files Browse the repository at this point in the history
Check PHP compatibility while linting + PR annotations
  • Loading branch information
felipeelia committed Aug 12, 2022
2 parents f934509 + bfe5738 commit 1d0dde0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 57 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,14 @@ jobs:
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
php-version: '7.4'
coverage: none

- name: composer install
run: composer install

- name: PHPCS check
run: composer run lint
uses: chekalsky/phpcs-action@v1
with:
enable_warnings: true
phpcs_bin_path: './vendor/bin/phpcs elasticpress.php includes --runtime-set testVersion 7.0-'
54 changes: 0 additions & 54 deletions .github/workflows/php-compatibility.yml

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"yoast/phpunit-polyfills": "1.x-dev"
},
"scripts": {
"lint": "phpcs elasticpress.php includes",
"lint": "phpcs elasticpress.php includes --runtime-set testVersion 7.0-",
"lint-fix": "phpcbf elasticpress.php includes",
"test": "phpunit",
"test-single-site": "phpunit -c single-site.xml.dist",
Expand Down
1 change: 1 addition & 0 deletions includes/classes/Indexable/Term/QueryIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ protected function format_hits_as_terms( $terms, $new_terms, $query_vars ) {
}

$term->elasticsearch = true; // Super useful for debugging.

$term = new \WP_Term( $term ); // Necessary for WordPress actions that expect WP_Term as the object type.

if ( $term ) {
Expand Down
1 change: 1 addition & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
<rule ref="10up-Default">
<exclude name="WordPress.WP.GlobalVariablesOverride.Prohibited" />
</rule>
<rule ref="PHPCompatibilityWP" />
</ruleset>

0 comments on commit 1d0dde0

Please sign in to comment.