Total Complexity | 6 |
Total Lines | 54 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
10 | class ViewSituations |
||
11 | { |
||
12 | use InputNormalizer; |
||
13 | |||
14 | private $chain; |
||
15 | |||
16 | /** |
||
17 | * HeyMan constructor. |
||
18 | * |
||
19 | * @param Chain $chain |
||
20 | */ |
||
21 | 19 | public function __construct(Chain $chain) |
|
22 | { |
||
23 | 19 | $this->chain = $chain; |
|
24 | 19 | } |
|
25 | |||
26 | /** |
||
27 | * @param array|string $views |
||
28 | * |
||
29 | * @return YouShouldHave |
||
30 | */ |
||
31 | 19 | public function whenYouMakeView(...$views): YouShouldHave |
|
32 | { |
||
33 | 19 | return $this->watchView($this->normalizeView($views)); |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * @param $views |
||
38 | * |
||
39 | * @return array |
||
40 | */ |
||
41 | 19 | private function normalizeView(array $views): array |
|
50 | } |
||
51 | |||
52 | 19 | private function checkViewExists($view) |
|
53 | { |
||
54 | 19 | if (strpos($view, '*') === false) { |
|
55 | 17 | view()->getFinder()->find($view); |
|
56 | } |
||
57 | 18 | } |
|
58 | |||
59 | 18 | private function watchView($view): YouShouldHave |
|
64 | } |
||
65 | } |
||
66 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..