Skip to content

Conversation

@pjotrvdh
Copy link

I like to use a named binding from a container. This works properly, but PHPStan is complaining.
The property type of container make method accepts strings

@pjotrvdh
Copy link
Author

I've checked the failed check, but I don't understand why it fails. because the template is actually used as far as I can tell.

@shaedrich
Copy link
Contributor

I've checked the failed check, but I don't understand why it fails. because the template is actually used as far as I can tell.

Looks like a PHPStan bug 🤔 Have you tried swapping the order in the union?

@pjotrvdh
Copy link
Author

pjotrvdh commented Nov 11, 2025

Looks like a PHPStan bug 🤔 Have you tried swapping the order in the union?

Yes, just now but with no success, sadly.

@shaedrich
Copy link
Contributor

Too bad

@taylorotwell
Copy link
Member

I have no idea how to fix that error. 🙃

@taylorotwell taylorotwell marked this pull request as draft November 11, 2025 14:19
@pjotrvdh
Copy link
Author

Changing the generic variant class-string<T> to the regular class-string seems to resolve the PHPStan error.
I don’t think it’s necessary to use the generic variant for this class.

@pjotrvdh pjotrvdh marked this pull request as ready for review November 11, 2025 15:21
@shaedrich
Copy link
Contributor

But that makes class-string|string redundant, as string fully includes class-string

@taylorotwell taylorotwell marked this pull request as draft November 11, 2025 22:41
@pjotrvdh
Copy link
Author

But that makes class-string|string redundant, as string fully includes class-string

You're right, I've updated the PR accordingly

@pjotrvdh pjotrvdh marked this pull request as ready for review November 12, 2025 11:30
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.

3 participants