Passed
Pull Request — master (#2)
by tsms
01:30
created

Textual::prevDayName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/* vim: set expandtab tabstop=4 shiftwidth=4: */
3
4
/**
5
 * Contains the Calendar_Decorator_Wrapper class
6
 *
7
 * PHP versions 4 and 5
8
 *
9
 * LICENSE: Redistribution and use in source and binary forms, with or without
10
 * modification, are permitted provided that the following conditions are met:
11
 * 1. Redistributions of source code must retain the above copyright
12
 *    notice, this list of conditions and the following disclaimer.
13
 * 2. Redistributions in binary form must reproduce the above copyright
14
 *    notice, this list of conditions and the following disclaimer in the
15
 *    documentation and/or other materials provided with the distribution.
16
 * 3. The name of the author may not be used to endorse or promote products
17
 *    derived from this software without specific prior written permission.
18
 *
19
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
20
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22
 * IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY
23
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 *
30
 * @category  Date and Time
31
 * @package   Calendar
32
 * @author    Harry Fuecks <[email protected]>
33
 * @author    Lorenzo Alberton <[email protected]>
34
 * @copyright 2003-2007 Harry Fuecks, Lorenzo Alberton
35
 * @license   http://www.debian.org/misc/bsd.license  BSD License (3 Clause)
36
 * @version   CVS: $Id$
37
 * @link      http://pear.php.net/package/Calendar
38
 */
39
namespace Pear\Calendar\Decorator;
40
41
use Pear\Calendar\Decorator;
42
43
/**
44
 * Decorator to help with fetching textual representations of months and
45
 * days of the week.
46
 * <b>Note:</b> for performance you should prefer Calendar_Util_Textual unless you
47
 * have a specific need to use a decorator
48
 *
49
 * @category  Date and Time
50
 * @package   Calendar
51
 * @author    Harry Fuecks <[email protected]>
52
 * @author    Lorenzo Alberton <[email protected]>
53
 * @copyright 2003-2007 Harry Fuecks, Lorenzo Alberton
54
 * @license   http://www.debian.org/misc/bsd.license  BSD License (3 Clause)
55
 * @link      http://pear.php.net/package/Calendar
56
 * @access    public
57
 */
58
class Textual extends Decorator
59
{
60
    /**
61
     * Constructs Calendar_Decorator_Textual
62
     *
63
     * @param object &$Calendar subclass of Calendar
64
     *
65
     * @access public
66
     */
67
    function __construct(&$Calendar)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
68
    {
69
        parent::__construct($Calendar);
70
    }
71
72
    /**
73
     * Returns an array of 12 month names (first index = 1)
74
     *
75
     * @param string $format (optional) format of returned months (one|two|short|long)
76
     *
77
     * @return array
78
     * @access public
79
     * @static
80
     */
81
    function monthNames($format = 'long')
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
82
    {
83
        return \Pear\Calendar\Util\Textual::monthNames($format);
0 ignored issues
show
Bug Best Practice introduced by
The method Pear\Calendar\Util\Textual::monthNames() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

83
        return \Pear\Calendar\Util\Textual::/** @scrutinizer ignore-call */ monthNames($format);
Loading history...
84
    }
85
86
    /**
87
     * Returns an array of 7 week day names (first index = 0)
88
     *
89
     * @param string $format (optional) format of returned days (one|two|short|long)
90
     *
91
     * @return array
92
     * @access public
93
     * @static
94
     */
95
    function weekdayNames($format = 'long')
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
96
    {
97
        return \Pear\Calendar\Util\Textual::weekdayNames($format);
0 ignored issues
show
Bug Best Practice introduced by
The method Pear\Calendar\Util\Textual::weekdayNames() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

97
        return \Pear\Calendar\Util\Textual::/** @scrutinizer ignore-call */ weekdayNames($format);
Loading history...
98
    }
99
100
    /**
101
     * Returns textual representation of the previous month of the decorated calendar object
102
     *
103
     * @param string $format (optional) format of returned months (one|two|short|long)
104
     *
105
     * @return string
106
     * @access public
107
     */
108
    function prevMonthName($format = 'long')
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
109
    {
110
        return \Pear\Calendar\Util\Textual::prevMonthName($this->calendar, $format);
0 ignored issues
show
Bug Best Practice introduced by
The method Pear\Calendar\Util\Textual::prevMonthName() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

110
        return \Pear\Calendar\Util\Textual::/** @scrutinizer ignore-call */ prevMonthName($this->calendar, $format);
Loading history...
111
    }
112
113
    /**
114
     * Returns textual representation of the month of the decorated calendar object
115
     *
116
     * @param string $format (optional) format of returned months (one|two|short|long)
117
     *
118
     * @return string
119
     * @access public
120
     */
121
    function thisMonthName($format = 'long')
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
122
    {
123
        return \Pear\Calendar\Util\Textual::thisMonthName($this->calendar, $format);
0 ignored issues
show
Bug Best Practice introduced by
The method Pear\Calendar\Util\Textual::thisMonthName() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

123
        return \Pear\Calendar\Util\Textual::/** @scrutinizer ignore-call */ thisMonthName($this->calendar, $format);
Loading history...
124
    }
125
126
    /**
127
     * Returns textual representation of the next month of the decorated calendar object
128
     *
129
     * @param string $format (optional) format of returned months (one|two|short|long)
130
     *
131
     * @return string
132
     * @access public
133
     */
134
    function nextMonthName($format = 'long')
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
135
    {
136
        return \Pear\Calendar\Util\Textual::nextMonthName($this->calendar, $format);
0 ignored issues
show
Bug Best Practice introduced by
The method Pear\Calendar\Util\Textual::nextMonthName() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

136
        return \Pear\Calendar\Util\Textual::/** @scrutinizer ignore-call */ nextMonthName($this->calendar, $format);
Loading history...
137
    }
138
139
    /**
140
     * Returns textual representation of the previous day of week of the decorated calendar object
141
     *
142
     * @param string $format (optional) format of returned months (one|two|short|long)
143
     *
144
     * @return string
145
     * @access public
146
     */
147
    function prevDayName($format = 'long')
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
148
    {
149
        return \Pear\Calendar\Util\Textual::prevDayName($this->calendar, $format);
0 ignored issues
show
Bug Best Practice introduced by
The method Pear\Calendar\Util\Textual::prevDayName() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

149
        return \Pear\Calendar\Util\Textual::/** @scrutinizer ignore-call */ prevDayName($this->calendar, $format);
Loading history...
150
    }
151
152
    /**
153
     * Returns textual representation of the day of week of the decorated calendar object
154
     *
155
     * @param string $format (optional) format of returned months (one|two|short|long)
156
     *
157
     * @return string
158
     * @access public
159
     */
160
    function thisDayName($format = 'long')
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
161
    {
162
        return \Pear\Calendar\Util\Textual::thisDayName($this->calendar, $format);
0 ignored issues
show
Bug Best Practice introduced by
The method Pear\Calendar\Util\Textual::thisDayName() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

162
        return \Pear\Calendar\Util\Textual::/** @scrutinizer ignore-call */ thisDayName($this->calendar, $format);
Loading history...
163
    }
164
165
    /**
166
     * Returns textual representation of the next day of week of the decorated calendar object
167
     *
168
     * @param string $format (optional) format of returned months (one|two|short|long)
169
     *
170
     * @return string
171
     * @access public
172
     */
173
    function nextDayName($format = 'long')
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
174
    {
175
        return \Pear\Calendar\Util\Textual::nextDayName($this->calendar, $format);
0 ignored issues
show
Bug Best Practice introduced by
The method Pear\Calendar\Util\Textual::nextDayName() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

175
        return \Pear\Calendar\Util\Textual::/** @scrutinizer ignore-call */ nextDayName($this->calendar, $format);
Loading history...
176
    }
177
178
    /**
179
     * Returns the days of the week using the order defined in the decorated
180
     * calendar object. Only useful for Calendar_Month_Weekdays, Calendar_Month_Weeks
181
     * and Calendar_Week. Otherwise the returned array will begin on Sunday
182
     *
183
     * @param string $format (optional) format of returned months (one|two|short|long)
184
     *
185
     * @return array ordered array of week day names
186
     * @access public
187
     */
188
    function orderedWeekdays($format = 'long')
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
189
    {
190
        return \Pear\Calendar\Util\Textual::orderedWeekdays($this->calendar, $format);
0 ignored issues
show
Bug Best Practice introduced by
The method Pear\Calendar\Util\Textual::orderedWeekdays() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

190
        return \Pear\Calendar\Util\Textual::/** @scrutinizer ignore-call */ orderedWeekdays($this->calendar, $format);
Loading history...
191
    }
192
}
193