Compare commits

..

No commits in common. "master" and "3.0.0" have entirely different histories.

5 changed files with 19 additions and 33 deletions

View file

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

View file

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

View file

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

View file

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

View file

@ -1,49 +1,36 @@
{ {
"name": "digicomp/menu", "name": "digicomp/menu",
"description": "Helps with the creation of simple fluid based menus",
"type": "neos-package", "type": "neos-package",
"description": "Helps with the creation of simple fluid based menus",
"keywords": [ "keywords": [
"Neos", "flow",
"Flow", "neos",
"menu" "menu"
], ],
"homepage": "https://git.digital-competence.de/Packages/DigiComp.Menu",
"license": "MIT",
"authors": [ "authors": [
{ {
"name": "Ferdinand Kuhl", "name": "Ferdinand Kuhl",
"email": "f.kuhl@digital-competence.de", "email": "f.kuhl@digital-competence.de",
"homepage": "https://www.digital-competence.de", "homepage": "http://www.digital-competence.de",
"role": "Developer" "role": "Developer"
} }
], ],
"license": "MIT",
"homepage": "https://github.com/digicomp/DigiComp.Menu",
"require": { "require": {
"php": ">=7.4.0", "neos/flow": "~6.3",
"neos/flow": "^6.3.21" "php": "^7.4"
},
"require-dev": {
"mikey179/vfsstream": "^1.6.1",
"neos/buildessentials": "^7.0.0",
"phpunit/phpunit": "~8.5",
"vimeo/psalm": "~4.22.0"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"DigiComp\\Menu\\": "Classes/" "DigiComp\\Menu\\": "Classes"
} }
}, },
"config": {
"sort-packages": true,
"platform-check": true
},
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-develop": "3.0.x-dev", "dev-develop": "3.0.x-dev",
"dev-version/2.x-dev": "2.0.x-dev" "dev-version/2.x-dev": "2.0.x-dev"
}, },
"neos": {
"package-key": "DigiComp.Menu"
},
"applied-flow-migrations": [ "applied-flow-migrations": [
"TYPO3.Fluid-20150214130800", "TYPO3.Fluid-20150214130800",
"TYPO3.Fluid-20141121091700", "TYPO3.Fluid-20141121091700",