@@ -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 |
@@ -54,7 +54,7 @@ |
||
54 | 54 | new Rule(new CommentMatcher([';'], []), ['priority' => 2]) |
55 | 55 | ], |
56 | 56 | |
57 | - 'variable.register' => new Rule(new RegexMatcher('/\b(' . implode('|', $this->registers) . ')\b/i')), |
|
57 | + 'variable.register' => new Rule(new RegexMatcher('/\b('.implode('|', $this->registers).')\b/i')), |
|
58 | 58 | 'number' => new Rule(new RegexMatcher('/\b(-?[0-9][0-9a-fA-F]*[tTdDhHOoqQbByY]?)\b/i')), |
59 | 59 | 'operator' => [ |
60 | 60 | 'punctuation' => new Rule(new RegexMatcher('/(,)/'), ['priority' => 0]), |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | public static function strings(array $strings, array $options = []) |
32 | 32 | { |
33 | - return array_map(function ($matcher) use ($options) { |
|
33 | + return array_map(function($matcher) use ($options) { |
|
34 | 34 | return new Rule( |
35 | 35 | $matcher instanceof MatcherInterface ? $matcher : new SubStringMatcher($matcher), |
36 | 36 | array_replace(['factory' => new TokenFactory(ContextualToken::class)], $options) |
@@ -61,7 +61,7 @@ |
||
61 | 61 | 'string.nowdoc' => new Rule( |
62 | 62 | new RegexMatcher('/<<\s*\'(\w+)\';(?P<string>.*?)\R\1/sm', [ |
63 | 63 | 'string' => Token::NAME, |
64 | - 0 => 'keyword.nowdoc' |
|
64 | + 0 => 'keyword.nowdoc' |
|
65 | 65 | ]), |
66 | 66 | ['context' => ['!comment']] |
67 | 67 | ), |
@@ -48,7 +48,7 @@ |
||
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 | if ($name !== null) { |
54 | 54 | $name = $this->getName($name); |