Passed
Push — develop ( 4fa55a...08bba0 )
by nguereza
04:41 queued 02:54
created
src/Cache/AbstractCache.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@  discard block
 block discarded – undo
55 55
  * Class AbstractCache
56 56
  * @package Platine\Template\Cache
57 57
  */
58
-abstract class AbstractCache
59
-{
58
+abstract class AbstractCache {
60 59
     /**
61 60
      * The cache expiration in second
62 61
      * @var int
@@ -79,8 +78,7 @@  discard block
 block discarded – undo
79 78
      * Create new instance
80 79
      * @param Configuration|null $config
81 80
      */
82
-    public function __construct(?Configuration $config = null)
83
-    {
81
+    public function __construct(?Configuration $config = null) {
84 82
         $this->config = $config ?? new Configuration([]);
85 83
 
86 84
         $this->expire = $this->config->get('cache_expire');
Please login to merge, or discard this patch.
src/Configuration.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@
 block discarded – undo
55 55
  * Class Configuration
56 56
  * @package Platine\Template
57 57
  */
58
-class Configuration extends AbstractConfiguration
59
-{
58
+class Configuration extends AbstractConfiguration {
60 59
     /**
61 60
      * {@inheritdoc}
62 61
      */
Please login to merge, or discard this patch.
src/Parser/AbstractBlock.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@
 block discarded – undo
57 57
  * Class AbstractBlock
58 58
  * @package Platine\Template\Parser
59 59
  */
60
-class AbstractBlock extends AbstractTag
61
-{
60
+class AbstractBlock extends AbstractTag {
62 61
     /**
63 62
      * The node list
64 63
      * @var AbstractTag[]|Variable[]|string[]
Please login to merge, or discard this patch.
src/Parser/AbstractTag.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@  discard block
 block discarded – undo
55 55
  * Class AbstractTag
56 56
  * @package Platine\Template\Parser
57 57
  */
58
-abstract class AbstractTag
59
-{
58
+abstract class AbstractTag {
60 59
     /**
61 60
      * The name of this class tag
62 61
      * @var string
@@ -87,8 +86,7 @@  discard block
 block discarded – undo
87 86
      * @param array<int, string> $tokens
88 87
      * @param Parser $parser
89 88
      */
90
-    public function __construct(string $markup, array &$tokens, Parser $parser)
91
-    {
89
+    public function __construct(string $markup, array &$tokens, Parser $parser) {
92 90
         $this->markup = $markup;
93 91
         $this->parser = $parser;
94 92
 
Please login to merge, or discard this patch.
src/Parser/FilterCollection.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -62,8 +62,7 @@  discard block
 block discarded – undo
62 62
  * Class FilterCollection
63 63
  * @package Platine\Template\Parser
64 64
  */
65
-class FilterCollection
66
-{
65
+class FilterCollection {
67 66
     /**
68 67
      * The list of filter with their name and class
69 68
      * @var array<string, class-string>
@@ -73,8 +72,7 @@  discard block
 block discarded – undo
73 72
     /**
74 73
      * Create new instance
75 74
      */
76
-    public function __construct()
77
-    {
75
+    public function __construct() {
78 76
         $this->addFilter(ArrayFilter::class);
79 77
         $this->addFilter(DatetimeFilter::class);
80 78
         $this->addFilter(HtmlFilter::class);
@@ -114,8 +112,7 @@  discard block
 block discarded – undo
114 112
      * @param array<int, mixed> $args
115 113
      * @return mixed
116 114
      */
117
-    public function invoke(string $name, $value, array $args = [])
118
-    {
115
+    public function invoke(string $name, $value, array $args = []) {
119 116
         // workaround for a single standard filter being a reserved
120 117
         // keyword - we can't use overloading for static calls
121 118
         if ($name === 'default') {
Please login to merge, or discard this patch.
src/Parser/AbstractCondition.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@  discard block
 block discarded – undo
56 56
  * Class AbstractCondition
57 57
  * @package Platine\Template\Parser
58 58
  */
59
-abstract class AbstractCondition extends AbstractBlock
60
-{
59
+abstract class AbstractCondition extends AbstractBlock {
61 60
     /**
62 61
      * The current left variable to compare
63 62
      * @var mixed
@@ -75,8 +74,7 @@  discard block
 block discarded – undo
75 74
      * @param mixed|null $value
76 75
      * @return string|mixed|null
77 76
      */
78
-    protected function stringValue($value)
79
-    {
77
+    protected function stringValue($value) {
80 78
         if (is_object($value)) {
81 79
             if (method_exists($value, '__toString')) {
82 80
                 return (string) $value;
Please login to merge, or discard this patch.
src/Parser/Parser.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@  discard block
 block discarded – undo
57 57
  * Class Parser
58 58
  * @package Platine\Template\Parser
59 59
  */
60
-class Parser
61
-{
60
+class Parser {
62 61
     /**
63 62
      * The template instance
64 63
      * @var Template
@@ -75,8 +74,7 @@  discard block
 block discarded – undo
75 74
      * Create new instance
76 75
      * @param Template $template
77 76
      */
78
-    public function __construct(Template $template)
79
-    {
77
+    public function __construct(Template $template) {
80 78
         $this->template = $template;
81 79
     }
82 80
 
Please login to merge, or discard this patch.
src/Filter/DatetimeFilter.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,16 +56,14 @@
 block discarded – undo
56 56
  * Class DatetimeFilter
57 57
  * @package Platine\Template\Filter
58 58
  */
59
-class DatetimeFilter extends AbstractFilter
60
-{
59
+class DatetimeFilter extends AbstractFilter {
61 60
     /**
62 61
      * Formats a date
63 62
      * @param string|DateTimeInterface $variable
64 63
      * @param mixed $format
65 64
      * @return string|mixed
66 65
      */
67
-    public static function date($variable, $format)
68
-    {
66
+    public static function date($variable, $format) {
69 67
         if (!is_string($variable) && !$variable instanceof DateTimeInterface) {
70 68
             return $variable;
71 69
         }
Please login to merge, or discard this patch.
src/Filter/StringFilter.php 1 patch
Braces   +26 added lines, -52 removed lines patch added patch discarded remove patch
@@ -56,15 +56,13 @@  discard block
 block discarded – undo
56 56
  * Class StringFilter
57 57
  * @package Platine\Template\Filter
58 58
  */
59
-class StringFilter extends AbstractFilter
60
-{
59
+class StringFilter extends AbstractFilter {
61 60
     /**
62 61
      * Return the length of string or array
63 62
      * @param mixed $variable
64 63
      * @return int|mixed
65 64
      */
66
-    public static function length($variable)
67
-    {
65
+    public static function length($variable) {
68 66
         if ($variable instanceof Traversable) {
69 67
             return iterator_count($variable);
70 68
         }
@@ -96,8 +94,7 @@  discard block
 block discarded – undo
96 94
      * @param mixed $value
97 95
      * @return string|mixed
98 96
      */
99
-    public static function append($variable, $value)
100
-    {
97
+    public static function append($variable, $value) {
101 98
         if (!is_string($variable) || !is_string($value)) {
102 99
             return $variable;
103 100
         }
@@ -111,8 +108,7 @@  discard block
 block discarded – undo
111 108
      * @param mixed $value
112 109
      * @return string|mixed
113 110
      */
114
-    public static function prepend($variable, $value)
115
-    {
111
+    public static function prepend($variable, $value) {
116 112
         if (!is_string($variable) || !is_string($value)) {
117 113
             return $variable;
118 114
         }
@@ -126,8 +122,7 @@  discard block
 block discarded – undo
126 122
      * @param mixed $value
127 123
      * @return string|mixed
128 124
      */
129
-    public static function remove($variable, $value)
130
-    {
125
+    public static function remove($variable, $value) {
131 126
         if (!is_string($variable) || !is_string($value)) {
132 127
             return $variable;
133 128
         }
@@ -142,8 +137,7 @@  discard block
 block discarded – undo
142 137
      * @param mixed $replacement
143 138
      * @return string|mixed
144 139
      */
145
-    public static function replace($variable, $value, $replacement = '')
146
-    {
140
+    public static function replace($variable, $value, $replacement = '') {
147 141
         if (!is_string($variable) || !is_string($value) || !is_string($replacement)) {
148 142
             return $variable;
149 143
         }
@@ -158,8 +152,7 @@  discard block
 block discarded – undo
158 152
      * @param string|mixed $ending
159 153
      * @return string|mixed
160 154
      */
161
-    public static function truncate($variable, $count = 100, $ending = '...')
162
-    {
155
+    public static function truncate($variable, $count = 100, $ending = '...') {
163 156
         if (!is_string($variable) || !is_string($ending) || !is_numeric($count)) {
164 157
             return $variable;
165 158
         }
@@ -179,8 +172,7 @@  discard block
 block discarded – undo
179 172
      * @param string|mixed $ending
180 173
      * @return string|mixed
181 174
      */
182
-    public static function truncateWord($variable, $count = 3, $ending = '...')
183
-    {
175
+    public static function truncateWord($variable, $count = 3, $ending = '...') {
184 176
         if (!is_string($variable) || !is_string($ending) || !is_numeric($count)) {
185 177
             return $variable;
186 178
         }
@@ -199,8 +191,7 @@  discard block
 block discarded – undo
199 191
      * @param mixed $variable
200 192
      * @return string|mixed
201 193
      */
202
-    public static function upper($variable)
203
-    {
194
+    public static function upper($variable) {
204 195
         if (!is_string($variable)) {
205 196
             return $variable;
206 197
         }
@@ -217,8 +208,7 @@  discard block
 block discarded – undo
217 208
      * @param mixed $variable
218 209
      * @return string|mixed
219 210
      */
220
-    public static function urlEncode($variable)
221
-    {
211
+    public static function urlEncode($variable) {
222 212
         if (!is_string($variable)) {
223 213
             return $variable;
224 214
         }
@@ -231,8 +221,7 @@  discard block
 block discarded – undo
231 221
      * @param mixed $variable
232 222
      * @return string|mixed
233 223
      */
234
-    public static function urlDecode($variable)
235
-    {
224
+    public static function urlDecode($variable) {
236 225
         if (!is_string($variable)) {
237 226
             return $variable;
238 227
         }
@@ -245,8 +234,7 @@  discard block
 block discarded – undo
245 234
      * @param mixed $variable
246 235
      * @return string|mixed
247 236
      */
248
-    public static function stringfy($variable)
249
-    {
237
+    public static function stringfy($variable) {
250 238
         if (is_array($variable)) {
251 239
             return $variable;
252 240
         }
@@ -261,8 +249,7 @@  discard block
 block discarded – undo
261 249
      * @param mixed $pattern
262 250
      * @return array<mixed>|mixed
263 251
      */
264
-    public static function split($variable, $pattern)
265
-    {
252
+    public static function split($variable, $pattern) {
266 253
         if (!is_string($variable) || !is_string($pattern)) {
267 254
             return $variable;
268 255
         }
@@ -276,8 +263,7 @@  discard block
 block discarded – undo
276 263
      * @param mixed $value
277 264
      * @return int|false|mixed
278 265
      */
279
-    public static function find($variable, $value)
280
-    {
266
+    public static function find($variable, $value) {
281 267
         if (!is_string($variable) || !is_string($value)) {
282 268
             return $variable;
283 269
         }
@@ -290,8 +276,7 @@  discard block
 block discarded – undo
290 276
      * @param mixed $variable
291 277
      * @return string|mixed
292 278
      */
293
-    public static function raw($variable)
294
-    {
279
+    public static function raw($variable) {
295 280
         return $variable;
296 281
     }
297 282
 
@@ -300,8 +285,7 @@  discard block
 block discarded – undo
300 285
      * @param mixed $variable
301 286
      * @return string|mixed
302 287
      */
303
-    public static function escape($variable)
304
-    {
288
+    public static function escape($variable) {
305 289
         if (!is_string($variable)) {
306 290
             return $variable;
307 291
         }
@@ -314,8 +298,7 @@  discard block
 block discarded – undo
314 298
      * @param mixed $variable
315 299
      * @return string|mixed
316 300
      */
317
-    public static function escapeOnce($variable)
318
-    {
301
+    public static function escapeOnce($variable) {
319 302
         if (!is_string($variable)) {
320 303
             return $variable;
321 304
         }
@@ -329,8 +312,7 @@  discard block
 block discarded – undo
329 312
      * @param mixed $value
330 313
      * @return mixed
331 314
      */
332
-    public static function defaultValue($variable, $value)
333
-    {
315
+    public static function defaultValue($variable, $value) {
334 316
         $isBlank = (is_string($variable) && $variable === '')
335 317
                     || is_bool($variable) && $variable === false
336 318
                     || $variable === null;
@@ -346,8 +328,7 @@  discard block
 block discarded – undo
346 328
      * @param mixed $glue
347 329
      * @return string|mixed
348 330
      */
349
-    public static function join($variable, $glue = ' ')
350
-    {
331
+    public static function join($variable, $glue = ' ') {
351 332
         if (!is_string($glue)) {
352 333
             return $variable;
353 334
         }
@@ -375,8 +356,7 @@  discard block
 block discarded – undo
375 356
      * @param mixed $variable
376 357
      * @return string|mixed
377 358
      */
378
-    public static function lower($variable)
379
-    {
359
+    public static function lower($variable) {
380 360
         if (!is_string($variable)) {
381 361
             return $variable;
382 362
         }
@@ -393,8 +373,7 @@  discard block
 block discarded – undo
393 373
      * @param mixed $variable
394 374
      * @return string|mixed
395 375
      */
396
-    public static function capitalize($variable)
397
-    {
376
+    public static function capitalize($variable) {
398 377
         if (!is_string($variable)) {
399 378
             return $variable;
400 379
         }
@@ -413,8 +392,7 @@  discard block
 block discarded – undo
413 392
      * @param mixed $variable
414 393
      * @return string|mixed
415 394
      */
416
-    public static function lstrip($variable)
417
-    {
395
+    public static function lstrip($variable) {
418 396
         if (!is_string($variable)) {
419 397
             return $variable;
420 398
         }
@@ -427,8 +405,7 @@  discard block
 block discarded – undo
427 405
      * @param mixed $variable
428 406
      * @return string|mixed
429 407
      */
430
-    public static function rstrip($variable)
431
-    {
408
+    public static function rstrip($variable) {
432 409
         if (!is_string($variable)) {
433 410
             return $variable;
434 411
         }
@@ -441,8 +418,7 @@  discard block
 block discarded – undo
441 418
      * @param mixed $variable
442 419
      * @return string|mixed
443 420
      */
444
-    public static function strip($variable)
445
-    {
421
+    public static function strip($variable) {
446 422
         if (!is_string($variable)) {
447 423
             return $variable;
448 424
         }
@@ -455,8 +431,7 @@  discard block
 block discarded – undo
455 431
      * @param mixed $variable
456 432
      * @return string|mixed
457 433
      */
458
-    public static function stripHtml($variable)
459
-    {
434
+    public static function stripHtml($variable) {
460 435
         if (!is_string($variable)) {
461 436
             return $variable;
462 437
         }
@@ -469,8 +444,7 @@  discard block
 block discarded – undo
469 444
      * @param mixed $variable
470 445
      * @return string|mixed
471 446
      */
472
-    public static function stripNewLine($variable)
473
-    {
447
+    public static function stripNewLine($variable) {
474 448
         if (!is_string($variable)) {
475 449
             return $variable;
476 450
         }
Please login to merge, or discard this patch.