Passed
Branch master (7e2aaa)
by Revin
02:14
created

FontAwesome   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 80%

Importance

Changes 12
Bugs 1 Features 3
Metric Value
wmc 4
c 12
b 1
f 3
lcom 0
cbo 2
dl 0
loc 79
ccs 8
cts 10
cp 0.8
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A i() 0 4 1
A s() 0 4 1
A icon() 0 4 1
A stack() 0 4 1
1
<?php
2
/**
3
 * FontAwesome.php
4
 * @author Revin Roman
5
 * @link https://rmrevin.ru
6
 */
7
8
namespace rmrevin\yii\fontawesome;
9
10
use rmrevin\yii\fontawesome\component;
11
12
/**
13
 * Class FA
14
 * @package rmrevin\yii\fontawesome
15
 */
16
class FontAwesome
17
{
18
19
    /** @var string CSS Class prefix */
20
    public static $cssPrefix = 'fa';
21
22
    /**
23
     * Creates an `Icon` component that can be used to FontAwesome html icon
24
     *
25
     * @param string $name
26
     * @param array $options
27
     * @return component\Icon
28
     */
29 4
    public static function icon($name, $options = [])
30
    {
31
        return new component\Icon($name, $options);
32 4
    }
33
34
    /**
35
     * Shortcut for `icon()` method
36
     * @see icon()
37
     *
38
     * @param string $name
39
     * @param array $options
40
     * @return component\Icon
41
     */
42 1
    public static function i($name, $options = [])
43
    {
44
        return static::icon($name, $options);
45 1
    }
46
47
    /**
48
     * Creates an `Stack` component that can be used to FontAwesome html icon
49
     *
50
     * @param array $options
51
     * @return component\Stack
52
     */
53 1
    public static function stack($options = [])
54
    {
55
        return new component\Stack($options);
56 1
    }
57
58
    /**
59
     * Shortcut for `stack()` method
60
     * @see stack()
61
     *
62
     * @param array $options
63
     * @return component\Stack
64
     */
65 1
    public static function s($options = [])
66
    {
67
        return static::stack($options);
68 1
    }
69
70
    /**
71
     * Size values
72
     * @see rmrevin\yii\fontawesome\component\Icon::size
73
     */
74
    const SIZE_LARGE = 'lg';
75
    const SIZE_2X = '2x';
76
    const SIZE_3X = '3x';
77
    const SIZE_4X = '4x';
78
    const SIZE_5X = '5x';
79
80
    /**
81
     * Rotate values
82
     * @see rmrevin\yii\fontawesome\component\Icon::rotate
83
     */
84
    const ROTATE_90 = '90';
85
    const ROTATE_180 = '180';
86
    const ROTATE_270 = '270';
87
88
    /**
89
     * Flip values
90
     * @see rmrevin\yii\fontawesome\component\Icon::flip
91
     */
92
    const FLIP_HORIZONTAL = 'horizontal';
93
    const FLIP_VERTICAL = 'vertical';
94
}
95