Skip to content

Commit

Permalink
compatible to new knp 3.x & php82 version
Browse files Browse the repository at this point in the history
  • Loading branch information
beinbm committed Aug 10, 2023
1 parent b1f7961 commit 0407161
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Factory/FlatMenuExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class FlatMenuExtension implements ExtensionInterface {
* @param array $options
* @return array
*/
public function buildOptions(array $options) {
public function buildOptions(array $options): array {
// TODO: Implement buildOptions() method.

return $options;
Expand All @@ -27,7 +27,7 @@ public function buildOptions(array $options) {
* @param ItemInterface $item
* @param array $options
*/
public function buildItem(ItemInterface $item, array $options) {
public function buildItem(ItemInterface $item, array $options): void {
// Set extra parameters

$params = ['icon', 'rate_rights', 'headline', 'hide_navbar', 'badge', 'rate_alt_uri', 'user_rights'];
Expand Down
6 changes: 3 additions & 3 deletions src/Factory/UrlCacheExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class UrlCacheExtension implements ExtensionInterface {
* @param array $options
* @return array
*/
public function buildOptions(array $options) {
public function buildOptions(array $options): array {
// TODO: Implement buildOptions() method.

return $options;
Expand All @@ -27,7 +27,7 @@ public function buildOptions(array $options) {
* @param ItemInterface $item
* @param array $options
*/
public function buildItem(ItemInterface $item, array $options) {
public function buildItem(ItemInterface $item, array $options): void {
// TODO: Implement buildItem() method.

$urlCache = $item->getRoot()->getExtra('UrlCache');
Expand All @@ -41,4 +41,4 @@ public function buildItem(ItemInterface $item, array $options) {

}

}
}
2 changes: 1 addition & 1 deletion src/Matcher/Voter/CakeRouteVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct($route) {
$this->route = $route;
}

public function matchItem(ItemInterface $item) {
public function matchItem(ItemInterface $item): ?bool {
if (null === $this->route || null === $item->getUri()) {
return null;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Renderer/FlatMenuRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(MatcherInterface $matcher, array $defaultOptions = a
parent::__construct($charset);
}

public function render(ItemInterface $item, array $options = array()) {
public function render(ItemInterface $item, array $options = array()): string {
$options = array_merge($this->defaultOptions, $options);

$html = $this->renderList($item, $item->getChildrenAttributes(), $options);
Expand All @@ -56,11 +56,11 @@ public function render(ItemInterface $item, array $options = array()) {
return $html;
}

public function renderBacklink(ItemInterface $item, $options = array()) {
public function renderBacklink(ItemInterface $item, $options = array()): string {
$options = array_merge($this->defaultOptions, $options);

if (empty($options['headline'])) {
return null;
return '';
}

if (!empty($options['label'])) {
Expand Down

0 comments on commit 0407161

Please sign in to comment.