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 24f7283
Showing
4 changed files
with
72 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,70 @@ | ||
<?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; | ||
|
||
/** @var Type|null */ | ||
private $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