@@ -26,39 +26,39 @@ discard block |
||
| 26 | 26 | const ERROR_CANNOT_GET_INVALID_COMMAND = 60601; |
| 27 | 27 | const ERROR_CANNOT_OVERWRITE_PARAMETERS = 60602; |
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * @var Mailcode_Commands_LogicKeywords |
|
| 31 | - */ |
|
| 29 | + /** |
|
| 30 | + * @var Mailcode_Commands_LogicKeywords |
|
| 31 | + */ |
|
| 32 | 32 | private $keywords; |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * @var string |
|
| 36 | - */ |
|
| 34 | + /** |
|
| 35 | + * @var string |
|
| 36 | + */ |
|
| 37 | 37 | private $name; |
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * @var string |
|
| 41 | - */ |
|
| 39 | + /** |
|
| 40 | + * @var string |
|
| 41 | + */ |
|
| 42 | 42 | private $keywordType; |
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * @var string |
|
| 46 | - */ |
|
| 44 | + /** |
|
| 45 | + * @var string |
|
| 46 | + */ |
|
| 47 | 47 | private $matchedString; |
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * @var string |
|
| 51 | - */ |
|
| 49 | + /** |
|
| 50 | + * @var string |
|
| 51 | + */ |
|
| 52 | 52 | private $params = ''; |
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * @var boolean |
|
| 56 | - */ |
|
| 54 | + /** |
|
| 55 | + * @var boolean |
|
| 56 | + */ |
|
| 57 | 57 | private $paramsSet = false; |
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * @var Mailcode_Collection |
|
| 61 | - */ |
|
| 59 | + /** |
|
| 60 | + * @var Mailcode_Collection |
|
| 61 | + */ |
|
| 62 | 62 | private $collection; |
| 63 | 63 | |
| 64 | 64 | public function __construct(Mailcode_Commands_LogicKeywords $keywords, string $name, string $matchedString, string $type) |
@@ -69,10 +69,10 @@ discard block |
||
| 69 | 69 | $this->matchedString = $matchedString; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - /** |
|
| 73 | - * The keyword name, e.g. "and". Always lowercase. |
|
| 74 | - * @return string |
|
| 75 | - */ |
|
| 72 | + /** |
|
| 73 | + * The keyword name, e.g. "and". Always lowercase. |
|
| 74 | + * @return string |
|
| 75 | + */ |
|
| 76 | 76 | public function getName() : string |
| 77 | 77 | { |
| 78 | 78 | return $this->name; |
@@ -95,24 +95,24 @@ discard block |
||
| 95 | 95 | return $string; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - /** |
|
| 99 | - * The full string that was matched in the command's parameters |
|
| 100 | - * string. Examples: "and:", "and variable:"... |
|
| 101 | - * |
|
| 102 | - * @return string |
|
| 103 | - */ |
|
| 98 | + /** |
|
| 99 | + * The full string that was matched in the command's parameters |
|
| 100 | + * string. Examples: "and:", "and variable:"... |
|
| 101 | + * |
|
| 102 | + * @return string |
|
| 103 | + */ |
|
| 104 | 104 | public function getMatchedString() : string |
| 105 | 105 | { |
| 106 | 106 | return $this->matchedString; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - /** |
|
| 110 | - * Sets the parameters string matching this logic keyword, |
|
| 111 | - * which is used to build the actual sub-command. Set by |
|
| 112 | - * the LogicKeywords class instance. |
|
| 113 | - * |
|
| 114 | - * @param string $params |
|
| 115 | - */ |
|
| 109 | + /** |
|
| 110 | + * Sets the parameters string matching this logic keyword, |
|
| 111 | + * which is used to build the actual sub-command. Set by |
|
| 112 | + * the LogicKeywords class instance. |
|
| 113 | + * |
|
| 114 | + * @param string $params |
|
| 115 | + */ |
|
| 116 | 116 | public function setParamsString(string $params) : void |
| 117 | 117 | { |
| 118 | 118 | if($this->paramsSet) |
@@ -130,13 +130,13 @@ discard block |
||
| 130 | 130 | $this->createCommand(); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - /** |
|
| 134 | - * Retrieves the full command string used to create |
|
| 135 | - * the actual command. For opening commands like IF, |
|
| 136 | - * this includes the closing {end} command. |
|
| 137 | - * |
|
| 138 | - * @return string |
|
| 139 | - */ |
|
| 133 | + /** |
|
| 134 | + * Retrieves the full command string used to create |
|
| 135 | + * the actual command. For opening commands like IF, |
|
| 136 | + * this includes the closing {end} command. |
|
| 137 | + * |
|
| 138 | + * @return string |
|
| 139 | + */ |
|
| 140 | 140 | public function getCommandString() : string |
| 141 | 141 | { |
| 142 | 142 | $command = $this->keywords->getCommand(); |
@@ -169,12 +169,12 @@ discard block |
||
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - /** |
|
| 173 | - * Retrieves the command for the keyword. |
|
| 174 | - * |
|
| 175 | - * @throws Mailcode_Exception |
|
| 176 | - * @return Mailcode_Commands_Command |
|
| 177 | - */ |
|
| 172 | + /** |
|
| 173 | + * Retrieves the command for the keyword. |
|
| 174 | + * |
|
| 175 | + * @throws Mailcode_Exception |
|
| 176 | + * @return Mailcode_Commands_Command |
|
| 177 | + */ |
|
| 178 | 178 | public function getCommand() : Mailcode_Commands_Command |
| 179 | 179 | { |
| 180 | 180 | $command = $this->collection->getFirstCommand(); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | { |
| 88 | 88 | $string = $this->name; |
| 89 | 89 | |
| 90 | - if(!empty($this->keywordType)) |
|
| 90 | + if (!empty($this->keywordType)) |
|
| 91 | 91 | { |
| 92 | 92 | $string .= ' '.$this->keywordType; |
| 93 | 93 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | public function setParamsString(string $params) : void |
| 117 | 117 | { |
| 118 | - if($this->paramsSet) |
|
| 118 | + if ($this->paramsSet) |
|
| 119 | 119 | { |
| 120 | 120 | throw new Mailcode_Exception( |
| 121 | 121 | 'Cannot set parameters twice', |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | ); |
| 150 | 150 | |
| 151 | 151 | // automatically close opening commands to be able to parse valid strings. |
| 152 | - if($command instanceof Mailcode_Commands_Command_Type_Opening) |
|
| 152 | + if ($command instanceof Mailcode_Commands_Command_Type_Opening) |
|
| 153 | 153 | { |
| 154 | 154 | $string .= '{end}'; |
| 155 | 155 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | { |
| 162 | 162 | $this->collection = Mailcode::create()->parseString($this->getCommandString()); |
| 163 | 163 | |
| 164 | - if(!$this->collection->isValid()) |
|
| 164 | + if (!$this->collection->isValid()) |
|
| 165 | 165 | { |
| 166 | 166 | $error = $this->collection->getFirstError(); |
| 167 | 167 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | { |
| 180 | 180 | $command = $this->collection->getFirstCommand(); |
| 181 | 181 | |
| 182 | - if($this->collection->isValid() && $command !== null) |
|
| 182 | + if ($this->collection->isValid() && $command !== null) |
|
| 183 | 183 | { |
| 184 | 184 | return $command; |
| 185 | 185 | } |