@@ -25,34 +25,34 @@ |
||
25 | 25 | */ |
26 | 26 | class ConvertHelper_StorageSizeEnum_Size |
27 | 27 | { |
28 | - /** |
|
29 | - * @var string |
|
30 | - */ |
|
28 | + /** |
|
29 | + * @var string |
|
30 | + */ |
|
31 | 31 | protected $name; |
32 | 32 | |
33 | - /** |
|
34 | - * @var int |
|
35 | - */ |
|
33 | + /** |
|
34 | + * @var int |
|
35 | + */ |
|
36 | 36 | protected $base; |
37 | 37 | |
38 | - /** |
|
39 | - * @var int |
|
40 | - */ |
|
38 | + /** |
|
39 | + * @var int |
|
40 | + */ |
|
41 | 41 | protected $exponent; |
42 | 42 | |
43 | - /** |
|
44 | - * @var string |
|
45 | - */ |
|
43 | + /** |
|
44 | + * @var string |
|
45 | + */ |
|
46 | 46 | protected $singular; |
47 | 47 | |
48 | - /** |
|
49 | - * @var string |
|
50 | - */ |
|
48 | + /** |
|
49 | + * @var string |
|
50 | + */ |
|
51 | 51 | protected $plural; |
52 | 52 | |
53 | - /** |
|
54 | - * @var string |
|
55 | - */ |
|
53 | + /** |
|
54 | + * @var string |
|
55 | + */ |
|
56 | 56 | protected $suffix; |
57 | 57 | |
58 | 58 | public function __construct(string $name, int $base, int $exponent, string $suffix, string $singular, string $plural) |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @return string |
100 | 100 | * @see ConvertHelper::bytes2readable() |
101 | 101 | */ |
102 | - public function toString(int $precision=1) : string |
|
102 | + public function toString(int $precision = 1) : string |
|
103 | 103 | { |
104 | 104 | return ConvertHelper::bytes2readable($this->bytes, $precision, $this->getBase()); |
105 | 105 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public function getBase() : int |
112 | 112 | { |
113 | - if($this->isValid()) { |
|
113 | + if ($this->isValid()) { |
|
114 | 114 | return $this->sizeDefinition->getBase(); |
115 | 115 | } |
116 | 116 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function getSizeDefinition() : ?ConvertHelper_StorageSizeEnum_Size |
128 | 128 | { |
129 | - if($this->isValid()) { |
|
129 | + if ($this->isValid()) { |
|
130 | 130 | return $this->sizeDefinition; |
131 | 131 | } |
132 | 132 | |
@@ -175,18 +175,18 @@ discard block |
||
175 | 175 | |
176 | 176 | protected function parseSize() : void |
177 | 177 | { |
178 | - if(!$this->detectParts()) { |
|
178 | + if (!$this->detectParts()) { |
|
179 | 179 | return; |
180 | 180 | } |
181 | 181 | |
182 | 182 | // we detected units in the string: all good. |
183 | - if($this->units !== null) |
|
183 | + if ($this->units !== null) |
|
184 | 184 | { |
185 | 185 | return; |
186 | 186 | } |
187 | 187 | |
188 | 188 | // just a numeric value: we assume this means we're dealing with bytes. |
189 | - if(is_numeric($this->number)) |
|
189 | + if (is_numeric($this->number)) |
|
190 | 190 | { |
191 | 191 | $this->units = 'b'; |
192 | 192 | return; |
@@ -212,12 +212,12 @@ discard block |
||
212 | 212 | |
213 | 213 | $number = $this->sizeString; |
214 | 214 | |
215 | - foreach($units as $unit) |
|
215 | + foreach ($units as $unit) |
|
216 | 216 | { |
217 | - if(stristr($number, $unit)) |
|
217 | + if (stristr($number, $unit)) |
|
218 | 218 | { |
219 | 219 | // there are more than 1 unit defined in the string |
220 | - if($this->units !== null) |
|
220 | + if ($this->units !== null) |
|
221 | 221 | { |
222 | 222 | $this->setError( |
223 | 223 | t( |
@@ -273,14 +273,14 @@ discard block |
||
273 | 273 | { |
274 | 274 | $this->parseSize(); |
275 | 275 | |
276 | - if(!$this->valid) { |
|
276 | + if (!$this->valid) { |
|
277 | 277 | return; |
278 | 278 | } |
279 | 279 | |
280 | 280 | $int = intval($this->number); |
281 | 281 | |
282 | 282 | // negative values |
283 | - if($int < 0) |
|
283 | + if ($int < 0) |
|
284 | 284 | { |
285 | 285 | $this->setError( |
286 | 286 | t('Negative values cannot be used as size.'), |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | |
32 | 32 | public const VALIDATION_ERROR_NEGATIVE_VALUE = 43803; |
33 | 33 | |
34 | - /** |
|
35 | - * @var string |
|
36 | - */ |
|
34 | + /** |
|
35 | + * @var string |
|
36 | + */ |
|
37 | 37 | protected $sizeString; |
38 | 38 | |
39 | 39 | /** |
@@ -41,44 +41,44 @@ discard block |
||
41 | 41 | */ |
42 | 42 | protected $sizeDefinition; |
43 | 43 | |
44 | - /** |
|
45 | - * @var integer |
|
46 | - */ |
|
44 | + /** |
|
45 | + * @var integer |
|
46 | + */ |
|
47 | 47 | protected $bytes = 0; |
48 | 48 | |
49 | - /** |
|
50 | - * @var bool |
|
51 | - */ |
|
49 | + /** |
|
50 | + * @var bool |
|
51 | + */ |
|
52 | 52 | protected $valid = true; |
53 | 53 | |
54 | - /** |
|
55 | - * @var string |
|
56 | - */ |
|
54 | + /** |
|
55 | + * @var string |
|
56 | + */ |
|
57 | 57 | protected $units = null; |
58 | 58 | |
59 | - /** |
|
60 | - * @var string |
|
61 | - */ |
|
59 | + /** |
|
60 | + * @var string |
|
61 | + */ |
|
62 | 62 | protected $number = ''; |
63 | 63 | |
64 | - /** |
|
65 | - * @var string |
|
66 | - */ |
|
64 | + /** |
|
65 | + * @var string |
|
66 | + */ |
|
67 | 67 | protected $errorMessage = ''; |
68 | 68 | |
69 | - /** |
|
70 | - * @var int |
|
71 | - */ |
|
69 | + /** |
|
70 | + * @var int |
|
71 | + */ |
|
72 | 72 | protected $errorCode = 0; |
73 | 73 | |
74 | - /** |
|
75 | - * Create a new instance for the specified size string. |
|
76 | - * |
|
77 | - * @param string $sizeString A size notation in the format "50 MB", or a number of bytes without units. Spaces are ignored, so "50MB" = "50 MB" = " 50 MB ". Floating point values are accepted, both with dot and comma notation ("50.5" = "50,5"). To use Base 2 values, ose appropriate units, e.g. "50 MiB", "1.5 GiB". The units are case-insensitive, so "50 MB" = "50 mb". |
|
78 | - * |
|
79 | - * @throws ConvertHelper_Exception |
|
80 | - * @see ConvertHelper_StorageSizeEnum::ERROR_UNKNOWN_UNIT_NAME |
|
81 | - */ |
|
74 | + /** |
|
75 | + * Create a new instance for the specified size string. |
|
76 | + * |
|
77 | + * @param string $sizeString A size notation in the format "50 MB", or a number of bytes without units. Spaces are ignored, so "50MB" = "50 MB" = " 50 MB ". Floating point values are accepted, both with dot and comma notation ("50.5" = "50,5"). To use Base 2 values, ose appropriate units, e.g. "50 MiB", "1.5 GiB". The units are case-insensitive, so "50 MB" = "50 mb". |
|
78 | + * |
|
79 | + * @throws ConvertHelper_Exception |
|
80 | + * @see ConvertHelper_StorageSizeEnum::ERROR_UNKNOWN_UNIT_NAME |
|
81 | + */ |
|
82 | 82 | public function __construct(string $sizeString) |
83 | 83 | { |
84 | 84 | $this->sizeString = $this->cleanString($sizeString); |
@@ -86,31 +86,31 @@ discard block |
||
86 | 86 | $this->convert(); |
87 | 87 | } |
88 | 88 | |
89 | - /** |
|
90 | - * Gets the amount of bytes contained in the size notation. |
|
91 | - * @return int |
|
92 | - */ |
|
89 | + /** |
|
90 | + * Gets the amount of bytes contained in the size notation. |
|
91 | + * @return int |
|
92 | + */ |
|
93 | 93 | public function toBytes() : int |
94 | 94 | { |
95 | 95 | return $this->bytes; |
96 | 96 | } |
97 | 97 | |
98 | - /** |
|
99 | - * Converts the size notation to a human-readable string, e.g. "50 MB". |
|
100 | - * |
|
101 | - * @param int $precision |
|
102 | - * @return string |
|
103 | - * @see ConvertHelper::bytes2readable() |
|
104 | - */ |
|
98 | + /** |
|
99 | + * Converts the size notation to a human-readable string, e.g. "50 MB". |
|
100 | + * |
|
101 | + * @param int $precision |
|
102 | + * @return string |
|
103 | + * @see ConvertHelper::bytes2readable() |
|
104 | + */ |
|
105 | 105 | public function toString(int $precision=1) : string |
106 | 106 | { |
107 | 107 | return ConvertHelper::bytes2readable($this->bytes, $precision, $this->getBase()); |
108 | 108 | } |
109 | 109 | |
110 | - /** |
|
111 | - * Retrieves the detected number's base. |
|
112 | - * @return int The base number (1000 for Base 10, or 1024 for Base 2), or 0 if it is not valid. |
|
113 | - */ |
|
110 | + /** |
|
111 | + * Retrieves the detected number's base. |
|
112 | + * @return int The base number (1000 for Base 10, or 1024 for Base 2), or 0 if it is not valid. |
|
113 | + */ |
|
114 | 114 | public function getBase() : int |
115 | 115 | { |
116 | 116 | if($this->isValid()) { |
@@ -120,13 +120,13 @@ discard block |
||
120 | 120 | return 0; |
121 | 121 | } |
122 | 122 | |
123 | - /** |
|
124 | - * Retrieves the detected storage size instance, if |
|
125 | - * the size string is valid. |
|
126 | - * |
|
127 | - * @return ConvertHelper_StorageSizeEnum_Size|NULL |
|
128 | - * @see ConvertHelper_StorageSizeEnum_Size |
|
129 | - */ |
|
123 | + /** |
|
124 | + * Retrieves the detected storage size instance, if |
|
125 | + * the size string is valid. |
|
126 | + * |
|
127 | + * @return ConvertHelper_StorageSizeEnum_Size|NULL |
|
128 | + * @see ConvertHelper_StorageSizeEnum_Size |
|
129 | + */ |
|
130 | 130 | public function getSizeDefinition() : ?ConvertHelper_StorageSizeEnum_Size |
131 | 131 | { |
132 | 132 | if($this->isValid()) { |
@@ -136,27 +136,27 @@ discard block |
||
136 | 136 | return null; |
137 | 137 | } |
138 | 138 | |
139 | - /** |
|
140 | - * Checks whether the size notation was valid and could be parsed |
|
141 | - * into a meaningful byte value. If this returns `false`, it is |
|
142 | - * possible to use the `getErrorXXX` methods to retrieve information |
|
143 | - * on what went wrong. |
|
144 | - * |
|
145 | - * @return bool |
|
146 | - * @see ConvertHelper_SizeNotation::getErrorMessage() |
|
147 | - * @see ConvertHelper_SizeNotation::getErrorCode() |
|
148 | - */ |
|
139 | + /** |
|
140 | + * Checks whether the size notation was valid and could be parsed |
|
141 | + * into a meaningful byte value. If this returns `false`, it is |
|
142 | + * possible to use the `getErrorXXX` methods to retrieve information |
|
143 | + * on what went wrong. |
|
144 | + * |
|
145 | + * @return bool |
|
146 | + * @see ConvertHelper_SizeNotation::getErrorMessage() |
|
147 | + * @see ConvertHelper_SizeNotation::getErrorCode() |
|
148 | + */ |
|
149 | 149 | public function isValid() : bool |
150 | 150 | { |
151 | 151 | return $this->valid; |
152 | 152 | } |
153 | 153 | |
154 | - /** |
|
155 | - * Retrieves the error message if the size notation validation failed. |
|
156 | - * |
|
157 | - * @return string |
|
158 | - * @see ConvertHelper_SizeNotation::getErrorCode() |
|
159 | - */ |
|
154 | + /** |
|
155 | + * Retrieves the error message if the size notation validation failed. |
|
156 | + * |
|
157 | + * @return string |
|
158 | + * @see ConvertHelper_SizeNotation::getErrorCode() |
|
159 | + */ |
|
160 | 160 | public function getErrorMessage() : string |
161 | 161 | { |
162 | 162 | return $this->errorMessage; |
@@ -201,12 +201,12 @@ discard block |
||
201 | 201 | ); |
202 | 202 | } |
203 | 203 | |
204 | - /** |
|
205 | - * Detects the units and the number in the size notation string. |
|
206 | - * Populates the `units` and `number` properties. |
|
207 | - * |
|
208 | - * @return bool Whether the string could be parsed successfully. |
|
209 | - */ |
|
204 | + /** |
|
205 | + * Detects the units and the number in the size notation string. |
|
206 | + * Populates the `units` and `number` properties. |
|
207 | + * |
|
208 | + * @return bool Whether the string could be parsed successfully. |
|
209 | + */ |
|
210 | 210 | protected function detectParts() : bool |
211 | 211 | { |
212 | 212 | $units = ConvertHelper_StorageSizeEnum::getSizeNames(); |
@@ -242,16 +242,16 @@ discard block |
||
242 | 242 | return true; |
243 | 243 | } |
244 | 244 | |
245 | - /** |
|
246 | - * If the validation fails, this is used to store the reason for retrieval later. |
|
247 | - * |
|
248 | - * @param string $message |
|
249 | - * @param int $code |
|
250 | - * |
|
251 | - * @see ConvertHelper_SizeNotation::isValid() |
|
252 | - * @see ConvertHelper_SizeNotation::getErrorMessage() |
|
253 | - * @see ConvertHelper_SizeNotation::getErrorCode() |
|
254 | - */ |
|
245 | + /** |
|
246 | + * If the validation fails, this is used to store the reason for retrieval later. |
|
247 | + * |
|
248 | + * @param string $message |
|
249 | + * @param int $code |
|
250 | + * |
|
251 | + * @see ConvertHelper_SizeNotation::isValid() |
|
252 | + * @see ConvertHelper_SizeNotation::getErrorMessage() |
|
253 | + * @see ConvertHelper_SizeNotation::getErrorCode() |
|
254 | + */ |
|
255 | 255 | protected function setError(string $message, int $code) : void |
256 | 256 | { |
257 | 257 | $this->valid = false; |
@@ -259,12 +259,12 @@ discard block |
||
259 | 259 | $this->errorCode = $code; |
260 | 260 | } |
261 | 261 | |
262 | - /** |
|
263 | - * Retrieves the error code, if the size notation validation failed. |
|
264 | - * |
|
265 | - * @return int |
|
266 | - * @see ConvertHelper_SizeNotation::getErrorMessage() |
|
267 | - */ |
|
262 | + /** |
|
263 | + * Retrieves the error code, if the size notation validation failed. |
|
264 | + * |
|
265 | + * @return int |
|
266 | + * @see ConvertHelper_SizeNotation::getErrorMessage() |
|
267 | + */ |
|
268 | 268 | public function getErrorCode() : int |
269 | 269 | { |
270 | 270 | return $this->errorCode; |
@@ -28,20 +28,20 @@ discard block |
||
28 | 28 | $this->parse(); |
29 | 29 | } |
30 | 30 | |
31 | - /** |
|
32 | - * Retrieves an indexed array with accept mime types |
|
33 | - * that the client sent, in the order of preference |
|
34 | - * the client specified. |
|
35 | - * |
|
36 | - * Example: |
|
37 | - * |
|
38 | - * array( |
|
39 | - * 'text/html', |
|
40 | - * 'application/xhtml+xml', |
|
41 | - * 'image/webp' |
|
42 | - * ... |
|
43 | - * ) |
|
44 | - */ |
|
31 | + /** |
|
32 | + * Retrieves an indexed array with accept mime types |
|
33 | + * that the client sent, in the order of preference |
|
34 | + * the client specified. |
|
35 | + * |
|
36 | + * Example: |
|
37 | + * |
|
38 | + * array( |
|
39 | + * 'text/html', |
|
40 | + * 'application/xhtml+xml', |
|
41 | + * 'image/webp' |
|
42 | + * ... |
|
43 | + * ) |
|
44 | + */ |
|
45 | 45 | public function getMimeStrings() : array |
46 | 46 | { |
47 | 47 | $result = array(); |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | return $result; |
55 | 55 | } |
56 | 56 | |
57 | - /** |
|
58 | - * Checks that an accept header string exists, and tries to parse it. |
|
59 | - */ |
|
57 | + /** |
|
58 | + * Checks that an accept header string exists, and tries to parse it. |
|
59 | + */ |
|
60 | 60 | protected function parse() : void |
61 | 61 | { |
62 | 62 | // we may be in a CLI environment where the headers |
@@ -68,11 +68,11 @@ discard block |
||
68 | 68 | $this->headers = $this->parseHeader($_SERVER['HTTP_ACCEPT']); |
69 | 69 | } |
70 | 70 | |
71 | - /** |
|
72 | - * Splits the accept header string and parses the mime types. |
|
73 | - * |
|
74 | - * @param string $acceptHeader |
|
75 | - */ |
|
71 | + /** |
|
72 | + * Splits the accept header string and parses the mime types. |
|
73 | + * |
|
74 | + * @param string $acceptHeader |
|
75 | + */ |
|
76 | 76 | protected function parseHeader(string $acceptHeader) : array |
77 | 77 | { |
78 | 78 | $tokens = preg_split('/\s*,\s*/', $acceptHeader); |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | return $accept; |
90 | 90 | } |
91 | 91 | |
92 | - /** |
|
93 | - * Parses a single mime type entry. |
|
94 | - * |
|
95 | - * @param int $i The position in the accept string |
|
96 | - * @param string $mime The mime type |
|
97 | - * @return array |
|
98 | - */ |
|
92 | + /** |
|
93 | + * Parses a single mime type entry. |
|
94 | + * |
|
95 | + * @param int $i The position in the accept string |
|
96 | + * @param string $mime The mime type |
|
97 | + * @return array |
|
98 | + */ |
|
99 | 99 | protected function parseEntry(int $i, string $mime) : array |
100 | 100 | { |
101 | 101 | $entry = array( |
@@ -125,14 +125,14 @@ discard block |
||
125 | 125 | return $entry; |
126 | 126 | } |
127 | 127 | |
128 | - /** |
|
129 | - * Sorts the mime types collection, first by quality |
|
130 | - * and then by position in the list. |
|
131 | - * |
|
132 | - * @param array $a |
|
133 | - * @param array $b |
|
134 | - * @return number |
|
135 | - */ |
|
128 | + /** |
|
129 | + * Sorts the mime types collection, first by quality |
|
130 | + * and then by position in the list. |
|
131 | + * |
|
132 | + * @param array $a |
|
133 | + * @param array $b |
|
134 | + * @return number |
|
135 | + */ |
|
136 | 136 | protected function sortMimeTypes(array $a, array $b) |
137 | 137 | { |
138 | 138 | /* first tier: highest q factor wins */ |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | { |
47 | 47 | $result = array(); |
48 | 48 | |
49 | - foreach($this->headers as $header) |
|
49 | + foreach ($this->headers as $header) |
|
50 | 50 | { |
51 | 51 | $result[] = $header['type']; |
52 | 52 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | { |
62 | 62 | // we may be in a CLI environment where the headers |
63 | 63 | // are not populated. |
64 | - if(!isset($_SERVER['HTTP_ACCEPT'])) { |
|
64 | + if (!isset($_SERVER['HTTP_ACCEPT'])) { |
|
65 | 65 | return; |
66 | 66 | } |
67 | 67 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | $accept = array(); |
81 | 81 | |
82 | - foreach($tokens as $i => $term) |
|
82 | + foreach ($tokens as $i => $term) |
|
83 | 83 | { |
84 | 84 | $accept[] = $this->parseEntry($i, $term); |
85 | 85 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | 'type' => null |
106 | 106 | ); |
107 | 107 | |
108 | - if(strstr($mime, ';')) |
|
108 | + if (strstr($mime, ';')) |
|
109 | 109 | { |
110 | 110 | $parts = explode(';', $mime); |
111 | 111 | $mime = array_shift($parts); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | // like an URL query string if separated by ampersands; |
115 | 115 | $entry['params'] = ConvertHelper::parseQueryString(implode('&', $parts)); |
116 | 116 | |
117 | - if(isset($entry['params']['q'])) |
|
117 | + if (isset($entry['params']['q'])) |
|
118 | 118 | { |
119 | 119 | $entry['quality'] = (double)$entry['params']['q']; |
120 | 120 | } |
@@ -141,14 +141,12 @@ |
||
141 | 141 | if ($diff > 0) |
142 | 142 | { |
143 | 143 | $diff = 1; |
144 | - } |
|
145 | - else |
|
144 | + } else |
|
146 | 145 | { |
147 | 146 | if ($diff < 0) |
148 | 147 | { |
149 | 148 | $diff = -1; |
150 | - } |
|
151 | - else |
|
149 | + } else |
|
152 | 150 | { |
153 | 151 | /* tie-breaker: first listed item wins */ |
154 | 152 | $diff = $a['pos'] - $b['pos']; |
@@ -22,9 +22,9 @@ |
||
22 | 22 | { |
23 | 23 | use Traits_Optionable; |
24 | 24 | |
25 | - /** |
|
26 | - * @var Request_Param |
|
27 | - */ |
|
25 | + /** |
|
26 | + * @var Request_Param |
|
27 | + */ |
|
28 | 28 | protected $param; |
29 | 29 | |
30 | 30 | protected $value; |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | protected function _filter() |
22 | 22 | { |
23 | - if($this->value === 'yes' || $this->value === 'true' || $this->value === true) { |
|
23 | + if ($this->value === 'yes' || $this->value === 'true' || $this->value === true) { |
|
24 | 24 | return true; |
25 | 25 | } |
26 | 26 |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | |
24 | 24 | protected function _filter() |
25 | 25 | { |
26 | - if(is_array($this->value)) { |
|
26 | + if (is_array($this->value)) { |
|
27 | 27 | return $this->value; |
28 | 28 | } |
29 | 29 | |
30 | - if($this->value === '' || $this->value === null || !is_string($this->value)) { |
|
30 | + if ($this->value === '' || $this->value === null || !is_string($this->value)) { |
|
31 | 31 | return array(); |
32 | 32 | } |
33 | 33 | |
@@ -35,19 +35,19 @@ discard block |
||
35 | 35 | $stripEmptyEntries = $this->getBoolOption('stripEmptyEntries'); |
36 | 36 | $result = explode(',', $this->value); |
37 | 37 | |
38 | - if(!$trimEntries && !$stripEmptyEntries) { |
|
38 | + if (!$trimEntries && !$stripEmptyEntries) { |
|
39 | 39 | return $result; |
40 | 40 | } |
41 | 41 | |
42 | 42 | $keep = array(); |
43 | 43 | |
44 | - foreach($result as $entry) |
|
44 | + foreach ($result as $entry) |
|
45 | 45 | { |
46 | - if($trimEntries === true) { |
|
46 | + if ($trimEntries === true) { |
|
47 | 47 | $entry = trim($entry); |
48 | 48 | } |
49 | 49 | |
50 | - if($stripEmptyEntries === true && $entry === '') { |
|
50 | + if ($stripEmptyEntries === true && $entry === '') { |
|
51 | 51 | continue; |
52 | 52 | } |
53 | 53 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | protected function _filter() |
22 | 22 | { |
23 | - if(!is_scalar($this->value)) { |
|
23 | + if (!is_scalar($this->value)) { |
|
24 | 24 | return ''; |
25 | 25 | } |
26 | 26 |
@@ -27,11 +27,11 @@ |
||
27 | 27 | |
28 | 28 | protected function _validate() |
29 | 29 | { |
30 | - if(!is_scalar($this->value)) { |
|
30 | + if (!is_scalar($this->value)) { |
|
31 | 31 | return null; |
32 | 32 | } |
33 | 33 | |
34 | - if(preg_match('/\A[a-zA-Z]+\z/', $this->value)) { |
|
34 | + if (preg_match('/\A[a-zA-Z]+\z/', $this->value)) { |
|
35 | 35 | return $this->value; |
36 | 36 | } |
37 | 37 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | array_unshift($args, $this->value); |
35 | 35 | |
36 | 36 | $result = call_user_func_array($this->getOption('callback'), $args); |
37 | - if($result !== false) { |
|
37 | + if ($result !== false) { |
|
38 | 38 | return $this->value; |
39 | 39 | } |
40 | 40 |