mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Use verb imperative to indicate method is non-mutating
This commit is contained in:
parent
a6c17f449e
commit
2235e36a2c
@ -38,7 +38,7 @@ final class RecursionLimiter implements Configurable
|
||||
}
|
||||
|
||||
/** @return self */
|
||||
public function increment()
|
||||
public function incremented()
|
||||
{
|
||||
return new self($this->maxDepth, $this->currentDepth + 1);
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ final class Parsedown
|
||||
*/
|
||||
public static function blocks(Lines $Lines, State $State)
|
||||
{
|
||||
$RecursionLimiter = $State->get(RecursionLimiter::class)->increment();
|
||||
$RecursionLimiter = $State->get(RecursionLimiter::class)->incremented();
|
||||
|
||||
if ($RecursionLimiter->isDepthExceeded()) {
|
||||
$State = $State->setting(new BlockTypes([], []));
|
||||
@ -189,7 +189,7 @@ final class Parsedown
|
||||
# standardize line breaks
|
||||
$text = \str_replace(["\r\n", "\r"], "\n", $text);
|
||||
|
||||
$RecursionLimiter = $State->get(RecursionLimiter::class)->increment();
|
||||
$RecursionLimiter = $State->get(RecursionLimiter::class)->incremented();
|
||||
|
||||
if ($RecursionLimiter->isDepthExceeded()) {
|
||||
return [Plaintext::build(new Excerpt($text, 0), $State)];
|
||||
|
Loading…
Reference in New Issue
Block a user