-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix problems found by static analysis #492
Conversation
@@ -14,7 +14,7 @@ | |||
/** | |||
* Registers the custom rewrite rule for the 'BaseStyle' route. | |||
*/ | |||
add_filter('init', function () { | |||
add_action('init', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
init
is an action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@szepeviktor: Can confirm this. Thanks!
@@ -35,8 +35,6 @@ class TimberDynamicResize | |||
|
|||
/** | |||
* Constructor. | |||
* | |||
* @var TimberDynamicResize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stray something. No clue what it wants to be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@szepeviktor: Can confirm this. Thanks!
* @param integer|float $w The width of the image. | ||
* @param integer|float $h The height of the image. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a float
in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@szepeviktor: Can confirm this. Thanks!
$data = $data === false ? [] : $data; | ||
$data = $data === null ? [] : $data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data
may be an array or null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@szepeviktor: This makes sense. Thanks!
@@ -80,7 +80,7 @@ public function renderComponent(Environment $env, array $context, $componentName | |||
|
|||
$output = Api::renderComponent($componentName, $data); | |||
|
|||
remove_filter('Flynt/renderComponent', $fn, PHP_INT_MIN, 3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove_filter
accepts 3 parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@szepeviktor: Can confirm this. Thanks!
Scrutinizer says
|
Please see comments below.