These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * This file is part of Railt package. |
||
4 | * |
||
5 | * For the full copyright and license information, please view the LICENSE |
||
6 | * file that was distributed with this source code. |
||
7 | */ |
||
8 | declare(strict_types=1); |
||
9 | |||
10 | namespace Railt\Reflection\Definition\Dependent; |
||
11 | |||
12 | use Railt\Reflection\Contracts\Definition\Dependent\ArgumentDefinition as ArgumentDefinitionInterface; |
||
13 | use Railt\Reflection\Contracts\Definition\TypeDefinition; |
||
14 | use Railt\Reflection\Contracts\Type as TypeInterface; |
||
15 | use Railt\Reflection\Definition\Behaviour\HasDefaultValue; |
||
16 | use Railt\Reflection\Definition\Behaviour\HasTypeIndication; |
||
17 | use Railt\Reflection\Type; |
||
18 | |||
19 | /** |
||
20 | * Class ArgumentDefinition |
||
21 | */ |
||
22 | View Code Duplication | class ArgumentDefinition extends AbstractDependentTypeDefinition implements ArgumentDefinitionInterface |
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
23 | { |
||
24 | use HasTypeIndication; |
||
25 | use HasDefaultValue; |
||
26 | |||
27 | /** |
||
28 | * ArgumentDefinition constructor. |
||
29 | * @param TypeDefinition $parent |
||
30 | * @param string $name |
||
31 | * @param string $type |
||
32 | */ |
||
33 | 9 | public function __construct(TypeDefinition $parent, string $name, string $type) |
|
34 | { |
||
35 | 9 | parent::__construct($parent, $name); |
|
36 | |||
37 | 9 | $this->withTypeDefinition($type); |
|
38 | 9 | } |
|
39 | |||
40 | /** |
||
41 | * @return TypeInterface |
||
42 | */ |
||
43 | public static function getType(): TypeInterface |
||
44 | { |
||
45 | return Type::of(Type::ARGUMENT); |
||
46 | } |
||
47 | } |
||
48 |