ViewSituations::checkViewExists()   A
last analyzed

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\Plugins\WatchingStrategies\Views;
4
5
final class ViewSituations
6
{
7
    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

7
    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...
8
    {
9 21
        array_walk($params, function ($view) {
10 21
            $this->checkViewExists($view);
11 21
        });
12
13 20
        return [$params];
14
    }
15
16 21
    private function checkViewExists($view)
17
    {
18 21
        if (strpos($view, '*') === false) {
19 19
            view()->getFinder()->find($view);
20
        }
21 20
    }
22
}
23