MessageParameterReflection.php
| 1 | <?php |
| 2 | |
| 3 | namespace Give\PHPStan\Log\Parameters; |
| 4 | |
| 5 | use PHPStan\Reflection\ParameterReflection; |
| 6 | use PHPStan\Reflection\PassedByReference; |
| 7 | use PHPStan\Type\StringType; |
| 8 | use PHPStan\Type\Type; |
| 9 | |
| 10 | /** |
| 11 | * Adds support for the \Give\Log\Log::$message parameter reflection to the MagicCallStaticMethodReflection |
| 12 | * |
| 13 | * @unreleased |
| 14 | */ |
| 15 | class MessageParameterReflection implements ParameterReflection |
| 16 | { |
| 17 | public function getName(): string |
| 18 | { |
| 19 | return 'message'; |
| 20 | } |
| 21 | |
| 22 | public function isOptional(): bool |
| 23 | { |
| 24 | return false; |
| 25 | } |
| 26 | |
| 27 | public function getType(): Type |
| 28 | { |
| 29 | return new StringType(); |
| 30 | } |
| 31 | |
| 32 | public function passedByReference(): PassedByReference |
| 33 | { |
| 34 | return PassedByReference::createNo(); |
| 35 | } |
| 36 | |
| 37 | public function isVariadic(): bool |
| 38 | { |
| 39 | return false; |
| 40 | } |
| 41 | |
| 42 | public function getDefaultValue(): ?\PHPStan\Type\Type |
| 43 | { |
| 44 | return null; |
| 45 | } |
| 46 | } |
| 47 |