Passed
Push — master ( 12242c...e9b436 )
by Iman
08:01
created

ViewNormalizer::checkViewExists()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Imanghafoori\HeyMan\WatchingStrategies\Views;
4
5
final class ViewNormalizer
6
{
7
    /**
8
     * @param $views
9
     *
10
     * @return array
11
     */
12
    public function normalizeView(array $views): array
13
    {
14
        array_walk($views, function ($view) {
15
            $this->checkViewExists($view);
16
        });
17
18
        return $views;
19
    }
20
21
    private function checkViewExists($view)
22
    {
23
        if (strpos($view, '*') === false) {
24
            view()->getFinder()->find($view);
25
        }
26
    }
27
}
28