@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | public function getHash() : string |
| 85 | 85 | { |
| 86 | - if(empty($this->hash)) |
|
| 86 | + if (empty($this->hash)) |
|
| 87 | 87 | { |
| 88 | 88 | $this->hash = md5($this->matchedText); |
| 89 | 89 | } |
@@ -107,14 +107,14 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | protected function validate() : void |
| 109 | 109 | { |
| 110 | - if(isset($this->validationResult)) |
|
| 110 | + if (isset($this->validationResult)) |
|
| 111 | 111 | { |
| 112 | 112 | return; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | $this->validationResult = new OperationResult($this); |
| 116 | 116 | |
| 117 | - if(is_numeric(substr($this->path, 0, 1))) |
|
| 117 | + if (is_numeric(substr($this->path, 0, 1))) |
|
| 118 | 118 | { |
| 119 | 119 | $this->validationResult->makeError( |
| 120 | 120 | t( |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | ); |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - if(is_numeric(substr($this->name, 0, 1))) |
|
| 129 | + if (is_numeric(substr($this->name, 0, 1))) |
|
| 130 | 130 | { |
| 131 | 131 | $this->validationResult->makeError( |
| 132 | 132 | t( |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | public function add(Mailcode_Variables_Variable $variable) : Mailcode_Variables_Collection |
| 34 | 34 | { |
| 35 | - if(!$variable->isValid()) |
|
| 35 | + if (!$variable->isValid()) |
|
| 36 | 36 | { |
| 37 | 37 | return $this->addInvalid($variable); |
| 38 | 38 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | parent::mergeWith($collection); |
| 77 | 77 | |
| 78 | 78 | // also inherit any invalid variables |
| 79 | - if($collection instanceof Mailcode_Variables_Collection_Regular) |
|
| 79 | + if ($collection instanceof Mailcode_Variables_Collection_Regular) |
|
| 80 | 80 | { |
| 81 | 81 | $invalid = $collection->getInvalid(); |
| 82 | 82 | |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | { |
| 25 | 25 | public function add(Mailcode_Variables_Variable $variable) : Mailcode_Variables_Collection |
| 26 | 26 | { |
| 27 | - if($variable->isValid()) |
|
| 27 | + if ($variable->isValid()) |
|
| 28 | 28 | { |
| 29 | 29 | return $this; |
| 30 | 30 | } |
@@ -66,9 +66,9 @@ discard block |
||
| 66 | 66 | { |
| 67 | 67 | $fullName = $this->fixName($fullName); |
| 68 | 68 | |
| 69 | - foreach($this->variables as $variable) |
|
| 69 | + foreach ($this->variables as $variable) |
|
| 70 | 70 | { |
| 71 | - if($variable->getFullName() === $fullName) |
|
| 71 | + if ($variable->getFullName() === $fullName) |
|
| 72 | 72 | { |
| 73 | 73 | return true; |
| 74 | 74 | } |
@@ -91,9 +91,9 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | $collection = new Mailcode_Variables_Collection_Regular(); |
| 93 | 93 | |
| 94 | - foreach($this->variables as $variable) |
|
| 94 | + foreach ($this->variables as $variable) |
|
| 95 | 95 | { |
| 96 | - if($variable->getFullName() === $fullName) |
|
| 96 | + if ($variable->getFullName() === $fullName) |
|
| 97 | 97 | { |
| 98 | 98 | $collection->add($variable); |
| 99 | 99 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | protected function fixName(string $fullName) : string |
| 112 | 112 | { |
| 113 | - if(substr($fullName, 0, 1) === '$') |
|
| 113 | + if (substr($fullName, 0, 1) === '$') |
|
| 114 | 114 | { |
| 115 | 115 | return $fullName; |
| 116 | 116 | } |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | { |
| 139 | 139 | $entries = array(); |
| 140 | 140 | |
| 141 | - foreach($this->variables as $variable) |
|
| 141 | + foreach ($this->variables as $variable) |
|
| 142 | 142 | { |
| 143 | 143 | $entries[$variable->getFullName()] = $variable; |
| 144 | 144 | } |
@@ -154,11 +154,11 @@ discard block |
||
| 154 | 154 | { |
| 155 | 155 | $result = array(); |
| 156 | 156 | |
| 157 | - foreach($this->variables as $variable) |
|
| 157 | + foreach ($this->variables as $variable) |
|
| 158 | 158 | { |
| 159 | 159 | $name = $variable->getFullName(); |
| 160 | 160 | |
| 161 | - if(!in_array($name, $result)) |
|
| 161 | + if (!in_array($name, $result)) |
|
| 162 | 162 | { |
| 163 | 163 | $result[] = $name; |
| 164 | 164 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | { |
| 198 | 198 | $variables = $collection->getGroupedByHash(); |
| 199 | 199 | |
| 200 | - foreach($variables as $variable) |
|
| 200 | + foreach ($variables as $variable) |
|
| 201 | 201 | { |
| 202 | 202 | $this->add($variable); |
| 203 | 203 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | { |
| 41 | 41 | $hash = $command->getHash(); |
| 42 | 42 | |
| 43 | - if(!isset($this->commands[$hash])) { |
|
| 43 | + if (!isset($this->commands[$hash])) { |
|
| 44 | 44 | $this->commands[$hash] = $command; |
| 45 | 45 | } |
| 46 | 46 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | public function addCommands(array $commands) : Mailcode_Collection |
| 108 | 108 | { |
| 109 | - foreach($commands as $command) |
|
| 109 | + foreach ($commands as $command) |
|
| 110 | 110 | { |
| 111 | 111 | $this->addCommand($command); |
| 112 | 112 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | { |
| 126 | 126 | $collection = new Mailcode_Variables_Collection_Regular(); |
| 127 | 127 | |
| 128 | - foreach($this->commands as $command) |
|
| 128 | + foreach ($this->commands as $command) |
|
| 129 | 129 | { |
| 130 | 130 | $collection->mergeWith($command->getVariables()); |
| 131 | 131 | } |
@@ -35,12 +35,12 @@ |
||
| 35 | 35 | $matches = array(); |
| 36 | 36 | preg_match_all(self::REGEX_VARIABLE_NAME, $subject, $matches, PREG_PATTERN_ORDER); |
| 37 | 37 | |
| 38 | - if(!isset($matches[0]) || empty($matches[0])) |
|
| 38 | + if (!isset($matches[0]) || empty($matches[0])) |
|
| 39 | 39 | { |
| 40 | 40 | return $collection; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - foreach($matches[0] as $idx => $matchedText) |
|
| 43 | + foreach ($matches[0] as $idx => $matchedText) |
|
| 44 | 44 | { |
| 45 | 45 | $path = $matches[1][$idx]; |
| 46 | 46 | $name = $matches[2][$idx]; |