1
0
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:
Aidan Woods 2020-01-19 18:06:22 +00:00
parent a6c17f449e
commit 2235e36a2c
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
2 changed files with 3 additions and 3 deletions

View File

@ -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);
}

View File

@ -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)];