ViewHelper::isViewClass()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 3
nc 3
nop 1
crap 12
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://github.com/flipboxfactory/craft-ember/blob/master/LICENSE
6
 * @link       https://github.com/flipboxfactory/craft-ember
7
 */
8
9
namespace flipbox\craft\ember\helpers;
10
11
use flipbox\craft\ember\views\ViewInterface;
12
13
/**
14
 * @author Flipbox Factory <[email protected]>
15
 * @since 2.0.0
16
 */
17
class ViewHelper
18
{
19
    /**
20
     * @param $view
21
     * @return bool
22
     */
23
    public static function isView($view)
24
    {
25
        return $view instanceof ViewInterface;
26
    }
27
28
    /**
29
     * @param $view
30
     * @return bool
31
     */
32
    public static function isViewClass($view)
33
    {
34
        return is_string($view) && (is_subclass_of($view, ViewInterface::class) || $view instanceof ViewInterface);
35
    }
36
}
37