Completed
Branch 0.8-dev (5d9532)
by Kacper
02:49
created
Parser/Token/ContextualToken.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
                 $this->_end->_valid = false;
44 44
             }
45 45
         } else {
46
-            if (!$this->rule->validator->validate($context, [ $this->name => Validator::CONTEXT_IN ])) {
46
+            if (!$this->rule->validator->validate($context, [$this->name => Validator::CONTEXT_IN])) {
47 47
                 $this->setValid(false);
48 48
             } else {
49 49
                 $this->_valid       = false;
Please login to merge, or discard this patch.
Parser/Token/TerminatorToken.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 
46 46
     protected function processEnd(Context $context, Language $language, Result $result, TokenIterator $tokens)
47 47
     {
48
-        foreach(array_filter($context->stack, function ($name) {
48
+        foreach (array_filter($context->stack, function($name) {
49 49
             return in_array($name, $this->closes);
50 50
         }) as $hash => $name) {
51 51
             $end = new Token([$name, 'pos' => $this->pos]);
Please login to merge, or discard this patch.
Parser/Context.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 
31 31
     public function find($needle) {
32 32
         foreach (array_reverse($this->stack, true) as $id => $name) {
33
-            if($name === $needle) {
33
+            if ($name === $needle) {
34 34
                 return $id;
35 35
             }
36 36
         }
Please login to merge, or discard this patch.
Parser/Result.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
         $this->_source = $source;
29 29
         $this->_start  = $start;
30 30
 
31
-        parent::__construct($start !== null ? [ $start->id => $start ] : [], 0, \ArrayIterator::class);
31
+        parent::__construct($start !== null ? [$start->id => $start] : [], 0, \ArrayIterator::class);
32 32
     }
33 33
 
34 34
     public function getSource()
Please login to merge, or discard this patch.
Language/Html.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         $css = new Css();
34 34
         $js  = new JavaScript();
35 35
         $this->rules->addMany([
36
-            'language.'.$js->getIdentifier() => [
36
+            'language.' . $js->getIdentifier() => [
37 37
                 new OpenRule(new RegexMatcher('/<script.*?>()/'), [
38 38
                     'factory'     => new TokenFactory(LanguageToken::class),
39 39
                     'inject'      => $js,
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
                     'language' => $js
46 46
                 ])
47 47
             ],
48
-            'language.'.$css->getIdentifier() => [
48
+            'language.' . $css->getIdentifier() => [
49 49
                 new OpenRule(new RegexMatcher('/<style.*?>()/'), [
50 50
                     'factory'     => new TokenFactory(LanguageToken::class),
51 51
                     'inject'      => $css,
Please login to merge, or discard this patch.
Matcher/CommentMatcher.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     public function __construct(array $singleLine = null, array $multiLine = null)
32 32
     {
33 33
         $this->singleLine = $singleLine ?: [];
34
-        $this->multiLine  = $multiLine  ?: [];
34
+        $this->multiLine  = $multiLine ?: [];
35 35
     }
36 36
 
37 37
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         $all = [];
50 50
 
51 51
         foreach ($this->multiLine as $name => $comment) {
52
-            $comment = array_map(function ($e) { return preg_quote($e, '/'); }, $comment);
52
+            $comment = array_map(function($e) { return preg_quote($e, '/'); }, $comment);
53 53
 
54 54
             $all[] = [$name, "/{$comment[0]}(.*?){$comment[1]}/ms"];
55 55
         }
Please login to merge, or discard this patch.
Matcher/DelegateRegexMatcher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 
50 50
         $callable = $this->callable;
51 51
         foreach ($matches as $match) {
52
-            foreach($callable($match, $factory) as $token) {
52
+            foreach ($callable($match, $factory) as $token) {
53 53
                 yield $token;
54 54
             }
55 55
         }
Please login to merge, or discard this patch.
Parser/TokenFactory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      *
49 49
      * @return false|Token|null
50 50
      */
51
-    public function create($name, $params = [ ])
51
+    public function create($name, $params = [])
52 52
     {
53 53
         $name = $name !== null ? $this->getName($name) : $this->_base;
54 54
 
@@ -61,24 +61,24 @@  discard block
 block discarded – undo
61 61
         }
62 62
 
63 63
         $class = isset($params['class']) ? $params['class'] : $this->_class;
64
-        $end   = isset($params['end'])   ? $params['end']   : null;
64
+        $end   = isset($params['end']) ? $params['end'] : null;
65 65
         $start = isset($params['start']) ? $params['start'] : null;
66 66
 
67 67
         // we don't want to pass that into token
68 68
         unset($params['class'], $params['end'], $params['start']);
69 69
 
70
-        if($this->_type & Token::START) {
71
-            if($start === null) {
70
+        if ($this->_type & Token::START) {
71
+            if ($start === null) {
72 72
                 $start = new $class($name, $params);
73 73
             }
74 74
 
75
-            if($this->_type === Token::START) {
75
+            if ($this->_type === Token::START) {
76 76
                 $start->setEnd(false);
77 77
                 return $start;
78 78
             }
79 79
         }
80 80
 
81
-        if($this->_type & Token::END) {
81
+        if ($this->_type & Token::END) {
82 82
             if (isset($params['length'])) {
83 83
                 $length = $params['length'];
84 84
                 unset($params['length']);
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
 
89 89
                 /** @var Token $end */
90 90
                 $end = new $class($name, $end);
91
-            } elseif($end === null) {
91
+            } elseif ($end === null) {
92 92
                 $end = new $class($name, $params);
93 93
             }
94 94
 
95
-            if($this->_type === Token::END || $start === null) {
95
+            if ($this->_type === Token::END || $start === null) {
96 96
                 $end->setStart(false);
97 97
                 return $end;
98 98
             }
Please login to merge, or discard this patch.
Parser/Token/LanguageToken.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 {
33 33
     public function __construct($name, $options = []) {
34 34
         parent::__construct($name, $options);
35
-        if(isset($options['inject'])) {
35
+        if (isset($options['inject'])) {
36 36
             $this->inject = $options['inject'];
37 37
         }
38 38
     }
Please login to merge, or discard this patch.