Command.php
1 month ago
DB.php
1 month ago
Date.php
2 weeks ago
Event.php
2 weeks ago
File.php
1 month ago
Guard.php
1 month ago
Http.php
1 month ago
Log.php
1 month ago
Option.php
1 month ago
Schema.php
1 month ago
Date.php
62 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Facade proxy for Somoy exposing static date and time factories. |
| 5 | * Primary date/time entry point for application code. |
| 6 | * |
| 7 | * @package Framework |
| 8 | * @subpackage Supports\Facades |
| 9 | * @since 1.0.0 |
| 10 | */ |
| 11 | namespace Kirki\Framework\Supports\Facades; |
| 12 | |
| 13 | \defined('ABSPATH') || exit; |
| 14 | use Kirki\Framework\Contracts\SomoyInterface; |
| 15 | use Kirki\Framework\Facade; |
| 16 | use Kirki\Framework\Supports\Somoy; |
| 17 | // phpcs:disable Generic.Files.LineLength.TooLong |
| 18 | /** |
| 19 | * Facade proxy for Somoy exposing static date and time factories. |
| 20 | * |
| 21 | * @method static \Framework\Contracts\SomoyInterface now(\DateTimeZone|string|null $timezone = null) |
| 22 | * @method static \Framework\Contracts\SomoyInterface today(\DateTimeZone|string|null $timezone = null) |
| 23 | * @method static \Framework\Contracts\SomoyInterface yesterday(\DateTimeZone|string|null $timezone = null) |
| 24 | * @method static \Framework\Contracts\SomoyInterface tomorrow(\DateTimeZone|string|null $timezone = null) |
| 25 | * @method static \Framework\Contracts\SomoyInterface parse(\DateTimeInterface|string|int|float|null $time = null, \DateTimeZone|string|null $timezone = null) |
| 26 | * @method static \Framework\Contracts\SomoyInterface instance(\DateTimeInterface $date) |
| 27 | * @method static \Framework\Contracts\SomoyInterface create_from_timestamp(int|float|string $timestamp, \DateTimeZone|string|null $timezone = null) |
| 28 | * @method static \Framework\Contracts\SomoyInterface create_from_format(string $format, string $time, \DateTimeZone|string|null $timezone = null) |
| 29 | * @method static \Framework\Contracts\SomoyInterface create(int|null $year = null, int|null $month = null, int|null $day = null, int|null $hour = null, int|null $minute = null, int|null $second = null, \DateTimeZone|string|null $timezone = null) |
| 30 | * @method static bool is_valid_date(mixed $value) |
| 31 | * @see \Framework\Supports\Somoy |
| 32 | * @see \Framework\Contracts\SomoyInterface |
| 33 | */ |
| 34 | class Date extends Facade |
| 35 | { |
| 36 | /** |
| 37 | * Get the accessor. |
| 38 | * |
| 39 | * @return string |
| 40 | * |
| 41 | * @since 1.0.0 |
| 42 | */ |
| 43 | public static function get_accessor() |
| 44 | { |
| 45 | return SomoyInterface::class; |
| 46 | } |
| 47 | /** |
| 48 | * Forward static calls to Somoy. |
| 49 | * |
| 50 | * @param string $method The method name being called. |
| 51 | * @param array $arguments The arguments passed to the method. |
| 52 | * |
| 53 | * @return mixed The result of the underlying method call. |
| 54 | * |
| 55 | * @since 1.0.0 |
| 56 | */ |
| 57 | public static function __callStatic($method, $arguments) |
| 58 | { |
| 59 | return Somoy::$method(...$arguments); |
| 60 | } |
| 61 | } |
| 62 |