You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add undocumented features found by inspecting src/:
- Array access component type resolution via createComponent*
- Forms\Container::getUntrustedValues return type
- BaseControl fluent method static return type
- Presenter::getSession return type based on arguments
- Presenter @Inject properties treated as initialized
- Strings::replace() callback closure type from regex pattern
- RegularExpressionPatternRule for Nette\Utils\Strings methods
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,20 +10,27 @@
10
10
This extension provides following features:
11
11
12
12
*`Nette\ComponentModel\Container::getComponent()` knows type of the component because it reads the return type on `createComponent*` (this works best in presenters and controls)
13
+
* Array access on components (`$component['name']`) resolves types via `createComponent*` methods
13
14
*`Nette\DI\Container::getByType` and `createInstance` return type based on first parameter (`Foo::class`).
14
15
*`Nette\Forms\Container::getValues` return type based on `$asArray` parameter.
16
+
*`Nette\Forms\Container::getUntrustedValues` return type based on mapping class parameter.
17
+
*`Nette\Forms\Controls\BaseControl` fluent methods return `static` instead of `BaseControl`.
15
18
*`Nette\ComponentModel\Component::lookup` return type based on `$throw` parameter.
16
19
*`Nette\Application\UI\Component::getPresenter` return type based on `$throw` parameter.
20
+
*`Nette\Application\UI\Presenter::getSession` returns `Session` or `SessionSection` based on arguments.
17
21
* Dynamic methods of [Nette\Utils\Html](https://doc.nette.org/en/2.4/html-elements)
18
22
* Magic [Nette\Object and Nette\SmartObject](https://doc.nette.org/en/2.4/php-language-enhancements) properties
19
23
* Event listeners through the `on*` properties
24
+
* Presenter `@inject` properties are treated as initialized.
20
25
* Defines early terminating method calls for Presenter methods to prevent `Undefined variable` errors
21
26
* Understand the exact array shape coming from `Nette\Utils\Strings::match()` and `Nette\Utils\Strings::matchAll()` based on pattern
27
+
*`Nette\Utils\Strings::replace()` callback closure parameter type inferred from regex pattern
22
28
23
29
It also contains these framework-specific rules (can be enabled separately):
24
30
25
31
* Do not extend Nette\Object, use Nette\SmartObject trait instead
26
32
* Rethrow exceptions that are always meant to be rethrown (like `AbortException`)
33
+
* Validate regex patterns passed to `Nette\Utils\Strings` methods
0 commit comments