Skip to content

Commit

Permalink
added property typehints
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 8, 2023
1 parent e69aadb commit 06aa063
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
9 changes: 3 additions & 6 deletions src/ComponentModel/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@ abstract class Component implements IComponent
{
use Nette\SmartObject;

/** @var IContainer|null */
private $parent;

/** @var string|null */
private $name;
private ?IContainer $parent = null;
private ?string $name = null;

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


/**
Expand Down
6 changes: 2 additions & 4 deletions src/ComponentModel/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ class Container extends Component implements IContainer
private const NameRegexp = '#^[a-zA-Z0-9_]+$#D';

/** @var IComponent[] */
private $components = [];

/** @var Container|null */
private $cloning;
private array $components = [];
private ?Container $cloning = null;


/********************* interface IContainer ****************d*g**/
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class Notes
{
public static $notes = [];
public static array $notes = [];


public static function add($message): void
Expand Down

0 comments on commit 06aa063

Please sign in to comment.