Persistent attribute used for persistent controls does not allow params with control names
MartinMystikJonas opened this issue · comments
Martin Mystik Jonáš commented
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?