Skip to content

Commit b95f925

Browse files
committed
use short ternary operator
1 parent d0b7f21 commit b95f925

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

inc/settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ public function clear_cache( $type = '' ) {
752752
$token = $this->get( 'cache_buster_assets' );
753753
} else {
754754
// here is an individual clear cache based on filename.
755-
$token = get_transient( '_file_' . crc32( $type ) ) ?? '';
755+
$token = get_transient( '_file_' . crc32( $type ) ) ?: '';
756756
}
757757

758758
$request = new Optml_Api();

inc/url_replacer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ private function normalize_image( $url, $original_url, $args, $is_uploaded = fal
284284
* @return string
285285
*/
286286
public static function get_active_cache_booster( $url, $main_cache_buster ) {
287-
return get_transient( '_file_' . crc32( wp_basename( $url ) ) ) ?? $main_cache_buster;
287+
return get_transient( '_file_' . crc32( wp_basename( $url ) ) ) ?: $main_cache_buster;
288288
}
289289
/**
290290
* Throw error on object clone

phpcs.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<exclude name="Squiz.Commenting.FileComment"/>
3131
<exclude name="WordPress.PHP.YodaConditions.NotYoda"/>
3232
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found"/>
33+
<exclude name="Universal.Operators.DisallowShortTernary.Found"/>
3334
<exclude name="Squiz.PHP.DisallowMultipleAssignments"/>
3435
<exclude name="WordPress.NamingConvention.ValidVariableName.StringNotSnakeCase"/>
3536
<exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCase"/>

0 commit comments

Comments
 (0)