Skip to content

Commit

Permalink
Fix PHPStan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
roborourke committed Jul 25, 2024
1 parent 12dfb50 commit 3607ba7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/php-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-composer-7.2-${{ hashFiles('composer.lock') }}
key: ${{ runner.os }}-composer-7.4-${{ hashFiles('composer.lock') }}

- name: Install PHP Dependencies
run: |
Expand All @@ -48,7 +48,7 @@ jobs:
uses: actions/cache@v4
with:
path: tests/cache
key: ${{ runner.os }}-phpcs-7.2-${{ hashFiles('plugin.php') }}
key: ${{ runner.os }}-phpcs-7.4-${{ hashFiles('plugin.php') }}

- name: Run the tests
run: |
Expand Down
1 change: 0 additions & 1 deletion inc/cli/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@
* @return void
*/
function bootstrap() : void {
// @phpstan-ignore-next-line
WP_CLI::add_command( 'authorship migrate', __NAMESPACE__ . '\\Migrate_Command' );
}
10 changes: 5 additions & 5 deletions inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -760,11 +760,11 @@ function filter_comment_notification_recipients( array $emails, int $comment_id
* Bit of a hack, but filter filter_quickedit_authors and include only author with ID 0.
* Also hide if only one author just in case someone someone has created author with 0.
*
* @param array $options Options.
* @return array Options.
* @param array<string, mixed> $options Options.
* @return array<string, mixed> Filtered options.
*/
function hide_quickedit_authors( array $options ) : array {
$users_opt['hide_if_only_one_author'] = true;
$users_opt['include'] = [ 0 ];
return $users_opt;
$options['hide_if_only_one_author'] = true;
$options['include'] = [ 0 ];
return $options;
}
3 changes: 3 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ parameters:
ignoreErrors:
# Uses func_get_args()
- '#^Function apply_filters invoked with [34567] parameters, 2 required\.$#'
# Cant declare types always because extended
# core parent class methods don't
checkGenericClassInNonGenericObjectType: false

0 comments on commit 3607ba7

Please sign in to comment.