Skip to content

Commit

Permalink
Add ReturnTypeWillChange (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu authored Oct 13, 2021
1 parent f88fcfb commit 5c42ee5
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
php: '7.4'
- description: 'No Symfony specified'
php: '8.0'
- description: 'No Symfony specified'
php: '8.1'
- description: 'Lowest deps'
php: '7.3'
composer_option: '--prefer-lowest'
Expand All @@ -45,6 +47,9 @@ jobs:
- description: 'Symfony 5.3'
php: '7.4'
symfony: 5.3.*
- description: 'Symfony 5.4'
php: '7.4'
symfony: 5.4.x-dev
- description: 'Dev deps'
php: '8.0'
dev: true
Expand Down
4 changes: 4 additions & 0 deletions src/Knp/Menu/Iterator/CurrentItemFilterIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public function __construct(\Iterator $iterator, MatcherInterface $matcher)
parent::__construct($iterator);
}

/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function accept()
{
return $this->matcher->isCurrent($this->current());
Expand Down
8 changes: 8 additions & 0 deletions src/Knp/Menu/Iterator/DisplayedItemFilterIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@
*/
class DisplayedItemFilterIterator extends \RecursiveFilterIterator
{
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function accept()
{
return $this->current()->isDisplayed();
}

/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function hasChildren()
{
return $this->current()->getDisplayChildren() && parent::hasChildren();
Expand Down
4 changes: 4 additions & 0 deletions src/Knp/Menu/Iterator/RecursiveItemIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ public function hasChildren(): bool
return 0 < \count($this->current());
}

/**
* @return \RecursiveIterator
*/
#[\ReturnTypeWillChange]
public function getChildren()
{
return new static($this->current());
Expand Down
1 change: 1 addition & 0 deletions src/Knp/Menu/MenuItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ public function offsetExists($offset): bool
*
* @return ItemInterface|null
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->getChild($offset);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Knp\Menu\Tests\Silex;
namespace Knp\Menu\Tests\Integration\Symfony;

use Knp\Menu\Integration\Symfony\RoutingExtension;
use PHPUnit\Framework\TestCase;
Expand Down

0 comments on commit 5c42ee5

Please sign in to comment.