Skip to content

Cannot access private property Nette\PhpGenerator\ClassType::$methods on Nette 3.1 #16

@theo1024

Description

@theo1024

After upgrade to newer version of Nette 3.1 (on PHP 8.2) starts to appear this error message:

Error
Cannot access private property Nette\PhpGenerator\ClassType]::$methods

File: [.../vendor/olicek/form-selectize/src/SelectizeExtension.php:46]

36: // $builder = $this->getContainerBuilder();
37: // $builder->addDefinition($this->prefix('selectize'))
38: // ->setClass('\App\Form\Control\Selectize');
39: // }
40:
41:
42: public function afterCompile(Code\ClassType $class)
43: {
44: parent::afterCompile($class);
45:
46: $init = $class->methods['initialize'];
47: $config = $this->getConfig($this->defaults);
48: $init->addBody('\App\Form\Control\Selectize::register(?, ?);', ['addSelectize', $config]);
49: }

Nette\PhpGenerator class has changed a lot and doesn't have any $methods property anymore, so this doesn't work.
Is it possible to fix this, or is there any workaround (like manual register of component in Bootstrap class)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions