Skip to content

PHP8.4 support #6701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class CollectionImpl implements CollectionInterface
{
public function getData(string $var = null)
public function getData(?string $var = null)
{
echo $var ?? 'fallback';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

interface ParserInterface
{
public function parse($code, \PhpParser\ErrorHandler $errorHandler = null);
public function parse($code, ?\PhpParser\ErrorHandler $errorHandler = null);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

trait Foo
{
public function load($resource, string $type = null): string
public function load($resource, ?string $type = null): string
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static function fun($surname, string $name)
{
}

public function withDefaultNull(string $name = null)
public function withDefaultNull(?string $name = null)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/PhpParser/NodeTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private function splitMessageAndArgs(FuncCall $sprintfFuncCall): ?SprintfStringA
*/
private function splitBySpace(string $value): array
{
$value = str_getcsv($value, ' ');
$value = str_getcsv($value, ' ', escape: '\\');

return array_filter($value);
}
Expand Down
Loading