@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | $var = $this->validator->createVariable(); |
| 35 | 35 | |
| 36 | - if($var->isValid()) |
|
| 36 | + if ($var->isValid()) |
|
| 37 | 37 | { |
| 38 | 38 | $this->variableToken = $var->getToken(); |
| 39 | 39 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | public function getVariableToken() : Mailcode_Parser_Statement_Tokenizer_Token_Variable |
| 50 | 50 | { |
| 51 | - if(isset($this->variableToken)) |
|
| 51 | + if (isset($this->variableToken)) |
|
| 52 | 52 | { |
| 53 | 53 | return $this->variableToken; |
| 54 | 54 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function getVariable() : Mailcode_Variables_Variable |
| 70 | 70 | { |
| 71 | - if(isset($this->variableToken)) |
|
| 71 | + if (isset($this->variableToken)) |
|
| 72 | 72 | { |
| 73 | 73 | return $this->variableToken->getVariable(); |
| 74 | 74 | } |
@@ -116,12 +116,12 @@ discard block |
||
| 116 | 116 | { |
| 117 | 117 | $parent = $subject->getParent(); |
| 118 | 118 | |
| 119 | - if($parent === null) |
|
| 119 | + if ($parent === null) |
|
| 120 | 120 | { |
| 121 | 121 | return null; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - if($parent instanceof Mailcode_Commands_Command_For) |
|
| 124 | + if ($parent instanceof Mailcode_Commands_Command_For) |
|
| 125 | 125 | { |
| 126 | 126 | return $parent; |
| 127 | 127 | } |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | */ |
| 60 | 60 | public function excludeTags(array $tagNames) |
| 61 | 61 | { |
| 62 | - foreach($tagNames as $tagName) |
|
| 62 | + foreach ($tagNames as $tagName) |
|
| 63 | 63 | { |
| 64 | 64 | $this->excludeTag((string)$tagName); |
| 65 | 65 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $this->caseInsensitive = $val->isValid(); |
| 44 | 44 | |
| 45 | - if($val->isValid()) |
|
| 45 | + if ($val->isValid()) |
|
| 46 | 46 | { |
| 47 | 47 | $this->regexToken = $val->getToken(); |
| 48 | 48 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function getCaseToken() : ?Mailcode_Parser_Statement_Tokenizer_Token_Keyword |
| 57 | 57 | { |
| 58 | - if($this->regexToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword) |
|
| 58 | + if ($this->regexToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword) |
|
| 59 | 59 | { |
| 60 | 60 | return $this->regexToken; |
| 61 | 61 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $this->regexEnabled = $val->isValid(); |
| 44 | 44 | |
| 45 | - if($val->isValid()) |
|
| 45 | + if ($val->isValid()) |
|
| 46 | 46 | { |
| 47 | 47 | $this->regexToken = $val->getToken(); |
| 48 | 48 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function getRegexToken() : ?Mailcode_Parser_Statement_Tokenizer_Token_Keyword |
| 57 | 57 | { |
| 58 | - if($this->regexToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword) |
|
| 58 | + if ($this->regexToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword) |
|
| 59 | 59 | { |
| 60 | 60 | return $this->regexToken; |
| 61 | 61 | } |
@@ -74,11 +74,11 @@ |
||
| 74 | 74 | return new Mailcode_Parser_Statement_Validator_Type_Value($this->statement); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - public function createOperand(string $sign='') : Mailcode_Parser_Statement_Validator_Type_Operand |
|
| 77 | + public function createOperand(string $sign = '') : Mailcode_Parser_Statement_Validator_Type_Operand |
|
| 78 | 78 | { |
| 79 | 79 | $validate = new Mailcode_Parser_Statement_Validator_Type_Operand($this->statement); |
| 80 | 80 | |
| 81 | - if(!empty($sign)) |
|
| 81 | + if (!empty($sign)) |
|
| 82 | 82 | { |
| 83 | 83 | $validate->setOperandSign($sign); |
| 84 | 84 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | $this->instantiator->checkCommand($cmd); |
| 42 | 42 | |
| 43 | - if($cmd instanceof Mailcode_Commands_Command_Comment) |
|
| 43 | + if ($cmd instanceof Mailcode_Commands_Command_Comment) |
|
| 44 | 44 | { |
| 45 | 45 | return $cmd; |
| 46 | 46 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @throws Mailcode_Exception |
| 58 | 58 | * @throws Mailcode_Factory_Exception |
| 59 | 59 | */ |
| 60 | - public function for(string $sourceVariable, string $loopVariable) : Mailcode_Commands_Command_For |
|
| 60 | + public function for (string $sourceVariable, string $loopVariable) : Mailcode_Commands_Command_For |
|
| 61 | 61 | { |
| 62 | 62 | $sourceVariable = '$'.ltrim($sourceVariable, '$'); |
| 63 | 63 | $loopVariable = '$'.ltrim($loopVariable, '$'); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | $this->instantiator->checkCommand($cmd); |
| 81 | 81 | |
| 82 | - if($cmd instanceof Mailcode_Commands_Command_For) |
|
| 82 | + if ($cmd instanceof Mailcode_Commands_Command_For) |
|
| 83 | 83 | { |
| 84 | 84 | return $cmd; |
| 85 | 85 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | $this->instantiator->checkCommand($cmd); |
| 109 | 109 | |
| 110 | - if($cmd instanceof Mailcode_Commands_Command_Break) |
|
| 110 | + if ($cmd instanceof Mailcode_Commands_Command_Break) |
|
| 111 | 111 | { |
| 112 | 112 | return $cmd; |
| 113 | 113 | } |
@@ -127,17 +127,17 @@ discard block |
||
| 127 | 127 | * @throws Mailcode_Exception |
| 128 | 128 | * @throws Mailcode_Factory_Exception |
| 129 | 129 | */ |
| 130 | - public function mono(bool $multiline=false, array $classes=array()) : Mailcode_Commands_Command_Mono |
|
| 130 | + public function mono(bool $multiline = false, array $classes = array()) : Mailcode_Commands_Command_Mono |
|
| 131 | 131 | { |
| 132 | 132 | $params = ''; |
| 133 | 133 | $source = '{code'; |
| 134 | 134 | |
| 135 | - if($multiline) { |
|
| 135 | + if ($multiline) { |
|
| 136 | 136 | $params = 'multiline:'; |
| 137 | 137 | $source = '{code: multiline:'; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - if(!empty($classes)) { |
|
| 140 | + if (!empty($classes)) { |
|
| 141 | 141 | $classString = sprintf('"%s"', implode(' ', $classes)); |
| 142 | 142 | $params .= $classString; |
| 143 | 143 | $source .= $classString; |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | $this->instantiator->checkCommand($cmd); |
| 156 | 156 | |
| 157 | - if($cmd instanceof Mailcode_Commands_Command_Mono) |
|
| 157 | + if ($cmd instanceof Mailcode_Commands_Command_Mono) |
|
| 158 | 158 | { |
| 159 | 159 | return $cmd; |
| 160 | 160 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | $this->instantiator->checkCommand($cmd); |
| 181 | 181 | |
| 182 | - if($cmd instanceof Mailcode_Commands_Command_Code) |
|
| 182 | + if ($cmd instanceof Mailcode_Commands_Command_Code) |
|
| 183 | 183 | { |
| 184 | 184 | return $cmd; |
| 185 | 185 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $this->multiline = $val->isValid(); |
| 44 | 44 | |
| 45 | - if($val->isValid()) |
|
| 45 | + if ($val->isValid()) |
|
| 46 | 46 | { |
| 47 | 47 | $this->multilineToken = $val->getToken(); |
| 48 | 48 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function getMultilineToken() : ?Mailcode_Parser_Statement_Tokenizer_Token_Keyword |
| 57 | 57 | { |
| 58 | - if($this->multilineToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword) |
|
| 58 | + if ($this->multilineToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword) |
|
| 59 | 59 | { |
| 60 | 60 | return $this->multilineToken; |
| 61 | 61 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | $this |
| 42 | 42 | ); |
| 43 | 43 | |
| 44 | - if(!$this->params->isValid() && $this->requiresParameters()) |
|
| 44 | + if (!$this->params->isValid() && $this->requiresParameters()) |
|
| 45 | 45 | { |
| 46 | 46 | $error = $this->params->getValidationResult(); |
| 47 | 47 | |
@@ -40,15 +40,15 @@ |
||
| 40 | 40 | { |
| 41 | 41 | $opening = $this->getOpeningCommand(); |
| 42 | 42 | |
| 43 | - if($opening === null) { |
|
| 43 | + if ($opening === null) { |
|
| 44 | 44 | return array(); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | $siblings = $opening->getSiblingCommands(); |
| 48 | 48 | $result = array(); |
| 49 | - foreach($siblings as $sibling) |
|
| 49 | + foreach ($siblings as $sibling) |
|
| 50 | 50 | { |
| 51 | - if($sibling !== $this) { |
|
| 51 | + if ($sibling !== $this) { |
|
| 52 | 52 | $result[] = $sibling; |
| 53 | 53 | } |
| 54 | 54 | } |