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

ViewSituations::normalize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
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