ViewHelper   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 20
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isView() 0 4 1
A isViewClass() 0 4 3
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