Merge branch 'release/3.0.1'

This commit is contained in:
Christian Krause 2023-05-23 17:41:23 +02:00
commit f4d3da82a6
4 changed files with 11 additions and 10 deletions

View file

@ -20,7 +20,7 @@ interface ServiceInterface
/**
* @param string|null $forPath
*
* @return array|\Iterator
* @return \Iterator
*/
public function getItems(string $forPath = null): \Iterator;
}

View file

@ -15,8 +15,6 @@ namespace DigiComp\Menu\MenuService;
use Neos\Flow\Annotations as Flow;
/**
* @package DigiComp\Menu\Menu
*
* @Flow\Scope("singleton")
*/
class SettingsService implements ServiceInterface
@ -30,7 +28,7 @@ class SettingsService implements ServiceInterface
/**
* @var array
*/
protected array $items = array();
protected array $items = [];
public function getItems(string $forPath = null): \Iterator
{
@ -40,9 +38,9 @@ class SettingsService implements ServiceInterface
$items = &$this->menuConfiguration;
}
if ($items) {
uasort(
\uasort(
$items,
function ($a, $b) {
static function ($a, $b) {
return $a['sorting'] > $b['sorting'];
}
);

View file

@ -12,9 +12,9 @@ namespace DigiComp\Menu;
* source code.
*/
use Neos\Flow\Configuration\ConfigurationManager;
use Neos\Flow\Core\Bootstrap;
use Neos\Flow\Package\Package as BasePackage;
use Neos\Flow\Configuration\ConfigurationManager;
/**
* Package base class of the DigiComp.Menu package.

View file

@ -53,13 +53,16 @@ class ProgressViewHelper extends AbstractViewHelper
{
$links = $activeStep = $returnable = $stepsAs = $backLinkAs = $activeStepAs = $linksAs =
$activeStepLinkAs = $offset = $linkCount = null;
extract($this->arguments);
\extract($this->arguments, \EXTR_OVERWRITE);
//handling famous off by one
$activeStep -= $offset;
//make sure our array index is numeric
$links = array_values($links);
if (\is_iterable($links)) {
$links = \iterator_to_array($links);
}
$links = \array_values($links);
if (!$linkCount) {
$linkCount = count($links);
$linkCount = \count($links);
}
foreach ($links as $i => &$link) {
$link['completed'] = $activeStep > $i;