1 | <?php |
||
8 | class Weekday |
||
9 | { |
||
10 | /** |
||
11 | * The weekday instance. |
||
12 | * |
||
13 | * @var \ChinLeung\Weekday\Weekday |
||
14 | */ |
||
15 | protected $instance; |
||
16 | |||
17 | /** |
||
18 | * Constructor of the class. |
||
19 | * |
||
20 | * @param \ChinLeung\Weekday\Weekday $instance |
||
21 | */ |
||
22 | public function __construct(PhpWeekday $instance = null) |
||
26 | |||
27 | /** |
||
28 | * Forward the call to the Weekday instance. |
||
29 | * |
||
30 | * @param string $method |
||
31 | * @param array $arguments |
||
32 | * @return mixed |
||
33 | */ |
||
34 | public function __call($method, $arguments) |
||
38 | |||
39 | /** |
||
40 | * Retrieve the Weekday instance. |
||
41 | * |
||
42 | * @return \ChinLeung\Weekday\Weekday |
||
43 | */ |
||
44 | public function getInstance() : PhpWeekday |
||
48 | |||
49 | /** |
||
50 | * Retrieve the locale. |
||
51 | * |
||
52 | * @param string|null $locale |
||
53 | * @return string |
||
54 | */ |
||
55 | private function locale(?string $locale) : string |
||
59 | |||
60 | /** |
||
61 | * Retrieve the name of a weekday. |
||
62 | * |
||
63 | * @param int $value |
||
64 | * @param string $locale |
||
65 | * @return string |
||
66 | */ |
||
67 | public function name(int $value, string $locale = null) : string |
||
73 | |||
74 | /** |
||
75 | * Retrieve the list of names for a locale. |
||
76 | * |
||
77 | * @param string $locale |
||
78 | * @return \Illuminate\Support\Collection |
||
79 | */ |
||
80 | public function names(string $locale = null) : Collection |
||
84 | |||
85 | /** |
||
86 | * Parse a value and return an instance. |
||
87 | * |
||
88 | * @param string|int $value |
||
89 | * @param string $locale |
||
90 | * @return self |
||
91 | */ |
||
92 | public function parse($value, string $locale = null) : self |
||
98 | |||
99 | /** |
||
100 | * Change the locale of the instance. |
||
101 | * |
||
102 | * @param string $locale |
||
103 | * @return self |
||
104 | */ |
||
105 | public function to(string $locale) : self |
||
111 | |||
112 | /** |
||
113 | * Retrieve the value of a weekday. |
||
114 | * |
||
115 | * @param string $name |
||
116 | * @param string $locale |
||
117 | * @return string |
||
118 | */ |
||
119 | public function value(string $name, string $locale = null) : int |
||
125 | } |
||
126 |