Skip to content

Commit 194171d

Browse files
committed
Component::lookup nullable when $need=false
1 parent fb1b40f commit 194171d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This extension provides following features:
1212
* `Nette\ComponentModel\Container::getComponent()` knows type of the component because it reads the return type on `createComponent*` (this works best in presenters and controls)
1313
* `Nette\DI\Container::getByType` and `createInstance` return type based on first parameter (`Foo::class`).
1414
* `Nette\Forms\Container::getValues` return type based on `$asArray` parameter.
15+
* `Nette\ComponentModel\Component::lookup` return type based on `$need` parameter.
1516
* Dynamic methods of [Nette\Utils\Html](https://doc.nette.org/en/2.4/html-elements)
1617
* Magic [Nette\Object and Nette\SmartObject](https://doc.nette.org/en/2.4/php-language-enhancements) properties
1718
* Event listeners through the `on*` properties

extension.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ services:
3333
tags:
3434
- phpstan.broker.dynamicMethodReturnTypeExtension
3535

36+
-
37+
class: ComponentLookupMethodReflectionExtension
38+
tags:
39+
- phpstan.broker.dynamicMethodReturnTypeExtension
40+
3641
-
3742
class: PHPStan\Type\Nette\FormsBaseControlDynamicReturnTypeExtension
3843
tags:

0 commit comments

Comments
 (0)