Skip to content

nette/php-generator support of property hooks is missing in our implementation #866

@gturpin-dev

Description

@gturpin-dev

Tempest Version

dev-main

PHP Version

8.4

Operating System

Windows

Description

Working with make commands or in general with the nette/php-generator wrapper from Tempest ( in ClassManipulator for example ).
And notice that it does not transform properly the property hooks.

Just looking this blog post to check that they support them https://blog.nette.org/en/php-generator-brings-the-power-of-php-8-4
So I think we need to update the SimplifiesClassNames::simplifyClassNames or something like that to determine that a given class has property hooks and then don't try to alter them 🤷

Steps to Reproduce

Hard to say, but in my case having a class like this

final class MigrationStub implements DatabaseMigration
{
    public string $name {
        get => 'dummy-date_dummy-table-name';
    }
}

Gives this code

public string $name {
    get {
    }
}

The code is run through abstractions but the main instructions are those ones :

$classManipulator = (new ClassManipulator($stubFile->filePath))
    ->setNamespace($namespace)
    ->setClassName($classname);
$classManipulator->save($targetPath);

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions