Passed
Push — develop ( 067c9c...bf1d25 )
by nguereza
04:45
created
src/Parser/Drop.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -54,13 +54,13 @@
 block discarded – undo
54 54
  * @package Platine\Template\Parser
55 55
  *
56 56
  */
57
- /**
58
- * A drop is a class which allows you to to export DOM like things to template.
59
- * Methods of drops are callable.
60
- * The main use for drops is the implement lazy loaded objects.
61
- * If you would like to make data available to the web designers which you don't
62
- * want loaded unless needed then a drop is a great way to do that.
63
- */
57
+    /**
58
+     * A drop is a class which allows you to to export DOM like things to template.
59
+     * Methods of drops are callable.
60
+     * The main use for drops is the implement lazy loaded objects.
61
+     * If you would like to make data available to the web designers which you don't
62
+     * want loaded unless needed then a drop is a great way to do that.
63
+     */
64 64
 abstract class Drop
65 65
 {
66 66
     /**
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -61,8 +61,7 @@  discard block
 block discarded – undo
61 61
  * If you would like to make data available to the web designers which you don't
62 62
  * want loaded unless needed then a drop is a great way to do that.
63 63
  */
64
-abstract class Drop
65
-{
64
+abstract class Drop {
66 65
     /**
67 66
      * The context instance to use
68 67
      * @var Context
@@ -96,8 +95,7 @@  discard block
 block discarded – undo
96 95
      * @param string $method
97 96
      * @return mixed
98 97
      */
99
-    public function invokeDrop(string $method)
100
-    {
98
+    public function invokeDrop(string $method) {
101 99
         $result = $this->beforeMethod($method);
102 100
         if ($result === null && is_callable([$this, $method])) {
103 101
             $result = $this->{$method}();
@@ -129,8 +127,7 @@  discard block
 block discarded – undo
129 127
      * @param string $method
130 128
      * @return mixed
131 129
      */
132
-    protected function beforeMethod(string $method)
133
-    {
130
+    protected function beforeMethod(string $method) {
134 131
         return null;
135 132
     }
136 133
 }
Please login to merge, or discard this patch.
src/Parser/Parser.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -118,11 +118,11 @@
 block discarded – undo
118 118
     }
119 119
 
120 120
     /**
121
-    * Parse the template source and use the cached
122
-    * content if is available
123
-    * @param string $name
124
-    * @return $this
125
-    */
121
+     * Parse the template source and use the cached
122
+     * content if is available
123
+     * @param string $name
124
+     * @return $this
125
+     */
126 126
     public function parse(string $name): self
127 127
     {
128 128
         $hash = md5($name);
Please login to merge, or discard this 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
     /**
64 63
      * The template instance
@@ -76,8 +75,7 @@  discard block
 block discarded – undo
76 75
      * Create new instance
77 76
      * @param Template $template
78 77
      */
79
-    public function __construct(Template $template)
80
-    {
78
+    public function __construct(Template $template) {
81 79
         $this->template = $template;
82 80
     }
83 81
 
Please login to merge, or discard this patch.
src/Parser/AbstractFilter.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,6 @@
 block discarded – undo
53 53
  * Class AbstractFilter
54 54
  * @package Platine\Template\Parser
55 55
  */
56
-abstract class AbstractFilter
57
-{
56
+abstract class AbstractFilter {
58 57
 
59 58
 }
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
     /**
63 62
      * The current left variable to compare
@@ -76,8 +75,7 @@  discard block
 block discarded – undo
76 75
      * @param mixed|null $value
77 76
      * @return string|mixed|null
78 77
      */
79
-    protected function stringValue($value)
80
-    {
78
+    protected function stringValue($value) {
81 79
         if (is_object($value)) {
82 80
             if (method_exists($value, '__toString')) {
83 81
                 return (string) $value;
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
     /**
69 68
      * The list of filter with their name and class
@@ -74,8 +73,7 @@  discard block
 block discarded – undo
74 73
     /**
75 74
      * Create new instance
76 75
      */
77
-    public function __construct()
78
-    {
76
+    public function __construct() {
79 77
         $this->addFilter(ArrayFilter::class);
80 78
         $this->addFilter(DatetimeFilter::class);
81 79
         $this->addFilter(HtmlFilter::class);
@@ -115,8 +113,7 @@  discard block
 block discarded – undo
115 113
      * @param array<int, mixed> $args
116 114
      * @return mixed
117 115
      */
118
-    public function invoke(string $name, $value, array $args = [])
119
-    {
116
+    public function invoke(string $name, $value, array $args = []) {
120 117
         // workaround for a single standard filter being a reserved
121 118
         // keyword - we can't use overloading for static calls
122 119
         if ($name === 'default') {
Please login to merge, or discard this patch.
src/Parser/Token.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
      * Quoted fragment pattern
114 114
      */
115 115
     public const QUOTED_FRAGMENT = '(?:' . self::QUOTED_STRING
116
-                                   . '|(?:[^\s,\|\'"]|'
117
-                                   . self::QUOTED_STRING . ')+)';
116
+                                    . '|(?:[^\s,\|\'"]|'
117
+                                    . self::QUOTED_STRING . ')+)';
118 118
 
119 119
     /**
120 120
      * Tag attributes pattern expression
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
      * Template parse pattern
126 126
      */
127 127
     public const TOKENIZATION_REGEXP = '/(' . self::BLOCK_OPEN
128
-                                       . '.*?' . self::BLOCK_CLOSE
129
-                                       . '|' . self::VARIABLE_OPEN
130
-                                       . '.*?' . self::VARIABLE_CLOSE
131
-                                       . ')/';
128
+                                        . '.*?' . self::BLOCK_CLOSE
129
+                                        . '|' . self::VARIABLE_OPEN
130
+                                        . '.*?' . self::VARIABLE_CLOSE
131
+                                        . ')/';
132 132
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@
 block discarded – undo
53 53
  * Class Token
54 54
  * @package Platine\Template\Parser
55 55
  */
56
-class Token
57
-{
56
+class Token {
58 57
     /**
59 58
      * The template opened variable
60 59
      */
Please login to merge, or discard this patch.
src/Parser/AbstractTag.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -147,10 +147,10 @@
 block discarded – undo
147 147
     }
148 148
 
149 149
     /**
150
-    * Returns the class name of the tag.
151
-    *
152
-    * @return string
153
-    */
150
+     * Returns the class name of the tag.
151
+     *
152
+     * @return string
153
+     */
154 154
     protected function getName(): string
155 155
     {
156 156
         return strtolower(get_class($this));
Please login to merge, or discard this 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
     /**
62 61
      * The name of this class tag
@@ -88,8 +87,7 @@  discard block
 block discarded – undo
88 87
      * @param array<int, string> $tokens
89 88
      * @param Parser $parser
90 89
      */
91
-    public function __construct(string $markup, array &$tokens, Parser $parser)
92
-    {
90
+    public function __construct(string $markup, array &$tokens, Parser $parser) {
93 91
         $this->markup = $markup;
94 92
         $this->parser = $parser;
95 93
 
Please login to merge, or discard this patch.
src/Parser/Variable.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -95,13 +95,13 @@
 block discarded – undo
95 95
                                 . Token::FILTER_SEPARATOR
96 96
                                 . '\s*(.*)/m';
97 97
         $syntaxRegex = '/('
98
-                       . Token::QUOTED_FRAGMENT
99
-                       . ')(.*)/m';
98
+                        . Token::QUOTED_FRAGMENT
99
+                        . ')(.*)/m';
100 100
         $filterRegex = '/(?:\s+|'
101
-                       . Token::QUOTED_FRAGMENT
102
-                       . '|'
103
-                       . Token::FILTER_METHOD_ARGS_SEPARATOR
104
-                       . ')+/';
101
+                        . Token::QUOTED_FRAGMENT
102
+                        . '|'
103
+                        . Token::FILTER_METHOD_ARGS_SEPARATOR
104
+                        . ')+/';
105 105
         $filterArgumentsRegex = '/(?:'
106 106
                                 . Token::FILTER_NAME_ARG_SEPARATOR
107 107
                                 . '|'
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@  discard block
 block discarded – undo
55 55
  * Class Variable
56 56
  * @package Platine\Template\Parser
57 57
  */
58
-class Variable
59
-{
58
+class Variable {
60 59
     /**
61 60
      * The variable markup
62 61
      * @var string
@@ -86,8 +85,7 @@  discard block
 block discarded – undo
86 85
      * @param string $markup
87 86
      * @param Parser $parser
88 87
      */
89
-    public function __construct(string $markup, Parser $parser)
90
-    {
88
+    public function __construct(string $markup, Parser $parser) {
91 89
         $this->markup = $markup;
92 90
         $this->parser = $parser;
93 91
 
@@ -185,8 +183,7 @@  discard block
 block discarded – undo
185 183
      * @param Context $context
186 184
      * @return mixed
187 185
      */
188
-    public function render(Context $context)
189
-    {
186
+    public function render(Context $context) {
190 187
         $output = $context->get($this->name);
191 188
         foreach ($this->filters as $filter) {
192 189
             list($filterName, $filterArgKeys) = $filter;
Please login to merge, or discard this patch.
src/Parser/AbstractBlock.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
     /**
85 85
      * {@inheritdoc}
86
-    */
86
+     */
87 87
     public function parse(array &$tokens): void
88 88
     {
89 89
         $startRegex = '/^' . Token::BLOCK_OPEN . '/';
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 
180 180
     /**
181 181
      * {@inheritdoc}
182
-    */
182
+     */
183 183
     public function render(Context $context): string
184 184
     {
185 185
         return $this->renderAll($this->nodeList, $context);
Please login to merge, or discard this 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
     /**
64 63
      * The node list
Please login to merge, or discard this patch.