Completed
Push — master ( 23e282...478907 )
by Revin
02:44
created

FontAwesome   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 88
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 13
Bugs 1 Features 4
Metric Value
wmc 5
c 13
b 1
f 4
lcom 0
cbo 3
dl 0
loc 88
ccs 10
cts 10
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A icon() 0 4 1
A i() 0 4 1
A stack() 0 4 1
A s() 0 4 1
A ul() 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 9
    public static function icon($name, $options = [])
30
    {
31 9
        return new component\Icon($name, $options);
32
    }
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 1
        return static::icon($name, $options);
45
    }
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 3
    public static function stack($options = [])
54
    {
55 3
        return new component\Stack($options);
56
    }
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 1
        return static::stack($options);
68
    }
69
70
    /**
71
     * @param array $options
72
     * @return component\UnorderedList
73
     */
74 2
    public static function ul($options = [])
75
    {
76 2
        return new component\UnorderedList($options);
77
    }
78
79
    /**
80
     * Size values
81
     * @see rmrevin\yii\fontawesome\component\Icon::size
82
     */
83
    const SIZE_LARGE = 'lg';
84
    const SIZE_2X = '2x';
85
    const SIZE_3X = '3x';
86
    const SIZE_4X = '4x';
87
    const SIZE_5X = '5x';
88
89
    /**
90
     * Rotate values
91
     * @see rmrevin\yii\fontawesome\component\Icon::rotate
92
     */
93
    const ROTATE_90 = '90';
94
    const ROTATE_180 = '180';
95
    const ROTATE_270 = '270';
96
97
    /**
98
     * Flip values
99
     * @see rmrevin\yii\fontawesome\component\Icon::flip
100
     */
101
    const FLIP_HORIZONTAL = 'horizontal';
102
    const FLIP_VERTICAL = 'vertical';
103
}
104