Skip to content

Commit 09dcc8d

Browse files
committed
added property typehints
1 parent 5270afe commit 09dcc8d

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

src/ComponentModel/Component.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,11 @@ abstract class Component implements IComponent
2424
{
2525
use Nette\SmartObject;
2626

27-
/** @var IContainer|null */
28-
private $parent;
29-
30-
/** @var string|null */
31-
private $name;
27+
private ?IContainer $parent = null;
28+
private ?string $name = null;
3229

3330
/** @var array<string, array{?IComponent, ?int, ?string, array<int, array{?callable, ?callable}>}> means [type => [obj, depth, path, [attached, detached]]] */
34-
private $monitors = [];
31+
private array $monitors = [];
3532

3633

3734
/**

src/ComponentModel/Container.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ class Container extends Component implements IContainer
2222
private const NameRegexp = '#^[a-zA-Z0-9_]+$#D';
2323

2424
/** @var IComponent[] */
25-
private $components = [];
26-
27-
/** @var Container|null */
28-
private $cloning;
25+
private array $components = [];
26+
private ?Container $cloning = null;
2927

3028

3129
/********************* interface IContainer ****************d*g**/

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class Notes
1919
{
20-
public static $notes = [];
20+
public static array $notes = [];
2121

2222

2323
public static function add($message): void

0 commit comments

Comments
 (0)