Cleaned up some variable names
Этот коммит содержится в:
родитель
742bb52ff0
Коммит
6d5914049a
@ -27,6 +27,6 @@ trait HeaderTagInterpreter
|
|||||||
$desired = range((int) $topLevel, (int) $topLevel + ((int) $depth - 1));
|
$desired = range((int) $topLevel, (int) $topLevel + ((int) $depth - 1));
|
||||||
$allowed = [1, 2, 3, 4, 5, 6];
|
$allowed = [1, 2, 3, 4, 5, 6];
|
||||||
|
|
||||||
return array_map(function($v) { return 'h'.$v; }, array_intersect($desired, $allowed));
|
return array_map(function($val) { return 'h'.$val; }, array_intersect($desired, $allowed));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,11 +52,11 @@ class UniqueSluggifier
|
|||||||
{
|
{
|
||||||
$slugged = $this->slugify->slugify($text);
|
$slugged = $this->slugify->slugify($text);
|
||||||
|
|
||||||
$ct = 1;
|
$count = 1;
|
||||||
$orig = $slugged;
|
$orig = $slugged;
|
||||||
while (in_array($slugged, $this->used)) {
|
while (in_array($slugged, $this->used)) {
|
||||||
$slugged = $orig . '-' . $ct;
|
$slugged = $orig . '-' . $count;
|
||||||
$ct++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->used[] = $slugged;
|
$this->used[] = $slugged;
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user