@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | $this->instantiator->checkCommand($cmd); |
35 | 35 | |
36 | - if($cmd instanceof Mailcode_Commands_Command_ShowVariable) |
|
36 | + if ($cmd instanceof Mailcode_Commands_Command_ShowVariable) |
|
37 | 37 | { |
38 | 38 | return $cmd; |
39 | 39 | } |
@@ -41,12 +41,12 @@ discard block |
||
41 | 41 | throw $this->instantiator->exceptionUnexpectedType('ShowVariable', $cmd); |
42 | 42 | } |
43 | 43 | |
44 | - public function date(string $variableName, string $formatString="") : Mailcode_Commands_Command_ShowDate |
|
44 | + public function date(string $variableName, string $formatString = "") : Mailcode_Commands_Command_ShowDate |
|
45 | 45 | { |
46 | 46 | $variableName = $this->instantiator->filterVariableName($variableName); |
47 | 47 | |
48 | 48 | $format = ''; |
49 | - if(!empty($formatString)) |
|
49 | + if (!empty($formatString)) |
|
50 | 50 | { |
51 | 51 | $format = sprintf( |
52 | 52 | ' "%s"', |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | $this->instantiator->checkCommand($cmd); |
69 | 69 | |
70 | - if($cmd instanceof Mailcode_Commands_Command_ShowDate) |
|
70 | + if ($cmd instanceof Mailcode_Commands_Command_ShowDate) |
|
71 | 71 | { |
72 | 72 | return $cmd; |
73 | 73 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | throw $this->instantiator->exceptionUnexpectedType('ShowDate', $cmd); |
76 | 76 | } |
77 | 77 | |
78 | - public function number(string $variableName, string $formatString="", bool $absolute=false) : Mailcode_Commands_Command_ShowNumber |
|
78 | + public function number(string $variableName, string $formatString = "", bool $absolute = false) : Mailcode_Commands_Command_ShowNumber |
|
79 | 79 | { |
80 | 80 | $variableName = $this->instantiator->filterVariableName($variableName); |
81 | 81 | $paramsString = $this->compileNumberParams($formatString, $absolute); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | $this->instantiator->checkCommand($cmd); |
95 | 95 | |
96 | - if($cmd instanceof Mailcode_Commands_Command_ShowNumber) |
|
96 | + if ($cmd instanceof Mailcode_Commands_Command_ShowNumber) |
|
97 | 97 | { |
98 | 98 | return $cmd; |
99 | 99 | } |
@@ -101,11 +101,11 @@ discard block |
||
101 | 101 | throw $this->instantiator->exceptionUnexpectedType('ShowNumber', $cmd); |
102 | 102 | } |
103 | 103 | |
104 | - private function compileNumberParams(string $formatString="", bool $absolute=false) : string |
|
104 | + private function compileNumberParams(string $formatString = "", bool $absolute = false) : string |
|
105 | 105 | { |
106 | 106 | $params = array(); |
107 | 107 | |
108 | - if(!empty($formatString)) |
|
108 | + if (!empty($formatString)) |
|
109 | 109 | { |
110 | 110 | $params[] = sprintf( |
111 | 111 | ' "%s"', |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | ); |
114 | 114 | } |
115 | 115 | |
116 | - if($absolute) |
|
116 | + if ($absolute) |
|
117 | 117 | { |
118 | 118 | $params[] = ' absolute:'; |
119 | 119 | } |
120 | 120 | |
121 | - if(!empty($params)) |
|
121 | + if (!empty($params)) |
|
122 | 122 | { |
123 | 123 | return ' '.implode(' ', $params); |
124 | 124 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * @throws Mailcode_Exception |
137 | 137 | * @throws Mailcode_Factory_Exception |
138 | 138 | */ |
139 | - public function phone(string $variableName, string $sourceFormat, string $urlEncoding=Mailcode_Factory::URL_ENCODING_NONE) : Mailcode_Commands_Command_ShowPhone |
|
139 | + public function phone(string $variableName, string $sourceFormat, string $urlEncoding = Mailcode_Factory::URL_ENCODING_NONE) : Mailcode_Commands_Command_ShowPhone |
|
140 | 140 | { |
141 | 141 | $variableName = $this->instantiator->filterVariableName($variableName); |
142 | 142 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $this->instantiator->checkCommand($cmd); |
160 | 160 | $this->instantiator->setEncoding($cmd, $urlEncoding); |
161 | 161 | |
162 | - if($cmd instanceof Mailcode_Commands_Command_ShowPhone) |
|
162 | + if ($cmd instanceof Mailcode_Commands_Command_ShowPhone) |
|
163 | 163 | { |
164 | 164 | return $cmd; |
165 | 165 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | |
181 | 181 | $this->instantiator->checkCommand($cmd); |
182 | 182 | |
183 | - if($cmd instanceof Mailcode_Commands_Command_ShowSnippet) |
|
183 | + if ($cmd instanceof Mailcode_Commands_Command_ShowSnippet) |
|
184 | 184 | { |
185 | 185 | return $cmd; |
186 | 186 | } |
@@ -8,7 +8,7 @@ |
||
8 | 8 | { |
9 | 9 | public const VALIDATION_NAME_NOHTML = 'nohtml'; |
10 | 10 | |
11 | - public function setHTMLEnabled(bool $enabled=true); |
|
11 | + public function setHTMLEnabled(bool $enabled = true); |
|
12 | 12 | |
13 | 13 | public function isHTMLEnabled() : bool; |
14 | 14 |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | public const VALIDATION_INVALID_DECIMAL_SEPARATOR = 72209; |
32 | 32 | public const VALIDATION_SEPARATORS_SAME_CHARACTER = 72210; |
33 | 33 | |
34 | - /** |
|
35 | - * The default number format string. |
|
36 | - * @var string |
|
37 | - */ |
|
34 | + /** |
|
35 | + * The default number format string. |
|
36 | + * @var string |
|
37 | + */ |
|
38 | 38 | private $formatString = Mailcode_Number_Info::DEFAULT_FORMAT; |
39 | 39 | |
40 | 40 | /** |
@@ -65,16 +65,16 @@ discard block |
||
65 | 65 | |
66 | 66 | protected function validateSyntax_check_format() : void |
67 | 67 | { |
68 | - $tokens = $this->params->getInfo()->getStringLiterals(); |
|
68 | + $tokens = $this->params->getInfo()->getStringLiterals(); |
|
69 | 69 | |
70 | - // no format specified? Use the default one. |
|
71 | - if(empty($tokens)) |
|
72 | - { |
|
73 | - return; |
|
74 | - } |
|
75 | - |
|
76 | - $token = array_pop($tokens); |
|
77 | - $this->parseFormatString($token->getText()); |
|
70 | + // no format specified? Use the default one. |
|
71 | + if(empty($tokens)) |
|
72 | + { |
|
73 | + return; |
|
74 | + } |
|
75 | + |
|
76 | + $token = array_pop($tokens); |
|
77 | + $this->parseFormatString($token->getText()); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | protected function validateSyntax_absolute() : void |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | ); |
108 | 108 | } |
109 | 109 | |
110 | - /** |
|
111 | - * Retrieves the format string used to format the number. |
|
112 | - * |
|
113 | - * @return string |
|
114 | - */ |
|
110 | + /** |
|
111 | + * Retrieves the format string used to format the number. |
|
112 | + * |
|
113 | + * @return string |
|
114 | + */ |
|
115 | 115 | public function getFormatString() : string |
116 | 116 | { |
117 | 117 | return $this->formatString; |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | |
133 | 133 | if($absolute === true && !isset($this->absoluteKeyword)) |
134 | 134 | { |
135 | - $this->params |
|
136 | - ->getInfo() |
|
137 | - ->addKeyword(Mailcode_Commands_Keywords::TYPE_ABSOLUTE); |
|
135 | + $this->params |
|
136 | + ->getInfo() |
|
137 | + ->addKeyword(Mailcode_Commands_Keywords::TYPE_ABSOLUTE); |
|
138 | 138 | |
139 | - $this->validateSyntax_absolute(); |
|
139 | + $this->validateSyntax_absolute(); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | return $this; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $tokens = $this->params->getInfo()->getStringLiterals(); |
69 | 69 | |
70 | 70 | // no format specified? Use the default one. |
71 | - if(empty($tokens)) |
|
71 | + if (empty($tokens)) |
|
72 | 72 | { |
73 | 73 | return; |
74 | 74 | } |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | { |
82 | 82 | $keywords = $this->params->getInfo()->getKeywords(); |
83 | 83 | |
84 | - foreach($keywords as $keyword) |
|
84 | + foreach ($keywords as $keyword) |
|
85 | 85 | { |
86 | - if($keyword->getKeyword() === Mailcode_Commands_Keywords::TYPE_ABSOLUTE) |
|
86 | + if ($keyword->getKeyword() === Mailcode_Commands_Keywords::TYPE_ABSOLUTE) |
|
87 | 87 | { |
88 | 88 | $this->absoluteKeyword = $keyword; |
89 | 89 | break; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | { |
96 | 96 | $result = new Mailcode_Number_Info($format); |
97 | 97 | |
98 | - if($result->isValid()) |
|
98 | + if ($result->isValid()) |
|
99 | 99 | { |
100 | 100 | $this->formatString = $format; |
101 | 101 | return; |
@@ -124,13 +124,13 @@ discard block |
||
124 | 124 | |
125 | 125 | public function setAbsolute(bool $absolute) : Mailcode_Commands_Command_ShowNumber |
126 | 126 | { |
127 | - if($absolute === false && isset($this->absoluteKeyword)) |
|
127 | + if ($absolute === false && isset($this->absoluteKeyword)) |
|
128 | 128 | { |
129 | 129 | $this->params->getInfo()->removeKeyword($this->absoluteKeyword->getKeyword()); |
130 | 130 | $this->absoluteKeyword = null; |
131 | 131 | } |
132 | 132 | |
133 | - if($absolute === true && !isset($this->absoluteKeyword)) |
|
133 | + if ($absolute === true && !isset($this->absoluteKeyword)) |
|
134 | 134 | { |
135 | 135 | $this->params |
136 | 136 | ->getInfo() |