Passed
Push — master ( b31131...79f37b )
by Kacper
04:02
created
Language/JavaScriptLanguage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
             ]),
54 54
         ];
55 55
 
56
-        if($this->variables) {
56
+        if ($this->variables) {
57 57
             $rules = array_merge($rules, [
58 58
                 'variable' => new Rule(new RegexMatcher('/(' . self::IDENTIFIER . ')/iu'), ['priority' => -10000]),
59 59
                 'variable.property' => new Rule(new RegexMatcher('/(?=(?:\w|\)|\])\s*\.([a-z_]\w*))/i'), [
Please login to merge, or discard this patch.
Language/Language.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
      * @param array $options
49 49
      */
50 50
     public function __construct(array $options = []) {
51
-        $this->_options  = array_merge([
51
+        $this->_options = array_merge([
52 52
             'embedded' => [],
53 53
         ], $this->_options, $options);
54 54
 
55
-        $this->_rules    = $this->getRules();
55
+        $this->_rules = $this->getRules();
56 56
     }
57 57
 
58 58
     /**
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     {
77 77
         if (is_string($tokens)) {
78 78
             $tokens = $this->tokenize($tokens, $additional, $embedded);
79
-        } elseif(!$tokens instanceof TokenIterator) {
79
+        } elseif (!$tokens instanceof TokenIterator) {
80 80
             // Todo: Own Exceptions
81 81
             throw new \InvalidArgumentException('$tokens must be string or TokenIterator');
82 82
         }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         /** @var Token[] $all */    $all    = [];
91 91
 
92 92
         /** @var Token $token */
93
-        for($tokens->next(); $tokens->valid(); $tokens->next()) {
93
+        for ($tokens->next(); $tokens->valid(); $tokens->next()) {
94 94
             $token = $tokens->current();
95 95
 
96 96
             if (!$token->isValid($this, $context)) {
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
                 if ($token instanceof LanguageToken && $token->getLanguage() === $this) {
116 116
                     $result[0]->setEnd($token);
117 117
 
118
-                    if($result[0]->getRule()->postProcess) {
118
+                    if ($result[0]->getRule()->postProcess) {
119 119
                         $source = substr($tokens->getSource(), $result[0]->pos, $result[0]->getLength());
120 120
 
121 121
                         $tokens = $this->tokenize($source, $result, $result[0]->pos, true);
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                     }
124 124
 
125 125
                     # closing unclosed tokens
126
-                    foreach(array_reverse($context) as $hash => $name) {
126
+                    foreach (array_reverse($context) as $hash => $name) {
127 127
                         $end = new Token([$name, 'pos' => $token->pos]);
128 128
                         $all[$hash]->setEnd($end);
129 129
                         $result[] = $end;
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
                         unset($context[spl_object_hash($start)]);
137 137
                     } else {
138 138
                         /** @noinspection PhpUnusedParameterInspection */
139
-                        $start = ArrayHelper::find(array_reverse($context), function ($k, $v) use ($token) {
139
+                        $start = ArrayHelper::find(array_reverse($context), function($k, $v) use ($token) {
140 140
                             return $v === $token->name;
141 141
                         });
142 142
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     private function _tokens($source, $offset = 0, $additional = [], $embedded = false)
170 170
     {
171 171
         $all = $this->_rules;
172
-        if(!$embedded) {
172
+        if (!$embedded) {
173 173
             $all['language.' . $this->getIdentifier()] = $this->getOpenClose();
174 174
         }
175 175
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
             /** @var Rule $rule */
183 183
             foreach ($rules as $rule) {
184
-                if($rule->language === false) {
184
+                if ($rule->language === false) {
185 185
                     $rule->language = $this;
186 186
                 }
187 187
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
             }
193 193
         }
194 194
 
195
-        foreach($this->getEmbedded() as $language) {
195
+        foreach ($this->getEmbedded() as $language) {
196 196
             $result = array_merge($result, $language->_tokens($source, $offset));
197 197
         }
198 198
 
Please login to merge, or discard this patch.