Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use property typed by some class for persistent parameters #241

Closed
SendiMyrkr opened this issue Dec 8, 2019 · 0 comments
Closed

Comments

@SendiMyrkr
Copy link

Version: v3.0.2

Bug Description

Persistent parameters doesn't work in PHP 7.4 when i set some class type on property.

Steps To Reproduce

class SomePresenter extends Presenter {
	/** @var SomeClass @persistent */
	public SomeClass $prop;
}

Then you get exception:

Value passed to persistent parameter 'prop' in presenter Homepage must be SomeClass, SomeClass given.

Expected Behavior

Correctly process class type on property with @persistent

Possible Solution

Problem is here:
https://github.com/nette/application/blob/master/src/Application/UI/Component.php#L145

Third parameter is missing when required type is class.

I guess that solution should be adding 'isClass' to $meta array in here and than put it as third parameter to convertType
https://github.com/nette/application/blob/master/src/Application/UI/ComponentReflection.php#L53

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

No branches or pull requests

1 participant