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

Persistent attribute used for persistent controls does not allow params with control names #305

Closed
MartinMystikJonas opened this issue Jul 15, 2022 · 0 comments

Comments

@MartinMystikJonas
Copy link

Version: 3.1.7

Bug Description

When we use attributte for persistent component

#[Persistent('control')]
class ControlTestCasePresenter extends Presenter {

PHPStan complains

Attribute class Nette\Application\Attributes\Persistent does not have a constructor and must be instantiated without any parameters.

Attributte Nette\Application\Attributes\Persistent indeed does not have a constructor.

Expected Behavior

No error

Possible Solution

Add constructor to Nette\Application\Attributes\Persistent that saves components names

public $names;

public function __construct(...$names)
	{
		$this->names = $names;
	}

Should I prepare PR?

@MartinMystikJonas MartinMystikJonas changed the title PErsistent attribute used for persistent controls does not allow params with control names Persistent attribute used for persistent controls does not allow params with control names Jul 16, 2022
dg added a commit that referenced this issue Jan 17, 2023
@dg dg closed this as completed Jan 17, 2023
dg added a commit that referenced this issue Jan 17, 2023
dg added a commit that referenced this issue Jan 17, 2023
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

2 participants