Month   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 17
rs 10
c 0
b 0
f 0
ccs 0
cts 5
cp 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getList() 0 7 2
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\Core\Lists;
13
14
use Xoops\Core\Locale\Punic\Calendar;
15
16
/**
17
 * Month - provide list of month names
18
 *
19
 * @category  Xoops\Core\Lists\Month
20
 * @package   Xoops\Core
21
 * @author    Richard Griffith <[email protected]>
22
 * @copyright 2015 XOOPS Project (http://xoops.org)/
23
 * @license   GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
24
 * @link      http://xoops.org
25
 */
26
class Month extends ListAbstract
27
{
28
    /**
29
     * Get a list of localized month names
30
     *
31
     * @param string $width The format name; it can be 'wide' (eg 'January'),
32
     *                      'abbreviated' (eg 'Jan') or 'narrow' (eg 'J').
33
     *
34
     * @return array
35
     */
36
    public static function getList($width = 'wide')
37
    {
38
        $months = array();
39
        for ($month = 1; $month <= 12; ++$month) {
40
            $months[$month] = Calendar::getMonthName($month, $width);
41
        }
42
        return $months;
43
    }
44
}
45