PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 3.14.2
GiveWP – Donation Plugin and Fundraising Platform v3.14.2
4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 2.32.0 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.10.0 3.11.0 3.12.0 3.12.1 3.12.2 3.12.3 3.13.0 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.17.0 3.17.1 3.17.2 3.18.0 3.19.0 3.19.1 3.19.2 3.19.3 3.19.4 3.2.0 3.2.1 3.2.2 3.20.0 3.21.0 3.21.1 3.22.0 3.22.1 3.22.2 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.7.0 3.8.0 3.9.0 4.0.0 4.1.0 4.1.1 4.10.0 4.10.1 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.14.5 4.14.6 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.1 4.7.0 4.7.1 4.8.0 4.8.1 4.9.0 trunk 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.2 2.11.3 2.12.0 2.12.1 2.12.2 2.12.3 2.13.0 2.13.1 2.13.2 2.13.3 2.13.4 2.14.0 2.15.0 2.16.0 2.16.1 2.17.0 2.17.1 2.17.3 2.18.0 2.18.1 2.19.1 2.19.2 2.19.3 2.19.4 2.19.5 2.19.6 2.19.7 2.19.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.20.0 2.20.1 2.20.2 2.21.0 2.21.1 2.21.2 2.21.3 2.21.4 2.22.0 2.22.1 2.22.2 2.22.3 2.23.0 2.23.1 2.23.2 2.24.0 2.24.1 2.24.2 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.27.0 2.27.1 2.27.2 2.27.3 2.28.0 2.29.0 2.29.1 2.29.2
give / vendor / vendor-prefixed / fakerphp / faker / src / Faker / Extension / DateTimeExtension.php
give / vendor / vendor-prefixed / fakerphp / faker / src / Faker / Extension Last commit date
AddressExtension.php 1 year ago BarcodeExtension.php 1 year ago BloodExtension.php 1 year ago ColorExtension.php 1 year ago CompanyExtension.php 1 year ago CountryExtension.php 1 year ago DateTimeExtension.php 1 year ago Extension.php 1 year ago ExtensionNotFound.php 1 year ago FileExtension.php 1 year ago GeneratorAwareExtension.php 1 year ago GeneratorAwareExtensionTrait.php 1 year ago Helper.php 1 year ago NumberExtension.php 1 year ago PersonExtension.php 1 year ago PhoneNumberExtension.php 1 year ago UuidExtension.php 1 year ago VersionExtension.php 1 year ago
DateTimeExtension.php
249 lines
1 <?php
2 /**
3 * @license MIT
4 *
5 * Modified by impress-org on 07-August-2024 using Strauss.
6 * @see https://github.com/BrianHenryIE/strauss
7 */
8
9 namespace Give\Vendors\Faker\Extension;
10
11 /**
12 * FakerPHP extension for Date-related randomization.
13 *
14 * Functions accepting a date string use the `strtotime()` function internally.
15 *
16 * @experimental
17 *
18 * @since 1.20.0
19 */
20 interface DateTimeExtension
21 {
22 /**
23 * Get a DateTime object between January 1, 1970, and `$until` (defaults to "now").
24 *
25 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
26 * @param string|null $timezone zone timezone for generated date, fallback to `DateTime::$defaultTimezone` and `date_default_timezone_get()`.
27 *
28 * @see \DateTimeZone
29 * @see http://php.net/manual/en/timezones.php
30 * @see http://php.net/manual/en/function.date-default-timezone-get.php
31 *
32 * @example DateTime('2005-08-16 20:39:21')
33 */
34 public function dateTime($until = 'now', string $timezone = null): \DateTime;
35
36 /**
37 * Get a DateTime object for a date between January 1, 0001, and now.
38 *
39 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
40 * @param string|null $timezone zone timezone for generated date, fallback to `DateTime::$defaultTimezone` and `date_default_timezone_get()`.
41 *
42 * @example DateTime('1265-03-22 21:15:52')
43 *
44 * @see http://php.net/manual/en/timezones.php
45 * @see http://php.net/manual/en/function.date-default-timezone-get.php
46 */
47 public function dateTimeAD($until = 'now', string $timezone = null): \DateTime;
48
49 /**
50 * Get a DateTime object a random date between `$from` and `$until`.
51 * Accepts date strings that can be recognized by `strtotime()`.
52 *
53 * @param \DateTime|string $from defaults to 30 years ago
54 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
55 * @param string|null $timezone zone timezone for generated date, fallback to `DateTime::$defaultTimezone` and `date_default_timezone_get()`.
56 *
57 * @see \DateTimeZone
58 * @see http://php.net/manual/en/timezones.php
59 * @see http://php.net/manual/en/function.date-default-timezone-get.php
60 */
61 public function dateTimeBetween($from = '-30 years', $until = 'now', string $timezone = null): \DateTime;
62
63 /**
64 * Get a DateTime object based on a random date between `$from` and an interval.
65 * Accepts date string that can be recognized by `strtotime()`.
66 *
67 * @param \DateTime|int|string $from defaults to 30 years ago
68 * @param string $interval defaults to 5 days after
69 * @param string|null $timezone zone timezone for generated date, fallback to `DateTime::$defaultTimezone` and `date_default_timezone_get()`.
70 *
71 * @see \DateTimeZone
72 * @see http://php.net/manual/en/timezones.php
73 * @see http://php.net/manual/en/function.date-default-timezone-get.php
74 */
75 public function dateTimeInInterval($from = '-30 years', string $interval = '+5 days', string $timezone = null): \DateTime;
76
77 /**
78 * Get a date time object somewhere inside the current week.
79 *
80 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
81 * @param string|null $timezone zone timezone for generated date, fallback to `DateTime::$defaultTimezone` and `date_default_timezone_get()`.
82 *
83 * @see \DateTimeZone
84 * @see http://php.net/manual/en/timezones.php
85 * @see http://php.net/manual/en/function.date-default-timezone-get.php
86 */
87 public function dateTimeThisWeek($until = 'now', string $timezone = null): \DateTime;
88
89 /**
90 * Get a date time object somewhere inside the current month.
91 *
92 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
93 * @param string|null $timezone timezone for generated date, fallback to `DateTime::$defaultTimezone` and `date_default_timezone_get()`.
94 *
95 * @see \DateTimeZone
96 * @see http://php.net/manual/en/timezones.php
97 * @see http://php.net/manual/en/function.date-default-timezone-get.php
98 */
99 public function dateTimeThisMonth($until = 'now', string $timezone = null): \DateTime;
100
101 /**
102 * Get a date time object somewhere inside the current year.
103 *
104 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
105 * @param string|null $timezone timezone for generated date, fallback to `DateTime::$defaultTimezone` and `date_default_timezone_get()`.
106 *
107 * @see \DateTimeZone
108 * @see http://php.net/manual/en/timezones.php
109 * @see http://php.net/manual/en/function.date-default-timezone-get.php
110 */
111 public function dateTimeThisYear($until = 'now', string $timezone = null): \DateTime;
112
113 /**
114 * Get a date time object somewhere inside the current decade.
115 *
116 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
117 * @param string|null $timezone timezone for generated date, fallback to `DateTime::$defaultTimezone` and `date_default_timezone_get()`.
118 *
119 * @see \DateTimeZone
120 * @see http://php.net/manual/en/timezones.php
121 * @see http://php.net/manual/en/function.date-default-timezone-get.php
122 */
123 public function dateTimeThisDecade($until = 'now', string $timezone = null): \DateTime;
124
125 /**
126 * Get a date time object somewhere inside the current century.
127 *
128 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
129 * @param string|null $timezone timezone for generated date, fallback to `DateTime::$defaultTimezone` and `date_default_timezone_get()`.
130 *
131 * @see \DateTimeZone
132 * @see http://php.net/manual/en/timezones.php
133 * @see http://php.net/manual/en/function.date-default-timezone-get.php
134 */
135 public function dateTimeThisCentury($until = 'now', string $timezone = null): \DateTime;
136
137 /**
138 * Get a date string between January 1, 1970, and `$until`.
139 *
140 * @param string $format DateTime format
141 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
142 *
143 * @see https://www.php.net/manual/en/datetime.format.php
144 */
145 public function date(string $format = 'Y-m-d', $until = 'now'): string;
146
147 /**
148 * Get a time string (24h format by default).
149 *
150 * @param string $format DateTime format
151 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
152 *
153 * @see https://www.php.net/manual/en/datetime.format.php
154 */
155 public function time(string $format = 'H:i:s', $until = 'now'): string;
156
157 /**
158 * Get a UNIX (POSIX-compatible) timestamp between January 1, 1970, and `$until`.
159 *
160 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
161 */
162 public function unixTime($until = 'now'): int;
163
164 /**
165 * Get a date string according to the ISO-8601 standard.
166 *
167 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
168 */
169 public function iso8601($until = 'now'): string;
170
171 /**
172 * Get a string containing either "am" or "pm".
173 *
174 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
175 *
176 * @example 'am'
177 */
178 public function amPm($until = 'now'): string;
179
180 /**
181 * Get a localized random day of the month.
182 *
183 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
184 *
185 * @example '16'
186 */
187 public function dayOfMonth($until = 'now'): string;
188
189 /**
190 * Get a localized random day of the week.
191 *
192 * Uses internal DateTime formatting, hence PHP's internal locale will be used (change using `setlocale()`).
193 *
194 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
195 *
196 * @example 'Tuesday'
197 *
198 * @see setlocale
199 * @see https://www.php.net/manual/en/function.setlocale.php Set a different output language
200 */
201 public function dayOfWeek($until = 'now'): string;
202
203 /**
204 * Get a random month (numbered).
205 *
206 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
207 *
208 * @example '7'
209 */
210 public function month($until = 'now'): string;
211
212 /**
213 * Get a random month.
214 *
215 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
216 *
217 * @see setlocale
218 * @see https://www.php.net/manual/en/function.setlocale.php Set a different output language
219 *
220 * @example 'September'
221 */
222 public function monthName($until = 'now'): string;
223
224 /**
225 * Get a random year between 1970 and `$until`.
226 *
227 * @param \DateTime|int|string $until maximum timestamp, defaults to "now"
228 *
229 * @example '1987'
230 */
231 public function year($until = 'now'): string;
232
233 /**
234 * Get a random century, formatted as Roman numerals.
235 *
236 * @example 'XVII'
237 */
238 public function century(): string;
239
240 /**
241 * Get a random timezone, uses `\DateTimeZone::listIdentifiers()` internally.
242 *
243 * @param string|null $countryCode two-letter ISO 3166-1 compatible country code
244 *
245 * @example 'Europe/Rome'
246 */
247 public function timezone(string $countryCode = null): string;
248 }
249