1 | <?php |
||
14 | class RequiredParameter extends DefaultReference { |
||
15 | private $parameter; |
||
16 | private $function; |
||
17 | |||
18 | /** |
||
19 | * RequiredParameter constructor. |
||
20 | * |
||
21 | * @param \ReflectionParameter $param The required parameter. |
||
22 | */ |
||
23 | 5 | public function __construct(\ReflectionParameter $param) { |
|
24 | 5 | parent::__construct($param->getClass() ? $param->getClass()->name : ''); |
|
25 | |||
26 | 5 | $this->parameter = $param->name; |
|
27 | 5 | $this->function = ($param->getDeclaringClass() ? $param->getDeclaringClass()->name.'::' : ''). |
|
28 | 5 | $param->getDeclaringFunction()->name.'()'; |
|
29 | 5 | } |
|
30 | |||
31 | |||
32 | /** |
||
33 | * Get the name. |
||
34 | * |
||
35 | * @return string Returns the name. |
||
36 | */ |
||
37 | public function getParameter() { |
||
40 | |||
41 | /** |
||
42 | * Get the function. |
||
43 | * |
||
44 | * @return string Returns the function. |
||
45 | */ |
||
46 | public function getFunction() { |
||
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | * |
||
53 | * @throws MissingArgumentException Always throws an exception. |
||
54 | */ |
||
55 | 2 | public function resolve(Container $container, $_ = null) { |
|
58 | } |
||
59 |
This check marks parameter names that have not been written in camelCase.
In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes
databaseConnectionString
.