@@ -151,7 +151,7 @@ |
||
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
154 | - * @return Token|null|false |
|
154 | + * @return Token |
|
155 | 155 | */ |
156 | 156 | public function getEnd() |
157 | 157 | { |
@@ -85,7 +85,7 @@ |
||
85 | 85 | return $this->_end === null; |
86 | 86 | } |
87 | 87 | |
88 | - public function isValid(Context $context) |
|
88 | + public function isValid(Context $context) |
|
89 | 89 | { |
90 | 90 | if ($this->_valid === null) { |
91 | 91 | $this->validate($context); |
@@ -66,7 +66,7 @@ |
||
66 | 66 | 'string.nowdoc' => new Rule( |
67 | 67 | new RegexMatcher('/<<\s*\'(\w+)\';(?P<string>.*?)\n\1/sm', [ |
68 | 68 | 'string' => Token::NAME, |
69 | - 0 => 'keyword.nowdoc' |
|
69 | + 0 => 'keyword.nowdoc' |
|
70 | 70 | ]), ['context' => ['!comment']] |
71 | 71 | ), |
72 | 72 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | /** |
26 | 26 | * RegexMatcher constructor. |
27 | 27 | * |
28 | - * @param $regex |
|
28 | + * @param string $regex |
|
29 | 29 | * @param callable $callable |
30 | 30 | */ |
31 | 31 | public function __construct($regex, callable $callable) |
@@ -64,8 +64,8 @@ |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | - * @param Language|callable|string $language |
|
68 | - * @param array[string] $aliases |
|
67 | + * @param string $language |
|
68 | + * @param string[] $aliases |
|
69 | 69 | */ |
70 | 70 | public function registerLanguage($language, $aliases) |
71 | 71 | { |
@@ -108,6 +108,9 @@ discard block |
||
108 | 108 | return $this->_parser->process($tokens); |
109 | 109 | } |
110 | 110 | |
111 | + /** |
|
112 | + * @param string $source |
|
113 | + */ |
|
111 | 114 | public function tokenize($source, $additional = [], $offset = 0, $embedded = false) |
112 | 115 | { |
113 | 116 | return new TokenIterator( |
@@ -145,7 +148,7 @@ discard block |
||
145 | 148 | /** |
146 | 149 | * @param bool $embedded |
147 | 150 | * |
148 | - * @return Rule[] |
|
151 | + * @return \Generator |
|
149 | 152 | */ |
150 | 153 | private function _rules($embedded = false) |
151 | 154 | { |
@@ -177,7 +180,7 @@ discard block |
||
177 | 180 | * |
178 | 181 | * @param $embedded |
179 | 182 | * |
180 | - * @return Rule|\Kadet\Highlighter\Parser\Rule[] |
|
183 | + * @return Rule |
|
181 | 184 | */ |
182 | 185 | public function getEnds($embedded = false) |
183 | 186 | { |