Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Runtime] Fix TypeError when resolving untyped arguments#64215

Merged
nicolas-grekas merged 1 commit into
symfony:8.1symfony/symfony:8.1from
nicolas-grekas:runtime-fixnicolas-grekas/symfony:runtime-fixCopy head branch name to clipboard
May 15, 2026
Merged

[Runtime] Fix TypeError when resolving untyped arguments#64215
nicolas-grekas merged 1 commit into
symfony:8.1symfony/symfony:8.1from
nicolas-grekas:runtime-fixnicolas-grekas/symfony:runtime-fixCopy head branch name to clipboard

Conversation

@nicolas-grekas
Copy link
Copy Markdown
Member

Q A
Branch? 8.1
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #64209
License MIT

SymfonyRuntime::getArgument() accepts ?string $type but forwarded null straight to resolveType(string), raising a TypeError. The parent GenericRuntime::getArgument() had the same hole, forwarding null to getRuntime(string).

Skip resolveType() when $type is null, and let getRuntime() see 'mixed' so it falls through to the standard InvalidArgumentException (which getResolver() already catches for optional params).

Copy link
Copy Markdown
Contributor

@Kingdutch Kingdutch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change makes sense to me. If there's no type then there's nothing for resolveType to do. If developers want to special-case the NULL scenario then they have the broader getArgument which they can override.

I think the different behavior for getRuntime makes sense since there's the configurability and mixed is a targettable value for $this->options['runtimes'].

I don't know if the test failures and PHPStan failures are related to this PR?

@nicolas-grekas nicolas-grekas merged commit b01d14a into symfony:8.1 May 15, 2026
9 of 12 checks passed
@nicolas-grekas nicolas-grekas deleted the runtime-fix branch May 15, 2026 13:01
@fabpot fabpot mentioned this pull request May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Runtime] SymfonyRuntime::getArgument breaks with $type = NULL due to SymfonyRuntime::resolveType being non-nullable

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.