Skip to content

Commit

Permalink
Fix recent PHPStan errors (#12677)
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy authored Nov 14, 2022
1 parent d00f04c commit 9cf9151
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 99 deletions.
185 changes: 94 additions & 91 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion includes/Admin/TinyMCE.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function register(): void {
add_filter( 'mce_buttons', [ $this, 'tinymce_web_stories_button' ] );
add_filter( 'mce_external_plugins', [ $this, 'web_stories_mce_plugin' ] );
add_action( 'admin_footer', [ $this, 'web_stories_tinymce_root_element' ] );
add_action( 'script_loader_tag', [ $this, 'script_loader_tag' ], 10, 3 );
add_filter( 'script_loader_tag', [ $this, 'script_loader_tag' ], 10, 3 );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions includes/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public function enqueue_style_asset( string $style_handle, array $style_dependen
* @since 1.8.0
*
* @param string $style_handle Name of the stylesheet. Should be unique.
* @param string|bool $src Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.
* @param string|false $src Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.
* If source is set to false, stylesheet is an alias of other stylesheets it depends on.
* @param string[] $deps Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array.
* @param string|bool|null $ver Optional. String specifying stylesheet version number, if it has one, which is added to the URL
Expand Down Expand Up @@ -281,7 +281,7 @@ public function register_style( string $style_handle, $src, array $deps = [], $v
* @since 1.8.0
*
* @param string $script_handle Name of the script. Should be unique.
* @param string|bool $src Full URL of the script, or path of the script relative to the WordPress root directory.
* @param string|false $src Full URL of the script, or path of the script relative to the WordPress root directory.
* If source is set to false, script is an alias of other scripts it depends on.
* @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array.
* @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL
Expand Down
2 changes: 1 addition & 1 deletion includes/Embed_Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function register(): void {
add_action( 'amp_post_template_css', [ $this, 'add_amp_post_template_css' ] );
}

add_filter( 'wp_kses_allowed_html', [ $this, 'filter_kses_allowed_html' ], 10, 2 );
add_filter( 'wp_kses_allowed_html', [ $this, 'filter_kses_allowed_html' ] );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion includes/KSES.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function filter_insert_post_data( $data, $postarr, $unsanitized_postarr )

if ( isset( $unsanitized_postarr['post_content'] ) ) {
add_filter( 'safe_style_css', [ $this, 'filter_safe_style_css' ] );
add_filter( 'wp_kses_allowed_html', [ $this, 'filter_kses_allowed_html' ], 10, 2 );
add_filter( 'wp_kses_allowed_html', [ $this, 'filter_kses_allowed_html' ] );

$unsanitized_postarr['post_content'] = $this->filter_content_save_pre_before_kses( $unsanitized_postarr['post_content'] );

Expand Down
4 changes: 2 additions & 2 deletions includes/Media/Media_Source_Taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function register(): void {
// Hide video posters from Media grid view.
add_filter( 'ajax_query_attachments_args', [ $this, 'filter_ajax_query_attachments_args' ] );
// Hide video posters from Media list view.
add_filter( 'pre_get_posts', [ $this, 'filter_generated_media_attachments' ] );
add_action( 'pre_get_posts', [ $this, 'filter_generated_media_attachments' ] );
// Hide video posters from web-stories/v1/media REST API requests.
add_filter( 'web_stories_rest_attachment_query', [ $this, 'filter_rest_generated_media_attachments' ] );
}
Expand Down Expand Up @@ -285,7 +285,7 @@ public function filter_ajax_query_attachments_args( $args ) {
*
* @param WP_Query $query WP_Query instance, passed by reference.
*/
public function filter_generated_media_attachments( &$query ): void {
public function filter_generated_media_attachments( WP_Query $query ): void {
if ( is_admin() && $query->is_main_query() && $this->context->is_upload_screen() ) {
$tax_query = $query->get( 'tax_query' );

Expand Down
2 changes: 1 addition & 1 deletion includes/Story_Revisions.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function __construct( Story_Post_Type $story_post_type, Assets $assets )
*/
public function register(): void {
$post_type = $this->story_post_type->get_slug();
add_action( "wp_{$post_type}_revisions_to_keep", [ $this, 'revisions_to_keep' ] );
add_filter( "wp_{$post_type}_revisions_to_keep", [ $this, 'revisions_to_keep' ] );
add_filter( '_wp_post_revision_fields', [ $this, 'filter_revision_fields' ], 10, 2 );
add_filter( 'wp_get_revision_ui_diff', [ $this, 'filter_revision_ui_diff' ], 10, 3 );

Expand Down

0 comments on commit 9cf9151

Please sign in to comment.