Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Improve some types
  • Loading branch information
stof committed Jun 13, 2025
commit adf963e53eef2e905a4281bb9938e5f4d896eb38
6 changes: 3 additions & 3 deletions src/Knp/Menu/Matcher/Matcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ class Matcher implements MatcherInterface
private \WeakMap $cache;

/**
* @var iterable|VoterInterface[]
* @var iterable<VoterInterface>
*/
private iterable $voters;

/**
* @param VoterInterface[]|iterable $voters
* @param iterable<VoterInterface> $voters
*/
public function __construct($voters = [])
public function __construct(iterable $voters = [])
{
$this->voters = $voters;
$this->cache = new \WeakMap();
Expand Down
6 changes: 3 additions & 3 deletions src/Knp/Menu/Provider/ChainProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
class ChainProvider implements MenuProviderInterface
{
/**
* @var iterable|MenuProviderInterface[]
* @var iterable<MenuProviderInterface>
*/
private iterable $providers;

/**
* @param MenuProviderInterface[]|iterable $providers
* @param iterable<MenuProviderInterface> $providers
*/
public function __construct($providers)
public function __construct(iterable $providers)
{
$this->providers = $providers;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Knp/Menu/Provider/LazyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class LazyProvider implements MenuProviderInterface
{
/**
* @phpstan-param array<string, callable|array{\Closure, string}> $builders
* @phpstan-param array<string, (callable(): ItemInterface)|array{\Closure(): object, string}> $builders
*/
public function __construct(private array $builders)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Knp/Menu/Provider/MenuProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface MenuProviderInterface
*
* @param array<string, mixed> $options
*
* @throws \InvalidArgumentException if the menu does not exists
* @throws \InvalidArgumentException if the menu does not exist
*/
public function get(string $name, array $options = []): ItemInterface;

Expand Down
2 changes: 1 addition & 1 deletion src/Knp/Menu/Renderer/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function __construct(?string $charset = null)
}

/**
* Renders a HTML attribute
* Renders an HTML attribute
*
* @param string|bool $value
*/
Expand Down