Conditions | 7 |
Paths | 4 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 7 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | 1863 | public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart |
|
26 | { |
||
27 | 1863 | if ($cursor->isIndented() || $cursor->getNextNonSpaceCharacter() !== '<') { |
|
28 | 1617 | return BlockStart::none(); |
|
1 ignored issue
–
show
|
|||
29 | } |
||
30 | |||
31 | 303 | $tmpCursor = clone $cursor; |
|
32 | 303 | $tmpCursor->advanceToNextNonSpaceOrTab(); |
|
33 | 303 | $line = $tmpCursor->getRemainder(); |
|
34 | |||
35 | 303 | for ($blockType = 1; $blockType <= 7; $blockType++) { |
|
36 | 303 | $match = RegexHelper::matchAt( |
|
37 | 303 | RegexHelper::getHtmlBlockOpenRegex($blockType), |
|
38 | 101 | $line |
|
39 | ); |
||
40 | |||
41 | 303 | if ($match !== null && ($blockType < 7 || ! ($parserState->getLastMatchedBlockParser()->getBlock() instanceof Paragraph))) { |
|
42 | 171 | return BlockStart::of(new HtmlBlockParser($blockType))->at($cursor); |
|
43 | } |
||
44 | } |
||
45 | |||
46 | 144 | return BlockStart::none(); |
|
1 ignored issue
–
show
|
|||
47 | } |
||
49 |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.