-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic support for new-in-initializer
- Loading branch information
1 parent
536889f
commit cb43a7f
Showing
6 changed files
with
151 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\PhpDocParser\Ast\ConstExpr; | ||
|
||
use PHPStan\PhpDocParser\Ast\NodeAttributes; | ||
use function implode; | ||
|
||
class ConstExprNewNode implements ConstExprNode | ||
{ | ||
|
||
use NodeAttributes; | ||
|
||
/** @var string */ | ||
public $class; | ||
|
||
/** @var ConstExprNode[] */ | ||
public $arguments; | ||
|
||
/** | ||
* @param ConstExprNode[] $arguments | ||
*/ | ||
public function __construct(string $class, array $arguments) | ||
{ | ||
$this->class = $class; | ||
$this->arguments = $arguments; | ||
} | ||
|
||
|
||
public function __toString(): string | ||
{ | ||
return 'new ' . $this->class . '(' . implode(', ', $this->arguments) . ')'; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters