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\Adapters\Webonyx\Builders; |
11
|
|
|
|
12
|
|
|
use Railt\Adapters\Webonyx\Registry; |
13
|
|
|
use Railt\Reflection\Contracts\Dependent\Argument\HasArguments; |
|
|
|
|
14
|
|
|
use Railt\Reflection\Contracts\Dependent\ArgumentDefinition as ReflectionArgument; |
|
|
|
|
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @property ReflectionArgument $reflection |
18
|
|
|
*/ |
19
|
|
|
class ArgumentBuilder extends DependentDefinitionBuilder |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* @param HasArguments $type |
23
|
|
|
* @param Registry $registry |
24
|
|
|
* @return array |
25
|
|
|
* @throws \InvalidArgumentException |
26
|
|
|
*/ |
27
|
|
|
public static function buildArguments(HasArguments $type, Registry $registry): array |
28
|
|
|
{ |
29
|
|
|
$result = []; |
30
|
|
|
|
31
|
|
|
foreach ($type->getArguments() as $argument) { |
32
|
|
|
$result[$argument->getName()] = (new static($argument, $registry))->build(); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
return $result; |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @return array |
40
|
|
|
* @throws \InvalidArgumentException |
41
|
|
|
*/ |
42
|
|
|
public function build(): array |
43
|
|
|
{ |
44
|
|
|
$config = [ |
45
|
|
|
'name' => $this->reflection->getName(), |
46
|
|
|
'description' => $this->reflection->getDescription(), |
47
|
|
|
'type' => $this->buildType(), |
48
|
|
|
]; |
49
|
|
|
|
50
|
|
|
if ($this->reflection->isDeprecated()) { |
51
|
|
|
$config['deprecationReason'] = $this->reflection->getDeprecationReason(); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
if ($this->reflection->hasDefaultValue()) { |
55
|
|
|
$config['defaultValue'] = $this->reflection->getDefaultValue(); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
return $config; |
59
|
|
|
} |
60
|
|
|
} |
61
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths