Passed
Push — master ( 99eb02...369f6b )
by Iman
02:44
created

ViewSituations::checkViewExists()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Imanghafoori\HeyMan\WatchingStrategies\Views;
4
5
final class ViewSituations
6
{
7
    /**
8
     * @param $params
9
     *
10
     * @return mixed
11
     */
12
    public function normalize($method, $params)
0 ignored issues
show
Unused Code introduced by
The parameter $method is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

12
    public function normalize(/** @scrutinizer ignore-unused */ $method, $params)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
13
    {
14 21
        array_walk($params, function ($view) {
15 21
            $this->checkViewExists($view);
16 21
        });
17
18 20
        return [$params];
19
    }
20
21 21
    private function checkViewExists($view)
22
    {
23 21
        if (strpos($view, '*') === false) {
24 19
            view()->getFinder()->find($view);
25
        }
26 20
    }
27
}
28