1: <?php declare(strict_types=1);
2:
3: namespace Salient\Core\Reflection;
4:
5: /**
6: * @api
7: */
8: final class ParameterIndex
9: {
10: /**
11: * An array that maps normalised names to declared names for parameters
12: *
13: * @var array<string,string>
14: */
15: public array $Names;
16:
17: /**
18: * An array that maps declared names to positions (0-based) for parameters
19: *
20: * @var array<string,int>
21: */
22: public array $Positions;
23:
24: /**
25: * A list of default values for non-variadic parameters
26: *
27: * For parameters where no default value is available, `null` is applied.
28: *
29: * @var list<mixed>
30: */
31: public array $DefaultArguments;
32:
33: /**
34: * An array that maps normalised names to declared names for parameters that
35: * do not accept null values
36: *
37: * @var array<string,string>
38: */
39: public array $NotNullable;
40:
41: /**
42: * An array that maps normalised names to declared names for parameters that
43: * are not optional and do not accept null values
44: *
45: * @var array<string,string>
46: */
47: public array $Required;
48:
49: /**
50: * An array that maps normalised names to declared names for parameters that
51: * are passed by reference
52: *
53: * @var array<string,string>
54: */
55: public array $PassedByReference;
56:
57: /**
58: * An array that maps normalised names to declared names for date parameters
59: *
60: * @var array<string,string>
61: */
62: public array $Date;
63:
64: /**
65: * An array that maps normalised names to types for parameters with a
66: * built-in type
67: *
68: * @var array<string,string>
69: */
70: public array $BuiltinTypes;
71:
72: /**
73: * An array that maps normalised names to class names for parameters that
74: * accept a service
75: *
76: * @var array<string,class-string>
77: */
78: public array $Services;
79:
80: /**
81: * The minimum number of arguments that must be given
82: */
83: public int $RequiredArgumentCount;
84:
85: /**
86: * @internal
87: *
88: * @param array<string,string> $names
89: * @param array<string,int> $positions
90: * @param list<mixed> $defaultArguments
91: * @param array<string,string> $notNullable
92: * @param array<string,string> $required
93: * @param array<string,string> $passedByReference
94: * @param array<string,string> $date
95: * @param array<string,string> $builtinTypes
96: * @param array<string,class-string> $services
97: */
98: public function __construct(
99: array $names,
100: array $positions,
101: array $defaultArguments,
102: array $notNullable,
103: array $required,
104: array $passedByReference,
105: array $date,
106: array $builtinTypes,
107: array $services,
108: int $requiredArgumentCount
109: ) {
110: $this->Names = $names;
111: $this->Positions = $positions;
112: $this->DefaultArguments = $defaultArguments;
113: $this->NotNullable = $notNullable;
114: $this->Required = $required;
115: $this->PassedByReference = $passedByReference;
116: $this->Date = $date;
117: $this->BuiltinTypes = $builtinTypes;
118: $this->Services = $services;
119: $this->RequiredArgumentCount = $requiredArgumentCount;
120: }
121: }
122: