Total Complexity | 6 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Coverage | 0% |
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 | public function __construct(Chain $chain) |
||
22 | { |
||
23 | $this->chain = $chain; |
||
24 | } |
||
25 | /** |
||
26 | * @param array|string $views |
||
27 | * |
||
28 | * @return YouShouldHave |
||
29 | */ |
||
30 | public function whenYouMakeView(...$views): YouShouldHave |
||
31 | { |
||
32 | return $this->watchView($this->normalizeView($views)); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @param $views |
||
37 | * |
||
38 | * @return array |
||
39 | */ |
||
40 | private function normalizeView(array $views): array |
||
49 | } |
||
50 | |||
51 | private function checkViewExists($view) |
||
52 | { |
||
53 | if (strpos($view, '*') === false) { |
||
54 | view()->getFinder()->find($view); |
||
55 | } |
||
56 | } |
||
57 | |||
58 | private function watchView($view): YouShouldHave |
||
63 | } |
||
64 | } |
||
65 |
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..