-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
134 additions
and
3 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
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,17 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\PhpDocParser\Ast\Type; | ||
|
||
use PHPStan\PhpDocParser\Ast\NodeAttributes; | ||
|
||
final class StarProjectionNode implements TypeNode | ||
{ | ||
|
||
use NodeAttributes; | ||
|
||
public function __toString(): string | ||
{ | ||
return '*'; | ||
} | ||
|
||
} |
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,33 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\PhpDocParser\Ast\Type; | ||
|
||
use PHPStan\PhpDocParser\Ast\NodeAttributes; | ||
|
||
class TypeProjectionNode implements TypeNode | ||
{ | ||
|
||
use NodeAttributes; | ||
|
||
/** @var TypeNode */ | ||
public $type; | ||
|
||
/** @var 'covariant'|'contravariant' */ | ||
public $variance; | ||
|
||
/** | ||
* @param 'covariant'|'contravariant' $variance | ||
*/ | ||
public function __construct(TypeNode $type, string $variance) | ||
{ | ||
$this->type = $type; | ||
$this->variance = $variance; | ||
} | ||
|
||
|
||
public function __toString(): string | ||
{ | ||
return $this->variance . ' ' . $this->type; | ||
} | ||
|
||
} |
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