Skip to content

Commit

Permalink
[+]: fixed PHP-Warnings from PHPStorm
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Moelleken committed Aug 20, 2015
1 parent 8c8a4ac commit 6cd8a0c
Showing 1 changed file with 35 additions and 42 deletions.
77 changes: 35 additions & 42 deletions src/voku/helper/Hooks.php
Expand Up @@ -116,17 +116,6 @@ private function __clone()
{
}

/**
* prevent from being unserialized
*
* @access private
*
* @return void
*/
private function __wakeup()
{
}

/**
* Singleton Instance
*
Expand Down Expand Up @@ -343,18 +332,18 @@ 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'];
}

$args[0] = $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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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
Expand All @@ -722,7 +711,7 @@ private function __filter_build_unique_id($function)
// Closures are currently implemented as objects
$function = array(
$function,
''
'',
);
} else {
$function = (array)$function;
Expand Down Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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
);
}

Expand Down Expand Up @@ -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
);
}
Expand All @@ -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
);
}

Expand Down

0 comments on commit 6cd8a0c

Please sign in to comment.