Skip to content

Commit

Permalink
PHPCS: replace old-style ignore comment with new style
Browse files Browse the repository at this point in the history
This code is only used when `WP_DEBUG` is on to display debugging information.

Includes reformatting the surrounding function call for readability.
  • Loading branch information
jrfnl committed Dec 12, 2019
1 parent 6dce9d7 commit dc14183
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,14 @@ public function config_page() {
if ( \defined( 'WP_DEBUG' ) && \WP_DEBUG ) {
echo '<h4>', \esc_html__( 'Options debug', 'yoast-comment-hacks' ), '</h4>';
echo '<div style="border: 1px solid #aaa; padding: 20px;">';
// @codingStandardsIgnoreStart
echo str_replace( '<code>', '<code style="background-color: #eee; margin: 0; padding: 0;">', highlight_string( "<?php\n\$this->options = " . var_export( $this->options, true ) . ';', true ), $num );
// @codingStandardsIgnoreEnd
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Debug output.
echo \str_replace(
'<code>',
'<code style="background-color: #eee; margin: 0; padding: 0;">',
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export -- This is only shown in debug mode.
\highlight_string( "<?php\n\$this->options = " . \var_export( $this->options, true ) . ';', true ),
$num
);
echo '</div>';
}
}
Expand Down

0 comments on commit dc14183

Please sign in to comment.