Skip to content

Commit 1f4aa4b

Browse files
Stop ignoring PHPCS warnings
Fix or ignore existing warnings
1 parent 15ca42b commit 1f4aa4b

4 files changed

Lines changed: 10 additions & 12 deletions

File tree

php/class-delivery.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,8 +1115,8 @@ function ( $tag ) use ( $content ) {
11151115
continue; // We should not deliver disabled items.
11161116
}
11171117

1118-
$base = $type . ':' . $url;
1119-
$public_id = ! is_admin() ? $relation['public_id'] . '.' . $relation['format'] : null;
1118+
$base = $type . ':' . $url;
1119+
$public_id = ! is_admin() ? $relation['public_id'] . '.' . $relation['format'] : null;
11201120
// Get merged transformations including overlays.
11211121
$merged_transformations = Relate::get_transformations( $relation['post_id'], true );
11221122

php/class-utils.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,11 @@ protected static function upgrade_install() {
368368
protected static function get_upgrade_sequence() {
369369
$upgrade_sequence = array();
370370
$sequences = array(
371-
'3.0.0' => array(
371+
'3.0.0' => array(
372372
'range' => array( '3.0.0' ),
373373
'method' => array( 'Cloudinary\Utils', 'upgrade_3_0_1' ),
374374
),
375-
'3.1.9' => array(
375+
'3.1.9' => array(
376376
'range' => array( '3.0.1', '3.1.9' ),
377377
'method' => array( 'Cloudinary\Utils', 'upgrade_3_1_9' ),
378378
),
@@ -1384,12 +1384,12 @@ public static function get_transformations_title( $context ) {
13841384
/**
13851385
* Get inline SVG content safely.
13861386
*
1387-
* @param string $file_path The absolute or relative path to the SVG file.
1388-
* @param bool $echo Whether to echo the SVG content or return it. Default true.
1387+
* @param string $file_path The absolute or relative path to the SVG file.
1388+
* @param bool $output_content Whether to echo the SVG content or return it. Default true.
13891389
*
13901390
* @return string|void The SVG content if $echo is false, void otherwise.
13911391
*/
1392-
public static function get_inline_svg( $file_path, $echo = true ) {
1392+
public static function get_inline_svg( $file_path, $output_content = true ) {
13931393
// If relative path, make it absolute from plugin root.
13941394
if ( ! file_exists( $file_path ) ) {
13951395
$plugin_dir = dirname( __DIR__ );
@@ -1402,7 +1402,7 @@ public static function get_inline_svg( $file_path, $echo = true ) {
14021402
}
14031403

14041404
// Get the SVG content.
1405-
$svg_content = file_get_contents( $file_path ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
1405+
$svg_content = file_get_contents( $file_path ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents, WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown
14061406

14071407
if ( false === $svg_content ) {
14081408
return '';
@@ -1411,7 +1411,7 @@ public static function get_inline_svg( $file_path, $echo = true ) {
14111411
// Sanitize SVG content to prevent XSS attacks.
14121412
$svg_content = self::sanitize_svg( $svg_content );
14131413

1414-
if ( $echo ) {
1414+
if ( $output_content ) {
14151415
echo $svg_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Sanitized by sanitize_svg.
14161416
} else {
14171417
return $svg_content;

php/ui/component/class-crops.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ protected function make_input( $name, $value ) {
279279
$control['children']['input'] = $check;
280280
$control['children']['slider'] = $slider;
281281

282-
$label = $this->get_part( 'span' );
282+
$label = $this->get_part( 'span' );
283283
$label['attributes']['class'] = 'cld-input-on-off-control-label';
284284
$label['content'] = __( 'Disable', 'cloudinary' );
285285

phpcs.xml.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
<severity>5</severity>
2626
</rule>
2727

28-
<config name="ignore_warnings_on_exit" value="1" /><!-- Ignore warnings for now. -->
29-
3028
<file>.</file><!-- Lint all PHP files by default. -->
3129

3230
<arg name="basepath" value="." /><!-- Show file paths relative to the project root. -->

0 commit comments

Comments
 (0)