@@ -44,17 +44,17 @@ |
||
44 | 44 | ]), |
45 | 45 | |
46 | 46 | 'variable' => [ |
47 | - new Rule(new RegexMatcher('/(?<!`)(\$' . $namespace . '[a-z_]\w*)/i', $namespaceGroup), [ |
|
47 | + new Rule(new RegexMatcher('/(?<!`)(\$'.$namespace.'[a-z_]\w*)/i', $namespaceGroup), [ |
|
48 | 48 | 'context' => $variableRules, |
49 | 49 | 'priority' => 0, |
50 | 50 | ]), |
51 | - new Rule(new RegexMatcher('/[^`](\$\{' . $namespace . '.*?\})/i', $namespaceGroup), [ |
|
51 | + new Rule(new RegexMatcher('/[^`](\$\{'.$namespace.'.*?\})/i', $namespaceGroup), [ |
|
52 | 52 | 'context' => $variableRules, |
53 | 53 | 'priority' => 0, |
54 | 54 | ]), |
55 | 55 | ], |
56 | 56 | |
57 | - 'variable.splat' => new Rule(new RegexMatcher('/[^`](\@' . $namespace . '[a-z_]\w*)/i', $namespaceGroup), [ |
|
57 | + 'variable.splat' => new Rule(new RegexMatcher('/[^`](\@'.$namespace.'[a-z_]\w*)/i', $namespaceGroup), [ |
|
58 | 58 | 'context' => $variableRules, |
59 | 59 | 'priority' => 0, |
60 | 60 | ]), |
@@ -43,8 +43,8 @@ |
||
43 | 43 | ])), |
44 | 44 | ], |
45 | 45 | 'diff' => [ |
46 | - 'add' => new Rule(new RegexMatcher('/(?:^\+.*?(?>\R|$))+/mi', [ 0 => Token::NAME ])), |
|
47 | - 'remove' => new Rule(new RegexMatcher('/(?:^-.*?(?>\R|$))+/mi', [ 0 => Token::NAME ])), |
|
46 | + 'add' => new Rule(new RegexMatcher('/(?:^\+.*?(?>\R|$))+/mi', [0 => Token::NAME])), |
|
47 | + 'remove' => new Rule(new RegexMatcher('/(?:^-.*?(?>\R|$))+/mi', [0 => Token::NAME])), |
|
48 | 48 | ], |
49 | 49 | ]); |
50 | 50 | } |
@@ -152,7 +152,7 @@ |
||
152 | 152 | { |
153 | 153 | $rules = clone $this->rules; |
154 | 154 | if (is_bool($embedded)) { |
155 | - $rules->addMany(['language.' . $this->getIdentifier() => $this->getEnds($embedded)]); |
|
155 | + $rules->addMany(['language.'.$this->getIdentifier() => $this->getEnds($embedded)]); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | foreach ($rules->all() as $rule) { |
@@ -63,7 +63,7 @@ |
||
63 | 63 | } |
64 | 64 | |
65 | 65 | $injected = self::byMime($mime); |
66 | - $language = $this->_embeddedFactory->create('language.' . $injected->getIdentifier(), [ |
|
66 | + $language = $this->_embeddedFactory->create('language.'.$injected->getIdentifier(), [ |
|
67 | 67 | 'pos' => strlen($source) - strlen($payload) + $offset, |
68 | 68 | 'length' => strlen($payload), |
69 | 69 | 'inject' => $injected, |
@@ -74,7 +74,7 @@ |
||
74 | 74 | new Rule( |
75 | 75 | new DelegateRegexMatcher( |
76 | 76 | '/^```(.*?)\R(.*?)\R^```/ms', |
77 | - function ($match, TokenFactoryInterface $factory) { |
|
77 | + function($match, TokenFactoryInterface $factory) { |
|
78 | 78 | $lang = KeyLighter::get()->getLanguage($match[1][0]); |
79 | 79 | yield $factory->create(Token::NAME, ['pos' => $match[0][1], 'length' => strlen($match[0][0])]); |
80 | 80 | yield $factory->create( |
@@ -89,9 +89,9 @@ |
||
89 | 89 | public final function getFQN($class = false) |
90 | 90 | { |
91 | 91 | $embedded = $this->getEmbedded(); |
92 | - return ($class ? get_class($this) : $this->getIdentifier()) . ( |
|
92 | + return ($class ? get_class($this) : $this->getIdentifier()).( |
|
93 | 93 | !empty($embedded) |
94 | - ? ' + ' . implode(', ', array_map($class ? 'get_class' : function (Language $e) { |
|
94 | + ? ' + '.implode(', ', array_map($class ? 'get_class' : function(Language $e) { |
|
95 | 95 | return $e->getIdentifier(); |
96 | 96 | }, $embedded)) |
97 | 97 | : '' |
@@ -68,7 +68,7 @@ |
||
68 | 68 | new Rule(new RegexMatcher('/interface\s+([\w\\\]+)/i')), |
69 | 69 | new Rule(new DelegateRegexMatcher( |
70 | 70 | '/implements\s+((?:[\w\\\]+)(?:,\s*([\w\\\]+))+)/i', |
71 | - function ($match, TokenFactoryInterface $factory) { |
|
71 | + function($match, TokenFactoryInterface $factory) { |
|
72 | 72 | foreach (preg_split('/,\s*/', $match[1][0], 0, PREG_SPLIT_OFFSET_CAPTURE) as $interface) { |
73 | 73 | yield $factory->create(Token::NAME, [ |
74 | 74 | 'pos' => $match[1][1] + $interface[1], |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $css = new Css(); |
35 | 35 | $js = new JavaScript(); |
36 | 36 | $this->rules->addMany([ |
37 | - 'language.' . $js->getIdentifier() => [ |
|
37 | + 'language.'.$js->getIdentifier() => [ |
|
38 | 38 | new OpenRule(new RegexMatcher('/<script.*?>()/'), [ |
39 | 39 | 'factory' => new TokenFactory(LanguageToken::class), |
40 | 40 | 'inject' => $js, |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | 'language' => $js |
47 | 47 | ]) |
48 | 48 | ], |
49 | - 'language.' . $css->getIdentifier() => [ |
|
49 | + 'language.'.$css->getIdentifier() => [ |
|
50 | 50 | new OpenRule(new RegexMatcher('/<style.*?>()/'), [ |
51 | 51 | 'factory' => new TokenFactory(LanguageToken::class), |
52 | 52 | 'inject' => $css, |
@@ -71,7 +71,7 @@ |
||
71 | 71 | new CloseRule(new SubStringMatcher(')')), |
72 | 72 | ], |
73 | 73 | |
74 | - 'keyword.at-rule' => new Rule(new RegexMatcher('/(@(?:-[a-z]+-)?(?:' . implode('|', $at) . '))/'), [ |
|
74 | + 'keyword.at-rule' => new Rule(new RegexMatcher('/(@(?:-[a-z]+-)?(?:'.implode('|', $at).'))/'), [ |
|
75 | 75 | 'priority' => 2 |
76 | 76 | ]), |
77 | 77 |