Skip to content

Commit

Permalink
added support for PHP 8.0 types mixed, static, false, null
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jun 8, 2020
1 parent 7caa089 commit 1a4a2e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/PhpGenerator/PhpNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ final class PhpNamespace

private const KEYWORDS = [
'string' => 1, 'int' => 1, 'float' => 1, 'bool' => 1, 'array' => 1, 'object' => 1,
'callable' => 1, 'iterable' => 1, 'void' => 1, 'self' => 1, 'parent' => 1,
'callable' => 1, 'iterable' => 1, 'void' => 1, 'self' => 1, 'parent' => 1, 'static' => 1,
'mixed' => 1, 'null' => 1, 'false' => 1,
];

/** @var string */
Expand Down
5 changes: 4 additions & 1 deletion src/PhpGenerator/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ class Type
CALLABLE = 'callable',
ITERABLE = 'iterable',
VOID = 'void',
MIXED = 'mixed',
FALSE = 'false',
NULL = 'null',
SELF = 'self',
PARENT = 'parent';
PARENT = 'parent',
STATIC = 'static';


public static function nullable(string $type, bool $state = true): string
Expand Down

0 comments on commit 1a4a2e5

Please sign in to comment.