Completed
Pull Request — master (#491)
by Richard
14:12 queued 03:48
created

Link::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 9.4285
ccs 4
cts 4
cp 1
crap 1
1
<?php
2
/*
3
 You may not change or alter any portion of this comment or credits
4
 of supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit authors.
6
7
 This program is distributed in the hope that it will be useful,
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
 */
11
12
namespace Xoops\Html\Menu;
13
14
/**
15
 * Link - a menu link
16
 *
17
 * @category  Xoops\Html\Menu
18
 * @package   Link
19
 * @author    Richard Griffith <[email protected]>
20
 * @copyright 2016 XOOPS Project (http://xoops.org)
21
 * @license   GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
22
 * @link      http://xoops.org
23
 */
24
class Link extends Item
25
{
26
    /**
27
     * __construct
28
     *
29
     * @param array $attributes array of attribute name => value pairs
30
     *
31
     * Expected attributes:
32
     *   'caption' - link caption (usually required)
33
     *   'link'    - link URL
34
     *   'icon'    - css classes for icon, i.e. "glyphicon glyphicon-ok"
35
     *   'image'   - image to represent link
36
     */
37 1
    public function __construct($attributes = array())
38
    {
39 1
        parent::__construct($attributes);
40 1
        $this->set('type', Item::TYPE_LINK);
41 1
    }
42
}
43