Skip to content

More precise types - #357

Open
xificurk wants to merge 4 commits into
nette:masterfrom
xificurk:typehints-improvements
Open

xificurk wants to merge 4 commits into
nette:masterfrom
xificurk:typehints-improvements

Conversation

@xificurk

@xificurk xificurk commented Nov 7, 2026

Copy link
Copy Markdown
Contributor
  • new feature - not really
  • BC break no

Static analysis should get precise types from Nette itself, without stubs or extensions. In a few places the native phpdoc was less precise than what the code actually returns, and in one place it was wrong ($errors left out Stringable messages). All changes are phpdoc-only and covered by type tests.

The 'array' branch is checked first in the conditional return type, so
PHPStan no longer reports array|array<mixed> and verifies the return
statement of getValues(), which makes its ignoreErrors entry obsolete.

Co-Authored-By: Claude Code
getControls() yields control names, which are always strings; a generator
keeps them as is, so numeric names are not turned into integers.

Co-Authored-By: Claude Code
The $errors and $ownErrors properties match getErrors() and getOwnErrors(),
including Stringable messages. A multiple UploadControl returns a list,
as its value is read with Form::DataList.

Co-Authored-By: Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant