@@ -55,8 +55,7 @@ discard block |
||
| 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 |
||
| 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'); |
@@ -55,8 +55,7 @@ |
||
| 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 | */ |
@@ -57,8 +57,7 @@ |
||
| 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[] |
@@ -55,8 +55,7 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -62,8 +62,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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') { |
@@ -56,8 +56,7 @@ discard block |
||
| 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 |
||
| 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; |
@@ -57,8 +57,7 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -55,16 +55,14 @@ discard block |
||
| 55 | 55 | * Class NumberFilter |
| 56 | 56 | * @package Platine\Template\Filter |
| 57 | 57 | */ |
| 58 | -class NumberFilter extends AbstractFilter |
|
| 59 | -{ |
|
| 58 | +class NumberFilter extends AbstractFilter { |
|
| 60 | 59 | /** |
| 61 | 60 | * Addition |
| 62 | 61 | * @param mixed $variable |
| 63 | 62 | * @param mixed $operand |
| 64 | 63 | * @return float|int|mixed |
| 65 | 64 | */ |
| 66 | - public static function plus($variable, $operand) |
|
| 67 | - { |
|
| 65 | + public static function plus($variable, $operand) { |
|
| 68 | 66 | if (!is_numeric($variable) || !is_numeric($operand)) { |
| 69 | 67 | return $variable; |
| 70 | 68 | } |
@@ -82,8 +80,7 @@ discard block |
||
| 82 | 80 | * @param mixed $operand |
| 83 | 81 | * @return int|float|mixed |
| 84 | 82 | */ |
| 85 | - public static function minus($variable, $operand) |
|
| 86 | - { |
|
| 83 | + public static function minus($variable, $operand) { |
|
| 87 | 84 | if (!is_numeric($variable) || !is_numeric($operand)) { |
| 88 | 85 | return $variable; |
| 89 | 86 | } |
@@ -101,8 +98,7 @@ discard block |
||
| 101 | 98 | * @param mixed $operand |
| 102 | 99 | * @return int|float|mixed |
| 103 | 100 | */ |
| 104 | - public static function times($variable, $operand) |
|
| 105 | - { |
|
| 101 | + public static function times($variable, $operand) { |
|
| 106 | 102 | if (!is_numeric($variable) || !is_numeric($operand)) { |
| 107 | 103 | return $variable; |
| 108 | 104 | } |
@@ -120,8 +116,7 @@ discard block |
||
| 120 | 116 | * @param mixed $operand |
| 121 | 117 | * @return int|float|mixed |
| 122 | 118 | */ |
| 123 | - public static function modulo($variable, $operand) |
|
| 124 | - { |
|
| 119 | + public static function modulo($variable, $operand) { |
|
| 125 | 120 | if (!is_numeric($variable) || !is_numeric($operand)) { |
| 126 | 121 | return $variable; |
| 127 | 122 | } |
@@ -139,8 +134,7 @@ discard block |
||
| 139 | 134 | * @param mixed $operand |
| 140 | 135 | * @return int|float|mixed |
| 141 | 136 | */ |
| 142 | - public static function div($variable, $operand) |
|
| 143 | - { |
|
| 137 | + public static function div($variable, $operand) { |
|
| 144 | 138 | if (!is_numeric($variable) || !is_numeric($operand) || $operand == 0) { |
| 145 | 139 | return $variable; |
| 146 | 140 | } |
@@ -158,8 +152,7 @@ discard block |
||
| 158 | 152 | * @param mixed $number |
| 159 | 153 | * @return float|mixed |
| 160 | 154 | */ |
| 161 | - public static function round($variable, $number = 0) |
|
| 162 | - { |
|
| 155 | + public static function round($variable, $number = 0) { |
|
| 163 | 156 | if (!is_numeric($variable) || !is_numeric($number)) { |
| 164 | 157 | return $variable; |
| 165 | 158 | } |
@@ -56,16 +56,14 @@ |
||
| 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 | } |