-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite in backward compatibility compliant way
- Loading branch information
1 parent
748eaac
commit bca5b04
Showing
4 changed files
with
71 additions
and
16 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,69 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\Reflection\Doctrine; | ||
|
||
use PHPStan\Reflection\ParameterReflection; | ||
use PHPStan\Reflection\PassedByReference; | ||
use PHPStan\Type\Type; | ||
|
||
class DummyParameter implements ParameterReflection | ||
{ | ||
|
||
/** @var string */ | ||
private $name; | ||
|
||
/** @var Type */ | ||
private $type; | ||
|
||
/** @var bool */ | ||
private $optional; | ||
|
||
/** @var PassedByReference */ | ||
private $passedByReference; | ||
|
||
/** @var bool */ | ||
private $variadic; | ||
|
||
private ?\PHPStan\Type\Type $defaultValue; | ||
|
||
public function __construct(string $name, Type $type, bool $optional, ?PassedByReference $passedByReference, bool $variadic, ?Type $defaultValue) | ||
{ | ||
$this->name = $name; | ||
$this->type = $type; | ||
$this->optional = $optional; | ||
$this->passedByReference = $passedByReference ?? PassedByReference::createNo(); | ||
$this->variadic = $variadic; | ||
$this->defaultValue = $defaultValue; | ||
} | ||
|
||
public function getName(): string | ||
{ | ||
return $this->name; | ||
} | ||
|
||
public function isOptional(): bool | ||
{ | ||
return $this->optional; | ||
} | ||
|
||
public function getType(): Type | ||
{ | ||
return $this->type; | ||
} | ||
|
||
public function passedByReference(): PassedByReference | ||
{ | ||
return $this->passedByReference; | ||
} | ||
|
||
public function isVariadic(): bool | ||
{ | ||
return $this->variadic; | ||
} | ||
|
||
public function getDefaultValue(): ?Type | ||
{ | ||
return $this->defaultValue; | ||
} | ||
|
||
} |
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