Skip to content

Commit

Permalink
Suppress Squiz.PHP.Heredoc.NotAllowed warning
Browse files Browse the repository at this point in the history
  • Loading branch information
yatsukhnenko committed Jan 24, 2025
1 parent 4091142 commit 60bbfc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions includes/class-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ public function render_admin_bar( $wp_admin_bar ) {
* @return string
*/
protected function admin_bar_style() {
// phpcs:disable Squiz.PHP.Heredoc.NotAllowed
return <<<HTML
<style>
#wpadminbar ul li.redis-cache-error {
Expand All @@ -838,7 +839,7 @@ protected function admin_bar_style() {
color: #fff;
}
</style>
HTML;
HTML; // phpcs:enable
}

/**
Expand All @@ -851,6 +852,7 @@ protected function admin_bar_script() {
$ajaxurl = esc_url( admin_url( 'admin-ajax.php' ) );
$flushMessage = __( 'Flushing cache...', 'redis-cache' );

// phpcs:disable Squiz.PHP.Heredoc.NotAllowed
return <<<HTML
<script>
(function (element) {
Expand Down Expand Up @@ -895,7 +897,7 @@ protected function admin_bar_script() {
document.querySelector('#wp-admin-bar-redis-cache-flush > a')
);
</script>
HTML;
HTML; // phpcs:enable
}

/**
Expand Down
6 changes: 4 additions & 2 deletions includes/object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -1877,6 +1877,7 @@ protected function lua_flush_closure( $salt, $escape = true ) {
$salt = $escape ? $this->glob_quote( $salt ) : $salt;

return function () use ( $salt ) {
// phpcs:disable Squiz.PHP.Heredoc.NotAllowed
$script = <<<LUA
local cur = 0
local i = 0
Expand All @@ -1892,7 +1893,7 @@ protected function lua_flush_closure( $salt, $escape = true ) {
end
until 0 == cur
return i
LUA;
LUA; // phpcs:enable

if ( isset($this->redis_version) && version_compare( $this->redis_version, '5', '<' ) && version_compare( $this->redis_version, '3.2', '>=' ) ) {
$script = 'redis.replicate_commands()' . "\n" . $script;
Expand Down Expand Up @@ -1923,6 +1924,7 @@ function ( $group ) {
$this->unflushable_groups
);

// phpcs:disable Squiz.PHP.Heredoc.NotAllowed
$script = <<<LUA
local cur = 0
local i = 0
Expand All @@ -1945,7 +1947,7 @@ function ( $group ) {
end
until 0 == cur
return i
LUA;
LUA; // phpcs:enable
if ( isset($this->redis_version) && version_compare( $this->redis_version, '5', '<' ) && version_compare( $this->redis_version, '3.2', '>=' ) ) {
$script = 'redis.replicate_commands()' . "\n" . $script;
}
Expand Down

0 comments on commit 60bbfc1

Please sign in to comment.