mirror of
https://github.com/Mibew/handlebars.php.git
synced 2025-04-16 03:17:24 +03:00
Fixed to conform to coding standards
This commit is contained in:
parent
78974dee1b
commit
415e642351
@ -226,7 +226,7 @@ class Context
|
||||
} elseif ($variableName == '@key') {
|
||||
$current = $this->lastKey();
|
||||
} elseif ($variableName[0] == "'" || $variableName[0] == '"') {
|
||||
if ($variableName[0] == substr($variableName, -1) && strlen($variableName) > 2){
|
||||
if ($variableName[0] == substr($variableName, -1) && strlen($variableName) > 2) {
|
||||
$current = substr($variableName, 1, strlen($variableName) -2);
|
||||
} else {
|
||||
throw new \RuntimeException("Malformed string: ".$variableName);
|
||||
|
@ -424,11 +424,12 @@ class Template
|
||||
/**
|
||||
* Break an argument string into an array of strings
|
||||
*
|
||||
* @param string $string Argument String as passed to a helper
|
||||
* @param string $string Argument String as passed to a helper
|
||||
*
|
||||
* @return array the argument list as an array
|
||||
*/
|
||||
public function parseArguments($string){
|
||||
public function parseArguments($string)
|
||||
{
|
||||
$parts = array();
|
||||
preg_match_all('#(?<!\\\\)("|\')(?:[^\\\\]|\\\\.)*?\1|\S+#s', $string, $parts);
|
||||
$parts = isset($parts[0])?$parts[0]:array();
|
||||
|
Loading…
Reference in New Issue
Block a user