You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I just ran into a related issue. Pint doesn't support assymetric visibility.
<?php
namespace App\Dtos;
use App\Constants\PostFilter;
use App\Constants\PostOrder;
use Illuminate\Http\Request;
class GetPostsDto
{
public private(set) string $searchTerm;
public private(set) string $order;
public private(set) string $filter;
public private(set) int $pageNumber;
public function __construct(Request $request)
{
$this->searchTerm = (string) $request->input('search');
$this->order = (string) $request->input('order', PostOrder::RECENT);
$this->filter = (string) $request->input('filter', PostFilter::PUBLISHED);
$this->pageNumber = (int) $request->input('page', 1);
}
}
Pint fails this file with Fatal error: Multiple access type modifiers are not allowed on line 13.
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:
Run pint on the file.
The text was updated successfully, but these errors were encountered: