Skip to content

Add support for PHP 8.4 private(set) visibility modifier #368

Closed
@HGtronic

Description

@HGtronic

Pint Version

1.22

PHP Version

8.4

Description

The package currently fails to parse code that uses the new private(set) visibility modifier introduced in PHP 8.4. This results in the following error
Parse error: syntax error, unexpected token "private(set)" on line 10

Steps To Reproduce

Use the following code snippet in a project:

final readonly class AddressDTO
{
    public function __construct(
        private(set) ?string $country = null,
        private(set) ?string $state = null,
        private(set) ?string $street = null,
        private(set) ?string $number = null,
        private(set) ?string $zip = null
    ) {}
}

Run pint on the file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions