| phpstan-rules | by dg | added Nette\Schema\Expect::array() return type narrowing | | | |
| phpstan-rules | by dg | added RemoveFailingReturnTypeExtension extension to remove |false from native functions and methods | | | |
| phpstan-rules | by dg | added Registry::getMapper(), getAsset() and Mapper::getAsset() return type narrowing | | | |
| phpstan-rules | by dg | report invalid regex patterns in Nette\Utils\Strings calls New ValidRegularExpressionRule (the first custom rule in the project) checks constant patterns passed to Strings::match/matchAll/split/replace and reports compilation errors via RegexpException under identifier nette.strings.regexpPattern. Enabled by default. Adds TypeAssert::assertErrors() for testing rules (assertNoErrors now delegates to it). | | | |
| phpstan-rules | by dg | added CLAUDE.md | | | |
| phpstan-rules | by dg | added arrow function void ignore for passing fn() => to Closure(): void parameters | | | |
| phpstan-rules | by dg | guard dynamic return type extensions against first-class callables Extensions called getArgs() unconditionally on the entry node. For a first-class callable such as json_encode(...) or $form[x]->m(...), PHPStan getArgs() asserts !isFirstClassCallable(), so any covered function/method/static method used in first-class-callable syntax crashed the whole analysis with an internal error. Bail out (return null) when the call node is a first-class callable, before touching getArgs(). Mirrors the standard guard in core PHPStan extensions. | | | |
| phpstan-rules | by dg | add StringsRegexHelper for the Nette\Utils\Strings regex extensions Shared helper that centralizes the translation of Nette's boolean parameters into a PREG flag mask, the RegexArrayShapeMatcher calls (matchShape/matchAllShape, instance) and stateless argument resolution (resolveFlag/findArg, static). The Strings regex extensions added in the following commits build on it. | | | |
| phpstan-rules | by dg | added Arrays::invoke() and invokeMethod() return type narrowing | | | |
| phpstan-rules | by dg | init | | | |
| phpstan-rules | by dg | derive exact array shape from regex in Strings::match/matchAll StringsReturnTypeExtension now uses phpstan's RegexArrayShapeMatcher to infer the precise shape (capture groups, named/optional groups, offsets) for constant patterns, translating Nette's boolean parameters into a PREG flag mask. Non-constant patterns and the lazy matchAll() Generator fall back to the previous generic shape; split() is unchanged. | | | |
| phpstan-rules | by dg | nette/database row type narrowing (table/related/ref/insert) Narrows return types based on a configurable table-to-entity-class mapping (nette.database.mapping.tables), which is not yet part of the nette/database distribution. Kept as the topmost commit so the whole feature can be excluded or rebased independently. Includes: - TableRowTypeResolver shared resolver - Explorer::table() -> Selection<EntityRow> - ActiveRow::related() -> GroupedSelection<EntityRow> - ActiveRow::ref() -> ?EntityRow - Selection::insert() -> mapped EntityRow | | | |
| phpstan-rules | by dg | added Container::getComponent() and $container['…'] return type narrowing Also resolves nested access - chained ($container['a']['b']) and Nette's dash notation ($container['a-b']) - via createComponent<Name>() factories. | | | |
| phpstan-rules | by dg | added suppression for Form event-handler callback assignments | | | |
| phpstan-rules | by dg | added .phpt file extension | | | |
| phpstan-rules | by dg | RemoveFailingReturnTypeExtension: preg_* narrowing only for constant patterns | | | |
| phpstan-rules | by dg | narrow match subject string after Strings::match/matchAll New StringsMatchTypeSpecifyingExtension narrows the subject of a successful Strings::match()/matchAll() call inside a truthy context, e.g. `if (Strings::match($s, '#\d+#'))` makes $s a non-empty-string. Delegates to RegexArrayShapeMatcher::matchSubjectExpr(). | | | |
| phpstan-rules | by dg | added Html::getXxx(), setXxx(), addXxx() magic method resolution | | | |
| phpstan-rules | by dg | added Tester\Assert type narrowing for assertion methods (null, notNull, true, false, same, type, …) | | | |
| phpstan-rules | by dg | RemoveFailingReturnTypeExtension: preserved |false for UTF-8 validation patterns like //u | | | |
| phpstan-rules | by dg | readonly properties | | | |
| phpstan-rules | by dg | warn when catch swallows Nette\Application\AbortException New RethrowAbortExceptionRule flags the common presenter bug where a broad catch (\Throwable)/catch (\Exception) swallows an AbortException thrown by redirect()/forward()/terminate(), silently breaking the redirect. It fires only when the try block can actually throw AbortException (detected via method getThrowType()) and the first matching catch does not rethrow. Carving out a catch (AbortException) { throw; } before the broad catch silences it. Enabled by default. | | | |
| phpstan-rules | by dg | added boilerplate | | | |
| phpstan-rules | by dg | enabled strict PHPStan analysis parameters Added 9 strict analysis parameters to extension.neon to enforce stricter type checking in Nette libraries: callable signatures, function/class name casing, nullable types in signatures and PHPDocs, redundant conditions, and @var tag validation. | | | |
| phpstan-rules | by dg | treat #[Inject] attribute properties as initialized New InjectPropertyExtension (ReadWritePropertiesExtension) marks properties annotated with #[Nette\DI\Attributes\Inject] as always-written and initialized, since Nette DI assigns them after instantiation. Only the attribute form is recognized, not the legacy @inject phpDoc. Also teaches TypeAssert::assertNoErrors() to pass the analysed file into analysedPaths (like assertTypes already does), so classes defined in the test file are in reflection scope. | | | |
| phpstan-rules | by dg | added TypeAssert helper for type inference testing with Nette Tester | | | |
| phpstan-rules | by dg | added Forms\Container::getComponent() and $form['…'] return type narrowing based on addXxx() calls | | | |
| phpstan-rules | by dg | added universalObjectCratesClasses for Nette | | | |
| phpstan-rules | by dg | added Helpers::falseToNull() return type narrowing (string|false → string|null) | | | |
| phpstan-rules | by dg | added readme.md | | | |
| phpstan-rules | by dg | added Strings::match/matchAll/split() return type narrowing based on boolean arguments | | | |
| phpstan-rules | by dg | RemoveFailingReturnTypeExtension: preg_replace/filter null return type removal | | | |