diff --git a/src/voku/helper/Hooks.php b/src/voku/helper/Hooks.php index df19f0e..3b81166 100644 --- a/src/voku/helper/Hooks.php +++ b/src/voku/helper/Hooks.php @@ -116,17 +116,6 @@ private function __clone() { } - /** - * prevent from being unserialized - * - * @access private - * - * @return void - */ - private function __wakeup() - { - } - /** * Singleton Instance * @@ -343,9 +332,10 @@ public function apply_filters($tag, $value) do { foreach ((array)current($this->filters[$tag]) as $the_) { - if (!is_null($the_['function'])) { + if (null !== $the_['function']) { - if (!is_null($the_['include_path'])) { + if (null !== $the_['include_path']) { + /** @noinspection PhpIncludeInspection */ include_once $the_['include_path']; } @@ -353,8 +343,7 @@ public function apply_filters($tag, $value) $value = call_user_func_array($the_['function'], $args); } } - } - while (next($this->filters[$tag]) !== false); + } while (next($this->filters[$tag]) !== false); array_pop($this->current_filter); @@ -405,17 +394,17 @@ public function apply_filters_ref_array($tag, $args) do { foreach ((array)current($this->filters[$tag]) as $the_) { - if (!is_null($the_['function'])) { + if (null !== $the_['function']) { - if (!is_null($the_['include_path'])) { + if (null !== $the_['include_path']) { + /** @noinspection PhpIncludeInspection */ include_once $the_['include_path']; } $args[0] = call_user_func_array($the_['function'], $args); } } - } - while (next($this->filters[$tag]) !== false); + } while (next($this->filters[$tag]) !== false); array_pop($this->current_filter); @@ -576,17 +565,17 @@ public function do_action($tag, $arg = '') do { foreach ((array)current($this->filters[$tag]) as $the_) { - if (!is_null($the_['function'])) { + if (null !== $the_['function']) { - if (!is_null($the_['include_path'])) { + if (null !== $the_['include_path']) { + /** @noinspection PhpIncludeInspection */ include_once $the_['include_path']; } call_user_func_array($the_['function'], $args); } } - } - while (next($this->filters[$tag]) !== false); + } while (next($this->filters[$tag]) !== false); array_pop($this->current_filter); } @@ -644,17 +633,17 @@ public function do_action_ref_array($tag, $args) do { foreach ((array)current($this->filters[$tag]) as $the_) { - if (!is_null($the_['function'])) { + if (null !== $the_['function']) { - if (!is_null($the_['include_path'])) { + if (null !== $the_['include_path']) { + /** @noinspection PhpIncludeInspection */ include_once $the_['include_path']; } call_user_func_array($the_['function'], $args); } } - } - while (next($this->filters[$tag]) !== false); + } while (next($this->filters[$tag]) !== false); array_pop($this->current_filter); } @@ -704,7 +693,7 @@ public function current_filter() * * Build Unique ID for storage and retrieval. * - * @param string $function Used for creating unique id + * @param string $function Used for creating unique id * * @return string|bool Unique ID for usage as array key or false if * $priority === false and $function is an @@ -722,7 +711,7 @@ private function __filter_build_unique_id($function) // Closures are currently implemented as objects $function = array( $function, - '' + '', ); } else { $function = (array)$function; @@ -753,17 +742,17 @@ public function __call_all_hook($args) do { foreach ((array)current($this->filters['all']) as $the_) { - if (!is_null($the_['function'])) { + if (null !== $the_['function']) { - if (!is_null($the_['include_path'])) { + if (null !== $the_['include_path']) { + /** @noinspection PhpIncludeInspection */ include_once $the_['include_path']; } call_user_func_array($the_['function'], $args); } } - } - while (next($this->filters['all']) !== false); + } while (next($this->filters['all']) !== false); } /** @@ -916,10 +905,12 @@ public function do_shortcode($content) $pattern = $this->get_shortcode_regex(); return preg_replace_callback( - "/$pattern/s", array( - $this, - '__do_shortcode_tag' - ), $content + "/$pattern/s", + array( + $this, + '__do_shortcode_tag', + ), + $content ); } @@ -1095,7 +1086,7 @@ public function shortcode_atts($pairs, $atts, $shortcode = '') $out = $this->apply_filters( array( $this, - "shortcode_atts_{$shortcode}" + "shortcode_atts_{$shortcode}", ), $out, $pairs, $atts ); } @@ -1122,10 +1113,12 @@ public function strip_shortcodes($content) $pattern = $this->get_shortcode_regex(); return preg_replace_callback( - "/$pattern/s", array( - $this, - '__strip_shortcode_tag' - ), $content + "/$pattern/s", + array( + $this, + '__strip_shortcode_tag', + ), + $content ); }