Skip to content

Commit 1bbb095

Browse files
Bump slevomat/coding-standard from 8.15.0 to 8.16.0 (#13998)
* Bump slevomat/coding-standard from 8.15.0 to 8.16.0 Bumps [slevomat/coding-standard](https://github.com/slevomat/coding-standard) from 8.15.0 to 8.16.0. - [Release notes](https://github.com/slevomat/coding-standard/releases) - [Commits](slevomat/coding-standard@8.15.0...8.16.0) --- updated-dependencies: - dependency-name: slevomat/coding-standard dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Lint fixes [dependabot skip] --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Pascal Birchler <[email protected]>
1 parent 1514b89 commit 1bbb095

39 files changed

+94
-94
lines changed

composer.lock

+28-28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/AMP/Output_Buffer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,6 @@ private function render_error_page( Throwable $throwable ): string {
238238
"\n" .
239239
"\n" .
240240
// translators: 1: error message. 2: location.
241-
sprintf( esc_html__( 'Error message: %1$s (%2$s)', 'web-stories' ), $throwable->getMessage(), $throwable->getFile() . ':' . $throwable->getLine() );
241+
\sprintf( esc_html__( 'Error message: %1$s (%2$s)', 'web-stories' ), $throwable->getMessage(), $throwable->getFile() . ':' . $throwable->getLine() );
242242
}
243243
}

includes/AMP/Sanitization.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ protected function get_extension_sources(): array {
364364
$specs = [];
365365
// Register all AMP components as defined in the spec.
366366
foreach ( AMP_Allowed_Tags_Generated::get_extension_specs() as $extension_name => $extension_spec ) {
367-
$src = sprintf(
367+
$src = \sprintf(
368368
'https://cdn.ampproject.org/v0/%s-%s.js',
369369
$extension_name,
370370
$extension_spec['latest']

includes/AMP/Traits/Sanitization_Utils.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ private function deduplicate_inline_styles( $document ): void {
450450
foreach ( $elements_by_inline_style as $inline_style => $styled_elements ) {
451451
$inline_style_class_name = '_' . substr( md5( (string) $inline_style ), 0, 7 );
452452

453-
$style_rule = $document->createTextNode( sprintf( '.%s{%s}', $inline_style_class_name, $inline_style ) );
453+
$style_rule = $document->createTextNode( \sprintf( '.%s{%s}', $inline_style_class_name, $inline_style ) );
454454
$style_element->appendChild( $style_rule );
455455

456456
/**

includes/Admin/Admin.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function prefill_post_content( $content, ?WP_Post $post ) {
179179
if ( ! use_block_editor_for_post( $post ) ) {
180180
$content = '[web_stories_embed url="%1$s" title="%2$s" poster="%3$s" width="%4$s" height="%5$s" align="%6$s"]';
181181

182-
return sprintf(
182+
return \sprintf(
183183
$content,
184184
esc_url( $story->get_url() ),
185185
esc_attr( $story->get_title() ),
@@ -197,7 +197,7 @@ public function prefill_post_content( $content, ?WP_Post $post ) {
197197

198198
$content = '<!-- wp:web-stories/embed {"blockType":"url","url":"%1$s","title":"%2$s","poster":"%3$s","width":"%4$s","height":"%5$s","align":"%6$s","stories": [%7$s]} -->%8$s<!-- /wp:web-stories/embed -->';
199199
// note $story->get_url should not be escaped here (esc_url()) see https://github.com/GoogleForCreators/web-stories-wp/issues/11371.
200-
return sprintf(
200+
return \sprintf(
201201
$content,
202202
$story->get_url(),
203203
esc_js( $story->get_title() ),

includes/Admin/Dashboard.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ public function load_stories_dashboard(): void {
411411

412412
wp_add_inline_script(
413413
'wp-api-fetch',
414-
sprintf( 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', wp_json_encode( $preload_data ) ),
414+
\sprintf( 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', wp_json_encode( $preload_data ) ),
415415
'after'
416416
);
417417
}

includes/Admin/Editor.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ public function get_editor_settings(): array {
415415
$revision = absint( $revision );
416416

417417
$revision_message = ! empty( $revision ) ?
418-
sprintf(
418+
\sprintf(
419419
/* translators: %s: Date and time of the revision. */
420420
__( 'Story restored to revision from %s.', 'web-stories' ),
421421
wp_post_revision_title( $revision, false )
@@ -458,7 +458,7 @@ public function get_editor_settings(): array {
458458
'taxonomies' => '/web-stories/v1/taxonomies/',
459459
'fonts' => trailingslashit( $this->font_post_type->get_rest_url() ),
460460
'metaBoxes' => $this->meta_boxes->get_meta_box_url( (int) $story_id ),
461-
'storyLocking' => rest_url( sprintf( '%s/%s/lock/', $this->story_post_type->get_rest_url(), $story_id ) ),
461+
'storyLocking' => rest_url( \sprintf( '%s/%s/lock/', $this->story_post_type->get_rest_url(), $story_id ) ),
462462
],
463463
'metadata' => [
464464
'publisher' => $publisher_name,

includes/Admin/PluginActionLinks.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ public function action_links( $links ) {
7474
if ( ! \is_array( $links ) ) {
7575
return $links;
7676
}
77-
$slug = sprintf( 'edit.php?post_type=%s&page=stories-dashboard#/editor-settings', Story_Post_Type::POST_TYPE_SLUG );
77+
$slug = \sprintf( 'edit.php?post_type=%s&page=stories-dashboard#/editor-settings', Story_Post_Type::POST_TYPE_SLUG );
7878
$url = get_admin_url( null, $slug );
79-
$links[] = sprintf(
79+
$links[] = \sprintf(
8080
'<a href="%s">%s</a>',
8181
esc_url( $url ),
8282
esc_html__( 'Settings', 'web-stories' )

includes/Admin/TinyMCE.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function web_stories_mce_plugin( $plugins ) {
147147
if ( ! \is_array( $plugins ) ) {
148148
return $plugins;
149149
}
150-
$plugins['web_stories'] = $this->assets->get_base_url( sprintf( 'assets/js/%s.js', self::SCRIPT_HANDLE ) );
150+
$plugins['web_stories'] = $this->assets->get_base_url( \sprintf( 'assets/js/%s.js', self::SCRIPT_HANDLE ) );
151151

152152
return $plugins;
153153
}

includes/Discovery.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public function print_feed_link(): void {
266266
/* translators: 1: Blog name, 2: Separator (raquo), 3: Post type name. */
267267
$post_type_title = esc_html__( '%1$s %2$s %3$s Feed', 'web-stories' );
268268

269-
$title = sprintf( $post_type_title, get_bloginfo( 'name' ), $separator, $name );
269+
$title = \sprintf( $post_type_title, get_bloginfo( 'name' ), $separator, $name );
270270

271271
printf(
272272
'<link rel="alternate" type="%s" title="%s" href="%s">',

includes/Embed_Base.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public static function get_registration_action_priority(): int {
105105
* @since 1.13.0
106106
*/
107107
public function add_amp_post_template_css(): void {
108-
$path = $this->assets->get_base_path( sprintf( 'assets/css/%s%s.css', self::SCRIPT_HANDLE, is_rtl() ? '-rtl' : '' ) );
108+
$path = $this->assets->get_base_path( \sprintf( 'assets/css/%s%s.css', self::SCRIPT_HANDLE, is_rtl() ? '-rtl' : '' ) );
109109

110110
if ( is_readable( $path ) ) {
111111
$css = file_get_contents( $path ); // phpcs:ignore WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown

includes/Exception/InvalidEventProperties.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static function from_invalid_type( $properties ): self {
5252
? \get_class( $properties )
5353
: \gettype( $properties );
5454

55-
$message = sprintf(
55+
$message = \sprintf(
5656
'The properties argument for adding properties to an event needs to be an array, but is of type %s',
5757
$type
5858
);
@@ -73,7 +73,7 @@ public static function from_invalid_element_key_type( $property ): self {
7373
? \get_class( $property )
7474
: \gettype( $property );
7575

76-
$message = sprintf(
76+
$message = \sprintf(
7777
'Each property element key for adding properties to an event needs to of type string, but found an element key of type %s',
7878
$type
7979
);
@@ -92,7 +92,7 @@ public static function from_invalid_element_value_type( $property ): self {
9292
? \get_class( $property )
9393
: \gettype( $property );
9494

95-
$message = sprintf(
95+
$message = \sprintf(
9696
'Each property element value for adding properties to an event needs to be a scalar value, but found an element value of type %s',
9797
$type
9898
);

includes/Experiments.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function display_experiment_field( array $args ): void {
181181
<label for="<?php echo esc_attr( $args['id'] ); ?>">
182182
<input
183183
type="checkbox"
184-
name="<?php echo esc_attr( sprintf( '%1$s[%2$s]', $this->settings::SETTING_NAME_EXPERIMENTS, $args['id'] ) ); ?>"
184+
name="<?php echo esc_attr( \sprintf( '%1$s[%2$s]', $this->settings::SETTING_NAME_EXPERIMENTS, $args['id'] ) ); ?>"
185185
id="<?php echo esc_attr( $args['id'] ); ?>"
186186
value="1"
187187
<?php echo esc_attr( $disabled ); ?>

includes/Integrations/Core_Themes_Support.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function extend_theme_support(): void {
9696
*/
9797
public function embed_web_stories(): void {
9898
$stylesheet = get_stylesheet();
99-
if ( is_readable( sprintf( '%sassets/css/web-stories-theme-style-%s.css', WEBSTORIES_PLUGIN_DIR_PATH, $stylesheet ) ) ) {
99+
if ( is_readable( \sprintf( '%sassets/css/web-stories-theme-style-%s.css', WEBSTORIES_PLUGIN_DIR_PATH, $stylesheet ) ) ) {
100100
$this->assets->enqueue_style_asset( 'web-stories-theme-style-' . $stylesheet, [] );
101101
}
102102
?>

includes/Integrations/Ezoic.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,6 @@ private function render_error_page( Throwable $throwable ): string {
139139
"\n" .
140140
"\n" .
141141
// translators: 1: error message. 2: location.
142-
sprintf( esc_html__( 'Error message: %1$s (%2$s)', 'web-stories' ), $throwable->getMessage(), $throwable->getFile() . ':' . $throwable->getLine() );
142+
\sprintf( esc_html__( 'Error message: %1$s (%2$s)', 'web-stories' ), $throwable->getMessage(), $throwable->getFile() . ':' . $throwable->getLine() );
143143
}
144144
}

includes/Integrations/Jetpack.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,6 @@ protected function format_milliseconds( int $milliseconds ): string {
391391
$minutes = 0;
392392
}
393393

394-
return sprintf( '%d:%02u', $minutes, $seconds );
394+
return \sprintf( '%d:%02u', $minutes, $seconds );
395395
}
396396
}

includes/Media/Video/Muting.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public function update_callback_is_muted( $value, WP_Post $post ) {
195195
return new \WP_Error(
196196
'rest_cannot_update',
197197
/* translators: %s: Custom field key.**/
198-
sprintf( __( 'Sorry, you are not allowed to edit the %s custom field.', 'web-stories' ), $name ),
198+
\sprintf( __( 'Sorry, you are not allowed to edit the %s custom field.', 'web-stories' ), $name ),
199199
[
200200
'key' => $name,
201201
'status' => rest_authorization_required_code(),

includes/REST_API/Link_Controller.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function parse_link( $request ) {
178178
$query_string = wp_parse_url( $url, PHP_URL_QUERY );
179179
$check_url = \is_string( $query_string ) ? str_replace( "?$query_string", '', $url ) : $url;
180180
if ( preg_match( '~^https?://(www\.)?instagram\.com/([^/]+)/?$~', $check_url, $matches ) ) {
181-
$data['title'] = sprintf(
181+
$data['title'] = \sprintf(
182182
/* translators: %s: Instagram username. */
183183
__( 'Instagram - @%s', 'web-stories' ),
184184
$matches[2]

includes/REST_API/Publisher_Logos_Controller.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ protected function filter_publisher_logos( $publisher_logos ): array {
530530
* @phpstan-return Links
531531
*/
532532
protected function prepare_links( $post ): array {
533-
$base = sprintf( '%s/%s', $this->namespace, $this->rest_base );
533+
$base = \sprintf( '%s/%s', $this->namespace, $this->rest_base );
534534

535535
// Entity meta.
536536
return [

includes/REST_API/Stories_Base_Controller.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ protected function prepare_item_for_database( $request ) {
236236
) {
237237
return new \WP_Error(
238238
'rest_empty_content',
239-
sprintf(
239+
\sprintf(
240240
/* translators: 1: content, 2: story_data */
241241
__( '%1$s and %2$s should always be updated together.', 'web-stories' ),
242242
'content',
@@ -302,15 +302,15 @@ protected function prepare_links( $post ): array {
302302

303303
if ( ! empty( $post->post_author ) && post_type_supports( $post->post_type, 'author' ) ) {
304304
$links['author'] = [
305-
'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, 'users', $post->post_author ) ),
305+
'href' => rest_url( \sprintf( '%s/%s/%s', $this->namespace, 'users', $post->post_author ) ),
306306
'embeddable' => true,
307307
];
308308
}
309309

310310
// If we have a featured media, add that.
311311
$featured_media = get_post_thumbnail_id( $post->ID );
312312
if ( $featured_media ) {
313-
$image_url = rest_url( sprintf( '%s/%s/%s', $this->namespace, 'media', $featured_media ) );
313+
$image_url = rest_url( \sprintf( '%s/%s/%s', $this->namespace, 'media', $featured_media ) );
314314

315315
$links['https://api.w.org/featuredmedia'] = [
316316
'href' => $image_url,
@@ -319,7 +319,7 @@ protected function prepare_links( $post ): array {
319319
}
320320

321321
if ( ! \in_array( $post->post_type, [ 'attachment', 'nav_menu_item', 'revision' ], true ) ) {
322-
$attachments_url = rest_url( sprintf( '%s/%s', $this->namespace, 'media' ) );
322+
$attachments_url = rest_url( \sprintf( '%s/%s', $this->namespace, 'media' ) );
323323
$attachments_url = add_query_arg( 'parent', $post->ID, $attachments_url );
324324

325325
$links['https://api.w.org/attachment'] = [

includes/REST_API/Stories_Controller.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public function create_item( $request ) {
205205
$request['content'] = $original_post->post_content;
206206
$request['excerpt'] = $original_post->post_excerpt;
207207

208-
$title = sprintf(
208+
$title = \sprintf(
209209
/* translators: %s: story title. */
210210
__( '%s (Copy)', 'web-stories' ),
211211
$original_post->post_title
@@ -599,7 +599,7 @@ protected function prepare_links( $post ): array {
599599
* @phpstan-return Links
600600
*/
601601
private function add_post_locking_link( array $links, WP_Post $post ): array {
602-
$base = sprintf( '%s/%s', $this->namespace, $this->rest_base );
602+
$base = \sprintf( '%s/%s', $this->namespace, $this->rest_base );
603603
$lock_url = rest_url( trailingslashit( $base ) . $post->ID . '/lock' );
604604

605605
$links['https://api.w.org/lock'] = [
@@ -622,7 +622,7 @@ private function add_post_locking_link( array $links, WP_Post $post ): array {
622622

623623
if ( $time && $time > time() - $time_window ) {
624624
$links['https://api.w.org/lockuser'] = [
625-
'href' => rest_url( sprintf( '%s/%s', $this->namespace, 'users/' ) . $user ),
625+
'href' => rest_url( \sprintf( '%s/%s', $this->namespace, 'users/' ) . $user ),
626626
'embeddable' => true,
627627
];
628628
}
@@ -667,7 +667,7 @@ private function add_publisher_logo_link( array $links, WP_Post $post ): array {
667667

668668
if ( $publisher_logo_id ) {
669669
$links['https://api.w.org/publisherlogo'] = [
670-
'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, 'media', $publisher_logo_id ) ),
670+
'href' => rest_url( \sprintf( '%s/%s/%s', $this->namespace, 'media', $publisher_logo_id ) ),
671671
'embeddable' => true,
672672
];
673673
}

0 commit comments

Comments
 (0)