@@ -24,15 +24,15 @@ discard block |
||
24 | 24 | |
25 | 25 | const VALIDATION_NOT_A_FORMAT_STRING = 55401; |
26 | 26 | |
27 | - /** |
|
28 | - * The date format string. |
|
29 | - * @var string |
|
30 | - */ |
|
27 | + /** |
|
28 | + * The date format string. |
|
29 | + * @var string |
|
30 | + */ |
|
31 | 31 | private $formatString = "Y/m/d"; |
32 | 32 | |
33 | - /** |
|
34 | - * @var Mailcode_Date_FormatInfo |
|
35 | - */ |
|
33 | + /** |
|
34 | + * @var Mailcode_Date_FormatInfo |
|
35 | + */ |
|
36 | 36 | private $formatInfo; |
37 | 37 | |
38 | 38 | public function getName() : string |
@@ -88,46 +88,46 @@ discard block |
||
88 | 88 | |
89 | 89 | protected function validateSyntax_check_format() : void |
90 | 90 | { |
91 | - $token = $this->params->getInfo()->getTokenByIndex(1); |
|
91 | + $token = $this->params->getInfo()->getTokenByIndex(1); |
|
92 | 92 | |
93 | - // no format specified? Use the default one. |
|
94 | - if($token === null) |
|
95 | - { |
|
96 | - return; |
|
97 | - } |
|
93 | + // no format specified? Use the default one. |
|
94 | + if($token === null) |
|
95 | + { |
|
96 | + return; |
|
97 | + } |
|
98 | 98 | |
99 | - if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) |
|
100 | - { |
|
101 | - $format = $token->getText(); |
|
99 | + if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) |
|
100 | + { |
|
101 | + $format = $token->getText(); |
|
102 | 102 | |
103 | - $result = $this->formatInfo->validateFormat($format); |
|
103 | + $result = $this->formatInfo->validateFormat($format); |
|
104 | 104 | |
105 | - if($result->isValid()) |
|
106 | - { |
|
105 | + if($result->isValid()) |
|
106 | + { |
|
107 | 107 | $this->formatString = $format; |
108 | - } |
|
109 | - else |
|
110 | - { |
|
111 | - $this->validationResult->makeError( |
|
112 | - $result->getErrorMessage(), |
|
113 | - $result->getCode() |
|
114 | - ); |
|
115 | - } |
|
108 | + } |
|
109 | + else |
|
110 | + { |
|
111 | + $this->validationResult->makeError( |
|
112 | + $result->getErrorMessage(), |
|
113 | + $result->getCode() |
|
114 | + ); |
|
115 | + } |
|
116 | 116 | |
117 | - return; |
|
118 | - } |
|
117 | + return; |
|
118 | + } |
|
119 | 119 | |
120 | - $this->validationResult->makeError( |
|
120 | + $this->validationResult->makeError( |
|
121 | 121 | t('The second parameter must be a date format string.'), |
122 | 122 | self::VALIDATION_NOT_A_FORMAT_STRING |
123 | - ); |
|
123 | + ); |
|
124 | 124 | } |
125 | 125 | |
126 | - /** |
|
127 | - * Retrieves the format string used to format the date. |
|
128 | - * |
|
129 | - * @return string A PHP compatible date format string. |
|
130 | - */ |
|
126 | + /** |
|
127 | + * Retrieves the format string used to format the date. |
|
128 | + * |
|
129 | + * @return string A PHP compatible date format string. |
|
130 | + */ |
|
131 | 131 | public function getFormatString() : string |
132 | 132 | { |
133 | 133 | return $this->formatString; |
@@ -71,7 +71,7 @@ |
||
71 | 71 | { |
72 | 72 | $tokens = $this->params->getInfo()->getTokens(); |
73 | 73 | |
74 | - if(count($tokens) > 1) |
|
74 | + if (count($tokens) > 1) |
|
75 | 75 | { |
76 | 76 | $this->validationResult->makeError( |
77 | 77 | t('Unknown parameters found:').' '. |