Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function getArguments(string $mailableClass) |
||
33 | { |
||
34 | $parameters = (new ReflectionClass($mailableClass)) |
||
35 | ->getConstructor() |
||
36 | ->getParameters(); |
||
37 | |||
38 | return collect($parameters) |
||
39 | ->map(function (ReflectionParameter $reflectionParameter) { |
||
40 | |||
41 | return $this->argumentValueProvider->getValue( |
||
42 | $reflectionParameter->getName(), |
||
43 | $reflectionParameter->getType()->getName() |
||
44 | ); |
||
45 | }); |
||
46 | } |
||
47 | } |
||
48 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: