Skip to content

Commit 6321ffd

Browse files
committed
add missing comments and typehits to validate phpstan in the newer version
1 parent 341e3cb commit 6321ffd

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

grumphp.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
parameters:
2-
git_dir: .
3-
bin_dir: vendor/bin
1+
grumphp:
2+
hooks_dir: .
3+
hooks_preset: local
44
tasks:
55
composer_script:
66
script: check-all

src/Container/Config/ConfigProvider.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
class ConfigProvider
1111
{
12+
/**
13+
* @return array<mixed>
14+
*/
1215
public function __invoke(): array
1316
{
1417
return [

src/ListenerCollection.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
use function array_key_exists;
1010

11+
/**
12+
* @implements \IteratorAggregate<mixed>
13+
*/
1114
class ListenerCollection implements IteratorAggregate, ListenerCollectorInterface, ListenerLocatorInterface
1215
{
1316
/** @var array<string, array<int, callable>> */
@@ -28,6 +31,9 @@ public function addListener(string $eventClass, callable $listener): void
2831
$this->listeners[$eventClass] = [$listener];
2932
}
3033

34+
/**
35+
* @return iterable<callable>
36+
*/
3137
public function get(string $eventClass): iterable
3238
{
3339
if ($this->has($eventClass)) {
@@ -40,6 +46,9 @@ public function has(string $eventClass): bool
4046
return array_key_exists($eventClass, $this->listeners);
4147
}
4248

49+
/**
50+
* @return \Generator<mixed>|\Traversable<mixed>
51+
*/
4352
public function getIterator()
4453
{
4554
yield from $this->listeners;

src/ListenerLocatorInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@
77
interface ListenerLocatorInterface
88
{
99
public function has(string $eventClass): bool;
10+
11+
/**
12+
* @return iterable<mixed>
13+
*/
1014
public function get(string $eventClass): iterable;
1115
}

src/ListenerProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function addListener(string $eventClass, callable $listener): void
2424

2525
/**
2626
* @param StoppableEventInterface $event
27-
* @return iterable
27+
* @return iterable<object>
2828
*/
2929
public function getListenersForEvent(object $event): iterable
3030
{

0 commit comments

Comments
 (0)