First Commit
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\Constants;
|
||||
|
||||
interface DiffOptions
|
||||
{
|
||||
/**
|
||||
* Diff wording options(expressed in octal).
|
||||
*/
|
||||
public const NO_ZERO_DIFF = 01;
|
||||
public const JUST_NOW = 02;
|
||||
public const ONE_DAY_WORDS = 04;
|
||||
public const TWO_DAY_WORDS = 010;
|
||||
public const SEQUENTIAL_PARTS_ONLY = 020;
|
||||
public const ROUND = 040;
|
||||
public const FLOOR = 0100;
|
||||
public const CEIL = 0200;
|
||||
|
||||
/**
|
||||
* Diff syntax options.
|
||||
*/
|
||||
public const DIFF_ABSOLUTE = 1; // backward compatibility with true
|
||||
public const DIFF_RELATIVE_AUTO = 0; // backward compatibility with false
|
||||
public const DIFF_RELATIVE_TO_NOW = 2;
|
||||
public const DIFF_RELATIVE_TO_OTHER = 3;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\Constants;
|
||||
|
||||
interface Format
|
||||
{
|
||||
/**
|
||||
* RFC7231 DateTime format.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const RFC7231_FORMAT = 'D, d M Y H:i:s \G\M\T';
|
||||
|
||||
/**
|
||||
* Default format to use for __toString method when type juggling occurs.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const DEFAULT_TO_STRING_FORMAT = 'Y-m-d H:i:s';
|
||||
|
||||
/**
|
||||
* Format for converting mocked time, includes microseconds.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const MOCK_DATETIME_FORMAT = 'Y-m-d H:i:s.u';
|
||||
|
||||
/**
|
||||
* Pattern detection for ->isoFormat and ::createFromIsoFormat.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const ISO_FORMAT_REGEXP = '(O[YMDHhms]|[Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY?|g{1,5}|G{1,5}|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?)';
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\Constants;
|
||||
|
||||
interface TranslationOptions
|
||||
{
|
||||
/**
|
||||
* Translate string options.
|
||||
*/
|
||||
public const TRANSLATE_MONTHS = 1;
|
||||
public const TRANSLATE_DAYS = 2;
|
||||
public const TRANSLATE_UNITS = 4;
|
||||
public const TRANSLATE_MERIDIEM = 8;
|
||||
public const TRANSLATE_DIFF = 0x10;
|
||||
public const TRANSLATE_ALL = self::TRANSLATE_MONTHS | self::TRANSLATE_DAYS | self::TRANSLATE_UNITS | self::TRANSLATE_MERIDIEM | self::TRANSLATE_DIFF;
|
||||
|
||||
/**
|
||||
* Special settings to get the start of week from current locale culture.
|
||||
*/
|
||||
public const WEEK_DAY_AUTO = 'auto';
|
||||
|
||||
/**
|
||||
* Default locale (language and region).
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const DEFAULT_LOCALE = 'en';
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\Constants;
|
||||
|
||||
interface UnitValue
|
||||
{
|
||||
/**
|
||||
* The day constants.
|
||||
*/
|
||||
public const SUNDAY = 0;
|
||||
public const MONDAY = 1;
|
||||
public const TUESDAY = 2;
|
||||
public const WEDNESDAY = 3;
|
||||
public const THURSDAY = 4;
|
||||
public const FRIDAY = 5;
|
||||
public const SATURDAY = 6;
|
||||
|
||||
/**
|
||||
* The month constants.
|
||||
* These aren't used by Carbon itself but exist for
|
||||
* convenience's sake alone.
|
||||
*/
|
||||
public const JANUARY = 1;
|
||||
public const FEBRUARY = 2;
|
||||
public const MARCH = 3;
|
||||
public const APRIL = 4;
|
||||
public const MAY = 5;
|
||||
public const JUNE = 6;
|
||||
public const JULY = 7;
|
||||
public const AUGUST = 8;
|
||||
public const SEPTEMBER = 9;
|
||||
public const OCTOBER = 10;
|
||||
public const NOVEMBER = 11;
|
||||
public const DECEMBER = 12;
|
||||
|
||||
/**
|
||||
* Number of X in Y.
|
||||
*/
|
||||
public const YEARS_PER_MILLENNIUM = 1_000;
|
||||
public const YEARS_PER_CENTURY = 100;
|
||||
public const YEARS_PER_DECADE = 10;
|
||||
public const MONTHS_PER_YEAR = 12;
|
||||
public const MONTHS_PER_QUARTER = 3;
|
||||
public const QUARTERS_PER_YEAR = 4;
|
||||
public const WEEKS_PER_YEAR = 52;
|
||||
public const WEEKS_PER_MONTH = 4;
|
||||
public const DAYS_PER_YEAR = 365;
|
||||
public const DAYS_PER_WEEK = 7;
|
||||
public const HOURS_PER_DAY = 24;
|
||||
public const MINUTES_PER_HOUR = 60;
|
||||
public const SECONDS_PER_MINUTE = 60;
|
||||
public const MILLISECONDS_PER_SECOND = 1_000;
|
||||
public const MICROSECONDS_PER_MILLISECOND = 1_000;
|
||||
public const MICROSECONDS_PER_SECOND = 1_000_000;
|
||||
}
|
||||
Reference in New Issue
Block a user