Skip to content

Commit d91eb52

Browse files
committed
improved phpDoc
1 parent 154add9 commit d91eb52

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

src/ComponentModel/Component.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ abstract class Component implements IComponent
3030
/** @var string|null */
3131
private $name;
3232

33-
/** @var array of [type => [obj, depth, path, array of [attached, detached]]] */
33+
/** @var array<string, array{?IComponent, ?int, ?string, array<int, array{?callable, ?callable}>}> means [type => [obj, depth, path, [attached, detached]]] */
3434
private $monitors = [];
3535

3636

@@ -203,7 +203,8 @@ protected function validateParent(IContainer $parent): void
203203

204204
/**
205205
* Refreshes monitors.
206-
* @param array|null $missing (array = attaching, null = detaching)
206+
* @param array<string,true>|null $missing (array = attaching, null = detaching)
207+
* @param array<int,array{callable,IComponent}> $listeners
207208
*/
208209
private function refreshMonitors(int $depth, array &$missing = null, array &$listeners = []): void
209210
{

src/ComponentModel/Container.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ protected function createComponent(string $name): ?IComponent
166166

167167
/**
168168
* Iterates over descendants components.
169+
* @return \Iterator<int|string,IComponent>
169170
*/
170171
final public function getComponents(bool $deep = false, string $filterType = null): \Iterator
171172
{

src/ComponentModel/IContainer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ function removeComponent(IComponent $component): void;
2828

2929
/**
3030
* Returns component specified by name or path.
31-
* @throws Nette\InvalidArgumentException if component doesn't exist
31+
* @throws \Nette\InvalidArgumentException if component doesn't exist
3232
*/
3333
function getComponent(string $name): ?IComponent;
3434

3535
/**
3636
* Iterates over descendants components.
37+
* @return \Iterator<int|string,IComponent>
3738
*/
3839
function getComponents(): \Iterator;
3940
}

src/ComponentModel/RecursiveComponentIterator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function hasChildren(): bool
2727

2828
/**
2929
* The sub-iterator for the current element.
30+
* @return \RecursiveIterator<int|string,IComponent>
3031
*/
3132
public function getChildren(): \RecursiveIterator
3233
{

0 commit comments

Comments
 (0)