Skip to content

Commit fa74ea9

Browse files
authored
Suppress Squiz.PHP.Heredoc.NotAllowed warning (#566)
1 parent 4091142 commit fa74ea9

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

includes/class-plugin.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,7 @@ public function render_admin_bar( $wp_admin_bar ) {
827827
* @return string
828828
*/
829829
protected function admin_bar_style() {
830+
// phpcs:disable Squiz.PHP.Heredoc.NotAllowed
830831
return <<<HTML
831832
<style>
832833
#wpadminbar ul li.redis-cache-error {
@@ -838,7 +839,7 @@ protected function admin_bar_style() {
838839
color: #fff;
839840
}
840841
</style>
841-
HTML;
842+
HTML; // phpcs:enable
842843
}
843844

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

855+
// phpcs:disable Squiz.PHP.Heredoc.NotAllowed
854856
return <<<HTML
855857
<script>
856858
(function (element) {
@@ -895,7 +897,7 @@ protected function admin_bar_script() {
895897
document.querySelector('#wp-admin-bar-redis-cache-flush > a')
896898
);
897899
</script>
898-
HTML;
900+
HTML; // phpcs:enable
899901
}
900902

901903
/**

includes/object-cache.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,6 +1877,7 @@ protected function lua_flush_closure( $salt, $escape = true ) {
18771877
$salt = $escape ? $this->glob_quote( $salt ) : $salt;
18781878

18791879
return function () use ( $salt ) {
1880+
// phpcs:disable Squiz.PHP.Heredoc.NotAllowed
18801881
$script = <<<LUA
18811882
local cur = 0
18821883
local i = 0
@@ -1892,7 +1893,7 @@ protected function lua_flush_closure( $salt, $escape = true ) {
18921893
end
18931894
until 0 == cur
18941895
return i
1895-
LUA;
1896+
LUA; // phpcs:enable
18961897

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

1927+
// phpcs:disable Squiz.PHP.Heredoc.NotAllowed
19261928
$script = <<<LUA
19271929
local cur = 0
19281930
local i = 0
@@ -1945,7 +1947,7 @@ function ( $group ) {
19451947
end
19461948
until 0 == cur
19471949
return i
1948-
LUA;
1950+
LUA; // phpcs:enable
19491951
if ( isset($this->redis_version) && version_compare( $this->redis_version, '5', '<' ) && version_compare( $this->redis_version, '3.2', '>=' ) ) {
19501952
$script = 'redis.replicate_commands()' . "\n" . $script;
19511953
}

0 commit comments

Comments
 (0)