Skip to content

Commit

Permalink
Code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
LastDragon-ru committed Jan 22, 2025
1 parent 4a45252 commit 5b120e2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion packages/documentator/src/Markdown/Environment/Locator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@
use WeakMap;

use function array_key_first;
use function array_key_last;
use function array_slice;
use function assert;
use function mb_strlen;
use function mb_strpos;
use function mb_substr;
use function preg_split;

// todo(documentator): Internal padding for Location
Expand Down Expand Up @@ -149,7 +152,7 @@ private function getParagraphLocation(Paragraph $node): ?Location {
$parent instanceof BlockQuote => 2,
default => 0,
};
$parent = $parent->parent();
$parent = $parent->parent();
} while ($parent instanceof Node);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
/**
* @internal
*/
readonly class BlockStartParserWrapper
implements BlockStartParserInterface, EnvironmentAwareInterface, ConfigurationAwareInterface {
readonly class BlockStartParserWrapper implements BlockStartParserInterface, EnvironmentAwareInterface, ConfigurationAwareInterface {
use Aware;

public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@
use function implode;
use function mb_strlen;
use function mb_substr;
use function mb_substr_count;
use function reset;
use function str_replace;

/**
* todo(documentator): [league/commonmark] [update] Check {@see Environment::injectEnvironmentAndConfigurationIfNeeded()}.
*
* @see Environment
*/

/**
Expand Down Expand Up @@ -96,8 +100,8 @@ public function parse(InlineParserContext $inlineContext): bool {

if ($beforeLinesCount > 0) {
$correction = (mb_strlen(implode("\n", array_slice($beforeLines, 0, -1))) + 1);
$offset -= $correction;
$origin -= $correction;
$offset -= $correction;
// $origin -= $correction;
}

if ($startLine !== $endLine) {
Expand Down

0 comments on commit 5b120e2

Please sign in to comment.