Skip to content

Commit 5258198

Browse files
committed
fixed using null as an array offset
1 parent 0392507 commit 5258198

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ComponentModel/Component.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ abstract class Component implements IComponent
3737
*/
3838
final public function lookup(?string $type, bool $throw = true): ?IComponent
3939
{
40+
$type ??= '';
4041
if (!isset($this->monitors[$type])) { // not monitored or not processed yet
4142
$obj = $this->parent;
4243
$path = self::NameSeparator . $this->name;
@@ -82,7 +83,7 @@ final public function lookup(?string $type, bool $throw = true): ?IComponent
8283
final public function lookupPath(?string $type = null, bool $throw = true): ?string
8384
{
8485
$this->lookup($type, $throw);
85-
return $this->monitors[$type][2];
86+
return $this->monitors[$type ?? ''][2];
8687
}
8788

8889

0 commit comments

Comments
 (0)