Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/Revolution/modX.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,16 +400,16 @@

/**
* Evaluate boolean-like parameter value and return it as an actual boolean or as a string; a string may be
* needed/preferred when building code blocks (e.g., javascript) via php strings (nowdoc/heredoc ones in particular).

Check warning on line 403 in core/src/Revolution/modX.php

View workflow job for this annotation

GitHub Actions / phpcs

Line exceeds 120 characters; contains 121 characters
*
* @param array $params An associative or numeric-indexed array of parameters
* @param string|int $key The array key to evaluate
* @param bool $returnBoolAsString Whether to return the string representation ('true' or 'false') of the boolean value

Check warning on line 407 in core/src/Revolution/modX.php

View workflow job for this annotation

GitHub Actions / phpcs

Line exceeds 120 characters; contains 123 characters
* @return string|bool
*/
public function paramValueIsTrue(array $params, $key, bool $returnBoolAsString = false)
{
if (isset($params[$key]) && in_array($params[$key], ['true', true, '1', 1])) {
if (isset($params[$key]) && in_array($params[$key], ['true', true, '1', 1], true)) {
return $returnBoolAsString ? 'true' : true ;
}
return $returnBoolAsString ? 'false' : false ;
Expand Down