芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/avenida/views/nesbot.tar
carbon/composer.json 0000644 00000003410 14716424272 0010541 0 ustar 00 { "name": "nesbot/carbon", "type": "library", "description": "A simple API extension for DateTime.", "keywords": [ "date", "time", "DateTime" ], "homepage": "http://carbon.nesbot.com", "support": { "issues": "https://github.com/briannesbitt/Carbon/issues", "source": "https://github.com/briannesbitt/Carbon" }, "license": "MIT", "authors": [ { "name": "Brian Nesbitt", "email": "brian@nesbot.com", "homepage": "http://nesbot.com" } ], "bin": ["bin/upgrade-carbon"], "require": { "php": ">=5.3.9", "kylekatarnls/update-helper": "^1.1", "symfony/translation": "~2.6 || ~3.0 || ~4.0" }, "require-dev": { "composer/composer": "^1.2", "friendsofphp/php-cs-fixer": "~2", "phpunit/phpunit": "^4.8.35 || ^5.7" }, "autoload": { "psr-4": { "": "src/" } }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, "config": { "sort-packages": true }, "scripts": { "test": [ "@phpunit", "@phpcs" ], "phpunit": "phpunit --verbose --coverage-clover=coverage.xml", "phpcs": "php-cs-fixer fix -v --diff --dry-run", "phpstan": "phpstan analyse --configuration phpstan.neon --level 3 src tests", "post-autoload-dump": [ "UpdateHelper\\UpdateHelper::check" ], "upgrade-carbon": [ "Carbon\\Upgrade::upgrade" ] }, "extra": { "update-helper": "Carbon\\Upgrade", "laravel": { "providers": [ "Carbon\\Laravel\\ServiceProvider" ] } } } carbon/LICENSE 0000644 00000002034 14716424272 0007025 0 ustar 00 Copyright (C) Brian Nesbitt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. carbon/src/Carbon/CarbonInterval.php 0000644 00000102047 14716424272 0013442 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Closure; use DateInterval; use InvalidArgumentException; use ReflectionClass; use ReflectionFunction; use ReflectionMethod; use Symfony\Component\Translation\TranslatorInterface; /** * A simple API extension for DateInterval. * The implementation provides helpers to handle weeks but only days are saved. * Weeks are calculated based on the total days of the current instance. * * @property int $years Total years of the current interval. * @property int $months Total months of the current interval. * @property int $weeks Total weeks of the current interval calculated from the days. * @property int $dayz Total days of the current interval (weeks * 7 + days). * @property int $hours Total hours of the current interval. * @property int $minutes Total minutes of the current interval. * @property int $seconds Total seconds of the current interval. * @property-read int $dayzExcludeWeeks Total days remaining in the final week of the current instance (days % 7). * @property-read int $daysExcludeWeeks alias of dayzExcludeWeeks * @property-read float $totalYears Number of years equivalent to the interval. * @property-read float $totalMonths Number of months equivalent to the interval. * @property-read float $totalWeeks Number of weeks equivalent to the interval. * @property-read float $totalDays Number of days equivalent to the interval. * @property-read float $totalDayz Alias for totalDays. * @property-read float $totalHours Number of hours equivalent to the interval. * @property-read float $totalMinutes Number of minutes equivalent to the interval. * @property-read float $totalSeconds Number of seconds equivalent to the interval. * * @method static CarbonInterval years($years = 1) Create instance specifying a number of years. * @method static CarbonInterval year($years = 1) Alias for years() * @method static CarbonInterval months($months = 1) Create instance specifying a number of months. * @method static CarbonInterval month($months = 1) Alias for months() * @method static CarbonInterval weeks($weeks = 1) Create instance specifying a number of weeks. * @method static CarbonInterval week($weeks = 1) Alias for weeks() * @method static CarbonInterval days($days = 1) Create instance specifying a number of days. * @method static CarbonInterval dayz($days = 1) Alias for days() * @method static CarbonInterval day($days = 1) Alias for days() * @method static CarbonInterval hours($hours = 1) Create instance specifying a number of hours. * @method static CarbonInterval hour($hours = 1) Alias for hours() * @method static CarbonInterval minutes($minutes = 1) Create instance specifying a number of minutes. * @method static CarbonInterval minute($minutes = 1) Alias for minutes() * @method static CarbonInterval seconds($seconds = 1) Create instance specifying a number of seconds. * @method static CarbonInterval second($seconds = 1) Alias for seconds() * @method CarbonInterval years($years = 1) Set the years portion of the current interval. * @method CarbonInterval year($years = 1) Alias for years(). * @method CarbonInterval months($months = 1) Set the months portion of the current interval. * @method CarbonInterval month($months = 1) Alias for months(). * @method CarbonInterval weeks($weeks = 1) Set the weeks portion of the current interval. Will overwrite dayz value. * @method CarbonInterval week($weeks = 1) Alias for weeks(). * @method CarbonInterval days($days = 1) Set the days portion of the current interval. * @method CarbonInterval dayz($days = 1) Alias for days(). * @method CarbonInterval day($days = 1) Alias for days(). * @method CarbonInterval hours($hours = 1) Set the hours portion of the current interval. * @method CarbonInterval hour($hours = 1) Alias for hours(). * @method CarbonInterval minutes($minutes = 1) Set the minutes portion of the current interval. * @method CarbonInterval minute($minutes = 1) Alias for minutes(). * @method CarbonInterval seconds($seconds = 1) Set the seconds portion of the current interval. * @method CarbonInterval second($seconds = 1) Alias for seconds(). */ class CarbonInterval extends DateInterval { /** * Interval spec period designators */ const PERIOD_PREFIX = 'P'; const PERIOD_YEARS = 'Y'; const PERIOD_MONTHS = 'M'; const PERIOD_DAYS = 'D'; const PERIOD_TIME_PREFIX = 'T'; const PERIOD_HOURS = 'H'; const PERIOD_MINUTES = 'M'; const PERIOD_SECONDS = 'S'; /** * A translator to ... er ... translate stuff * * @var \Symfony\Component\Translation\TranslatorInterface */ protected static $translator; /** * @var array|null */ protected static $cascadeFactors; /** * @var array|null */ private static $flipCascadeFactors; /** * The registered macros. * * @var array */ protected static $macros = array(); /** * Before PHP 5.4.20/5.5.4 instead of FALSE days will be set to -99999 when the interval instance * was created by DateTime::diff(). */ const PHP_DAYS_FALSE = -99999; /** * Mapping of units and factors for cascading. * * Should only be modified by changing the factors or referenced constants. * * @return array */ public static function getCascadeFactors() { return static::$cascadeFactors ?: array( 'minutes' => array(Carbon::SECONDS_PER_MINUTE, 'seconds'), 'hours' => array(Carbon::MINUTES_PER_HOUR, 'minutes'), 'dayz' => array(Carbon::HOURS_PER_DAY, 'hours'), 'months' => array(Carbon::DAYS_PER_WEEK * Carbon::WEEKS_PER_MONTH, 'dayz'), 'years' => array(Carbon::MONTHS_PER_YEAR, 'months'), ); } private static function standardizeUnit($unit) { $unit = rtrim($unit, 'sz').'s'; return $unit === 'days' ? 'dayz' : $unit; } private static function getFlipCascadeFactors() { if (!self::$flipCascadeFactors) { self::$flipCascadeFactors = array(); foreach (static::getCascadeFactors() as $to => $tuple) { list($factor, $from) = $tuple; self::$flipCascadeFactors[self::standardizeUnit($from)] = array(self::standardizeUnit($to), $factor); } } return self::$flipCascadeFactors; } /** * @param array $cascadeFactors */ public static function setCascadeFactors(array $cascadeFactors) { self::$flipCascadeFactors = null; static::$cascadeFactors = $cascadeFactors; } /** * Determine if the interval was created via DateTime:diff() or not. * * @param DateInterval $interval * * @return bool */ private static function wasCreatedFromDiff(DateInterval $interval) { return $interval->days !== false && $interval->days !== static::PHP_DAYS_FALSE; } /////////////////////////////////////////////////////////////////// //////////////////////////// CONSTRUCTORS ///////////////////////// /////////////////////////////////////////////////////////////////// /** * Create a new CarbonInterval instance. * * @param int $years * @param int $months * @param int $weeks * @param int $days * @param int $hours * @param int $minutes * @param int $seconds */ public function __construct($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null) { $spec = $years; if (!is_string($spec) || floatval($years) || preg_match('/^[0-9.]/', $years)) { $spec = static::PERIOD_PREFIX; $spec .= $years > 0 ? $years.static::PERIOD_YEARS : ''; $spec .= $months > 0 ? $months.static::PERIOD_MONTHS : ''; $specDays = 0; $specDays += $weeks > 0 ? $weeks * static::getDaysPerWeek() : 0; $specDays += $days > 0 ? $days : 0; $spec .= $specDays > 0 ? $specDays.static::PERIOD_DAYS : ''; if ($hours > 0 || $minutes > 0 || $seconds > 0) { $spec .= static::PERIOD_TIME_PREFIX; $spec .= $hours > 0 ? $hours.static::PERIOD_HOURS : ''; $spec .= $minutes > 0 ? $minutes.static::PERIOD_MINUTES : ''; $spec .= $seconds > 0 ? $seconds.static::PERIOD_SECONDS : ''; } if ($spec === static::PERIOD_PREFIX) { // Allow the zero interval. $spec .= '0'.static::PERIOD_YEARS; } } parent::__construct($spec); } /** * Returns the factor for a given source-to-target couple. * * @param string $source * @param string $target * * @return int|null */ public static function getFactor($source, $target) { $source = self::standardizeUnit($source); $target = self::standardizeUnit($target); $factors = static::getFlipCascadeFactors(); if (isset($factors[$source])) { list($to, $factor) = $factors[$source]; if ($to === $target) { return $factor; } } return null; } /** * Returns current config for days per week. * * @return int */ public static function getDaysPerWeek() { return static::getFactor('dayz', 'weeks') ?: Carbon::DAYS_PER_WEEK; } /** * Returns current config for hours per day. * * @return int */ public static function getHoursPerDay() { return static::getFactor('hours', 'dayz') ?: Carbon::HOURS_PER_DAY; } /** * Returns current config for minutes per hour. * * @return int */ public static function getMinutesPerHours() { return static::getFactor('minutes', 'hours') ?: Carbon::MINUTES_PER_HOUR; } /** * Returns current config for seconds per minute. * * @return int */ public static function getSecondsPerMinutes() { return static::getFactor('seconds', 'minutes') ?: Carbon::SECONDS_PER_MINUTE; } /** * Create a new CarbonInterval instance from specific values. * This is an alias for the constructor that allows better fluent * syntax as it allows you to do CarbonInterval::create(1)->fn() rather than * (new CarbonInterval(1))->fn(). * * @param int $years * @param int $months * @param int $weeks * @param int $days * @param int $hours * @param int $minutes * @param int $seconds * * @return static */ public static function create($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null) { return new static($years, $months, $weeks, $days, $hours, $minutes, $seconds); } /** * Get a copy of the instance. * * @return static */ public function copy() { $date = new static($this->spec()); $date->invert = $this->invert; return $date; } /** * Provide static helpers to create instances. Allows CarbonInterval::years(3). * * Note: This is done using the magic method to allow static and instance methods to * have the same names. * * @param string $name * @param array $args * * @return static */ public static function __callStatic($name, $args) { $arg = count($args) === 0 ? 1 : $args[0]; switch ($name) { case 'years': case 'year': return new static($arg); case 'months': case 'month': return new static(null, $arg); case 'weeks': case 'week': return new static(null, null, $arg); case 'days': case 'dayz': case 'day': return new static(null, null, null, $arg); case 'hours': case 'hour': return new static(null, null, null, null, $arg); case 'minutes': case 'minute': return new static(null, null, null, null, null, $arg); case 'seconds': case 'second': return new static(null, null, null, null, null, null, $arg); } if (static::hasMacro($name)) { return call_user_func_array( array(new static(0), $name), $args ); } } /** * Creates a CarbonInterval from string. * * Format: * * Suffix | Unit | Example | DateInterval expression * -------|---------|---------|------------------------ * y | years | 1y | P1Y * mo | months | 3mo | P3M * w | weeks | 2w | P2W * d | days | 28d | P28D * h | hours | 4h | PT4H * m | minutes | 12m | PT12M * s | seconds | 59s | PT59S * * e. g. `1w 3d 4h 32m 23s` is converted to 10 days 4 hours 32 minutes and 23 seconds. * * Special cases: * - An empty string will return a zero interval * - Fractions are allowed for weeks, days, hours and minutes and will be converted * and rounded to the next smaller value (caution: 0.5w = 4d) * * @param string $intervalDefinition * * @return static */ public static function fromString($intervalDefinition) { if (empty($intervalDefinition)) { return new static(0); } $years = 0; $months = 0; $weeks = 0; $days = 0; $hours = 0; $minutes = 0; $seconds = 0; $pattern = '/(\d+(?:\.\d+)?)\h*([^\d\h]*)/i'; preg_match_all($pattern, $intervalDefinition, $parts, PREG_SET_ORDER); while ($match = array_shift($parts)) { list($part, $value, $unit) = $match; $intValue = intval($value); $fraction = floatval($value) - $intValue; switch (strtolower($unit)) { case 'year': case 'years': case 'y': $years += $intValue; break; case 'month': case 'months': case 'mo': $months += $intValue; break; case 'week': case 'weeks': case 'w': $weeks += $intValue; if ($fraction) { $parts[] = array(null, $fraction * static::getDaysPerWeek(), 'd'); } break; case 'day': case 'days': case 'd': $days += $intValue; if ($fraction) { $parts[] = array(null, $fraction * static::getHoursPerDay(), 'h'); } break; case 'hour': case 'hours': case 'h': $hours += $intValue; if ($fraction) { $parts[] = array(null, $fraction * static::getMinutesPerHours(), 'm'); } break; case 'minute': case 'minutes': case 'm': $minutes += $intValue; if ($fraction) { $seconds += round($fraction * static::getSecondsPerMinutes()); } break; case 'second': case 'seconds': case 's': $seconds += $intValue; break; default: throw new InvalidArgumentException( sprintf('Invalid part %s in definition %s', $part, $intervalDefinition) ); } } return new static($years, $months, $weeks, $days, $hours, $minutes, $seconds); } /** * Create a CarbonInterval instance from a DateInterval one. Can not instance * DateInterval objects created from DateTime::diff() as you can't externally * set the $days field. * * Pass false as second argument to get a microseconds-precise interval. Else * microseconds in the original interval will not be kept. * * @param DateInterval $di * @param bool $trimMicroseconds (true by default) * * @return static */ public static function instance(DateInterval $di, $trimMicroseconds = true) { $microseconds = $trimMicroseconds || version_compare(PHP_VERSION, '7.1.0-dev', '<') ? 0 : $di->f; $instance = new static(static::getDateIntervalSpec($di)); if ($microseconds) { $instance->f = $microseconds; } $instance->invert = $di->invert; foreach (array('y', 'm', 'd', 'h', 'i', 's') as $unit) { if ($di->$unit < 0) { $instance->$unit *= -1; } } return $instance; } /** * Make a CarbonInterval instance from given variable if possible. * * Always return a new instance. Parse only strings and only these likely to be intervals (skip dates * and recurrences). Throw an exception for invalid format, but otherwise return null. * * @param mixed $var * * @return static|null */ public static function make($var) { if ($var instanceof DateInterval) { return static::instance($var); } if (is_string($var)) { $var = trim($var); if (substr($var, 0, 1) === 'P') { return new static($var); } if (preg_match('/^(?:\h*\d+(?:\.\d+)?\h*[a-z]+)+$/i', $var)) { return static::fromString($var); } } } /////////////////////////////////////////////////////////////////// /////////////////////// LOCALIZATION ////////////////////////////// /////////////////////////////////////////////////////////////////// /** * Initialize the translator instance if necessary. * * @return \Symfony\Component\Translation\TranslatorInterface */ protected static function translator() { if (static::$translator === null) { static::$translator = Translator::get(); } return static::$translator; } /** * Get the translator instance in use. * * @return \Symfony\Component\Translation\TranslatorInterface */ public static function getTranslator() { return static::translator(); } /** * Set the translator instance to use. * * @param TranslatorInterface $translator */ public static function setTranslator(TranslatorInterface $translator) { static::$translator = $translator; } /** * Get the current translator locale. * * @return string */ public static function getLocale() { return static::translator()->getLocale(); } /** * Set the current translator locale. * * @param string $locale */ public static function setLocale($locale) { return static::translator()->setLocale($locale) !== false; } /////////////////////////////////////////////////////////////////// ///////////////////////// GETTERS AND SETTERS ///////////////////// /////////////////////////////////////////////////////////////////// /** * Get a part of the CarbonInterval object. * * @param string $name * * @throws \InvalidArgumentException * * @return int|float */ public function __get($name) { if (substr($name, 0, 5) === 'total') { return $this->total(substr($name, 5)); } switch ($name) { case 'years': return $this->y; case 'months': return $this->m; case 'dayz': return $this->d; case 'hours': return $this->h; case 'minutes': return $this->i; case 'seconds': return $this->s; case 'weeks': return (int) floor($this->d / static::getDaysPerWeek()); case 'daysExcludeWeeks': case 'dayzExcludeWeeks': return $this->d % static::getDaysPerWeek(); default: throw new InvalidArgumentException(sprintf("Unknown getter '%s'", $name)); } } /** * Set a part of the CarbonInterval object. * * @param string $name * @param int $val * * @throws \InvalidArgumentException */ public function __set($name, $val) { switch ($name) { case 'years': $this->y = $val; break; case 'months': $this->m = $val; break; case 'weeks': $this->d = $val * static::getDaysPerWeek(); break; case 'dayz': $this->d = $val; break; case 'hours': $this->h = $val; break; case 'minutes': $this->i = $val; break; case 'seconds': $this->s = $val; break; } } /** * Allow setting of weeks and days to be cumulative. * * @param int $weeks Number of weeks to set * @param int $days Number of days to set * * @return static */ public function weeksAndDays($weeks, $days) { $this->dayz = ($weeks * static::getDaysPerWeek()) + $days; return $this; } /** * Register a custom macro. * * @param string $name * @param object|callable $macro * * @return void */ public static function macro($name, $macro) { static::$macros[$name] = $macro; } /** * Remove all macros. */ public static function resetMacros() { static::$macros = array(); } /** * Register macros from a mixin object. * * @param object $mixin * * @throws \ReflectionException * * @return void */ public static function mixin($mixin) { $reflection = new ReflectionClass($mixin); $methods = $reflection->getMethods( ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED ); foreach ($methods as $method) { $method->setAccessible(true); static::macro($method->name, $method->invoke($mixin)); } } /** * Check if macro is registered. * * @param string $name * * @return bool */ public static function hasMacro($name) { return isset(static::$macros[$name]); } /** * Call given macro. * * @param string $name * @param array $parameters * * @return mixed */ protected function callMacro($name, $parameters) { $macro = static::$macros[$name]; $reflection = new ReflectionFunction($macro); $reflectionParameters = $reflection->getParameters(); $expectedCount = count($reflectionParameters); $actualCount = count($parameters); if ($expectedCount > $actualCount && $reflectionParameters[$expectedCount - 1]->name === 'self') { for ($i = $actualCount; $i < $expectedCount - 1; $i++) { $parameters[] = $reflectionParameters[$i]->getDefaultValue(); } $parameters[] = $this; } if ($macro instanceof Closure && method_exists($macro, 'bindTo')) { $macro = $macro->bindTo($this, get_class($this)); } return call_user_func_array($macro, $parameters); } /** * Allow fluent calls on the setters... CarbonInterval::years(3)->months(5)->day(). * * Note: This is done using the magic method to allow static and instance methods to * have the same names. * * @param string $name * @param array $args * * @return static */ public function __call($name, $args) { if (static::hasMacro($name)) { return $this->callMacro($name, $args); } $arg = count($args) === 0 ? 1 : $args[0]; switch ($name) { case 'years': case 'year': $this->years = $arg; break; case 'months': case 'month': $this->months = $arg; break; case 'weeks': case 'week': $this->dayz = $arg * static::getDaysPerWeek(); break; case 'days': case 'dayz': case 'day': $this->dayz = $arg; break; case 'hours': case 'hour': $this->hours = $arg; break; case 'minutes': case 'minute': $this->minutes = $arg; break; case 'seconds': case 'second': $this->seconds = $arg; break; } return $this; } /** * Get the current interval in a human readable format in the current locale. * * @param bool $short (false by default), returns short units if true * * @return string */ public function forHumans($short = false) { $periods = array( 'year' => array('y', $this->years), 'month' => array('m', $this->months), 'week' => array('w', $this->weeks), 'day' => array('d', $this->daysExcludeWeeks), 'hour' => array('h', $this->hours), 'minute' => array('min', $this->minutes), 'second' => array('s', $this->seconds), ); $parts = array(); foreach ($periods as $unit => $options) { list($shortUnit, $count) = $options; if ($count > 0) { $parts[] = static::translator()->transChoice($short ? $shortUnit : $unit, $count, array(':count' => $count)); } } return implode(' ', $parts); } /** * Format the instance as a string using the forHumans() function. * * @return string */ public function __toString() { return $this->forHumans(); } /** * Convert the interval to a CarbonPeriod. * * @return CarbonPeriod */ public function toPeriod() { return CarbonPeriod::createFromArray( array_merge(array($this), func_get_args()) ); } /** * Invert the interval. * * @return $this */ public function invert() { $this->invert = $this->invert ? 0 : 1; return $this; } /** * Add the passed interval to the current instance. * * @param DateInterval $interval * * @return static */ public function add(DateInterval $interval) { $sign = ($this->invert === 1) !== ($interval->invert === 1) ? -1 : 1; if (static::wasCreatedFromDiff($interval)) { $this->dayz += $interval->days * $sign; } else { $this->years += $interval->y * $sign; $this->months += $interval->m * $sign; $this->dayz += $interval->d * $sign; $this->hours += $interval->h * $sign; $this->minutes += $interval->i * $sign; $this->seconds += $interval->s * $sign; } if (($this->years || $this->months || $this->dayz || $this->hours || $this->minutes || $this->seconds) && $this->years <= 0 && $this->months <= 0 && $this->dayz <= 0 && $this->hours <= 0 && $this->minutes <= 0 && $this->seconds <= 0 ) { $this->years *= -1; $this->months *= -1; $this->dayz *= -1; $this->hours *= -1; $this->minutes *= -1; $this->seconds *= -1; $this->invert(); } return $this; } /** * Multiply current instance given number of times * * @param float $factor * * @return $this */ public function times($factor) { if ($factor < 0) { $this->invert = $this->invert ? 0 : 1; $factor = -$factor; } $this->years = (int) round($this->years * $factor); $this->months = (int) round($this->months * $factor); $this->dayz = (int) round($this->dayz * $factor); $this->hours = (int) round($this->hours * $factor); $this->minutes = (int) round($this->minutes * $factor); $this->seconds = (int) round($this->seconds * $factor); return $this; } /** * Get the interval_spec string of a date interval. * * @param DateInterval $interval * * @return string */ public static function getDateIntervalSpec(DateInterval $interval) { $date = array_filter(array( static::PERIOD_YEARS => abs($interval->y), static::PERIOD_MONTHS => abs($interval->m), static::PERIOD_DAYS => abs($interval->d), )); $time = array_filter(array( static::PERIOD_HOURS => abs($interval->h), static::PERIOD_MINUTES => abs($interval->i), static::PERIOD_SECONDS => abs($interval->s), )); $specString = static::PERIOD_PREFIX; foreach ($date as $key => $value) { $specString .= $value.$key; } if (count($time) > 0) { $specString .= static::PERIOD_TIME_PREFIX; foreach ($time as $key => $value) { $specString .= $value.$key; } } return $specString === static::PERIOD_PREFIX ? 'PT0S' : $specString; } /** * Get the interval_spec string. * * @return string */ public function spec() { return static::getDateIntervalSpec($this); } /** * Comparing 2 date intervals. * * @param DateInterval $a * @param DateInterval $b * * @return int */ public static function compareDateIntervals(DateInterval $a, DateInterval $b) { $current = Carbon::now(); $passed = $current->copy()->add($b); $current->add($a); if ($current < $passed) { return -1; } if ($current > $passed) { return 1; } return 0; } /** * Comparing with passed interval. * * @param DateInterval $interval * * @return int */ public function compare(DateInterval $interval) { return static::compareDateIntervals($this, $interval); } /** * Convert overflowed values into bigger units. * * @return $this */ public function cascade() { foreach (static::getFlipCascadeFactors() as $source => $cascade) { list($target, $factor) = $cascade; if ($source === 'dayz' && $target === 'weeks') { continue; } $value = $this->$source; $this->$source = $modulo = $value % $factor; $this->$target += ($value - $modulo) / $factor; } return $this; } /** * Get amount of given unit equivalent to the interval. * * @param string $unit * * @throws \InvalidArgumentException * * @return float */ public function total($unit) { $realUnit = $unit = strtolower($unit); if (in_array($unit, array('days', 'weeks'))) { $realUnit = 'dayz'; } elseif (!in_array($unit, array('seconds', 'minutes', 'hours', 'dayz', 'months', 'years'))) { throw new InvalidArgumentException("Unknown unit '$unit'."); } $result = 0; $cumulativeFactor = 0; $unitFound = false; foreach (static::getFlipCascadeFactors() as $source => $cascade) { list($target, $factor) = $cascade; if ($source === $realUnit) { $unitFound = true; $result += $this->$source; $cumulativeFactor = 1; } if ($factor === false) { if ($unitFound) { break; } $result = 0; $cumulativeFactor = 0; continue; } if ($target === $realUnit) { $unitFound = true; } if ($cumulativeFactor) { $cumulativeFactor *= $factor; $result += $this->$target * $cumulativeFactor; continue; } $result = ($result + $this->$source) / $factor; } if (isset($target) && !$cumulativeFactor) { $result += $this->$target; } if (!$unitFound) { throw new \InvalidArgumentException("Unit $unit have no configuration to get total from other units."); } if ($unit === 'weeks') { return $result / static::getDaysPerWeek(); } return $result; } } carbon/src/Carbon/Carbon.php 0000644 00000435425 14716424272 0011746 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Carbon\Exceptions\InvalidDateException; use Closure; use DateInterval; use DatePeriod; use DateTime; use DateTimeInterface; use DateTimeZone; use InvalidArgumentException; use JsonSerializable; use Symfony\Component\Translation\TranslatorInterface; /** * A simple API extension for DateTime * * @property int $year * @property int $yearIso * @property int $month * @property int $day * @property int $hour * @property int $minute * @property int $second * @property int $timestamp seconds since the Unix Epoch * @property \DateTimeZone $timezone the current timezone * @property \DateTimeZone $tz alias of timezone * @property-read int $micro * @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) * @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) * @property-read int $dayOfYear 0 through 365 * @property-read int $weekOfMonth 1 through 5 * @property-read int $weekNumberInMonth 1 through 5 * @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday * @property-read int $daysInMonth number of days in the given month * @property-read int $age does a diffInYears() with default parameters * @property-read int $quarter the quarter of this instance, 1 - 4 * @property-read int $offset the timezone offset in seconds from UTC * @property-read int $offsetHours the timezone offset in hours from UTC * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise * @property-read bool $local checks if the timezone is local, true if local, false otherwise * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise * @property-read string $timezoneName * @property-read string $tzName * @property-read string $englishDayOfWeek the day of week in English * @property-read string $shortEnglishDayOfWeek the abbreviated day of week in English * @property-read string $englishMonth the day of week in English * @property-read string $shortEnglishMonth the abbreviated day of week in English * @property-read string $localeDayOfWeek the day of week in current locale LC_TIME * @property-read string $shortLocaleDayOfWeek the abbreviated day of week in current locale LC_TIME * @property-read string $localeMonth the month in current locale LC_TIME * @property-read string $shortLocaleMonth the abbreviated month in current locale LC_TIME */ class Carbon extends DateTime implements JsonSerializable { const NO_ZERO_DIFF = 01; const JUST_NOW = 02; const ONE_DAY_WORDS = 04; const TWO_DAY_WORDS = 010; // Substitutes for Carbon 2 modes const DIFF_RELATIVE_TO_NOW = 'relative-to-now'; const DIFF_RELATIVE_TO_OTHER = 'relative-to-other'; /** * The day constants. */ const SUNDAY = 0; const MONDAY = 1; const TUESDAY = 2; const WEDNESDAY = 3; const THURSDAY = 4; const FRIDAY = 5; const SATURDAY = 6; /** * Names of days of the week. * * @var array */ protected static $days = array( self::SUNDAY => 'Sunday', self::MONDAY => 'Monday', self::TUESDAY => 'Tuesday', self::WEDNESDAY => 'Wednesday', self::THURSDAY => 'Thursday', self::FRIDAY => 'Friday', self::SATURDAY => 'Saturday', ); /** * Number of X in Y. */ const YEARS_PER_MILLENNIUM = 1000; const YEARS_PER_CENTURY = 100; const YEARS_PER_DECADE = 10; const MONTHS_PER_YEAR = 12; const MONTHS_PER_QUARTER = 3; const WEEKS_PER_YEAR = 52; const WEEKS_PER_MONTH = 4; const DAYS_PER_WEEK = 7; const HOURS_PER_DAY = 24; const MINUTES_PER_HOUR = 60; const SECONDS_PER_MINUTE = 60; const MICROSECONDS_PER_MILLISECOND = 1000; const MICROSECONDS_PER_SECOND = 1000000; /** * RFC7231 DateTime format. * * @var string */ 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 */ const DEFAULT_TO_STRING_FORMAT = 'Y-m-d H:i:s'; /** * Format for converting mocked time, includes microseconds. * * @var string */ const MOCK_DATETIME_FORMAT = 'Y-m-d H:i:s.u'; /** * Customizable PHP_INT_SIZE override. * * @var int */ public static $PHPIntSize = PHP_INT_SIZE; /** * Format to use for __toString method when type juggling occurs. * * @var string */ protected static $toStringFormat = self::DEFAULT_TO_STRING_FORMAT; /** * First day of week. * * @var int */ protected static $weekStartsAt = self::MONDAY; /** * Last day of week. * * @var int */ protected static $weekEndsAt = self::SUNDAY; /** * Days of weekend. * * @var array */ protected static $weekendDays = array( self::SATURDAY, self::SUNDAY, ); /** * Midday/noon hour. * * @var int */ protected static $midDayAt = 12; /** * Format regex patterns. * * @var array */ protected static $regexFormats = array( 'd' => '(3[01]|[12][0-9]|0[1-9])', 'D' => '([a-zA-Z]{3})', 'j' => '([123][0-9]|[1-9])', 'l' => '([a-zA-Z]{2,})', 'N' => '([1-7])', 'S' => '([a-zA-Z]{2})', 'w' => '([0-6])', 'z' => '(36[0-5]|3[0-5][0-9]|[12][0-9]{2}|[1-9]?[0-9])', 'W' => '(5[012]|[1-4][0-9]|[1-9])', 'F' => '([a-zA-Z]{2,})', 'm' => '(1[012]|0[1-9])', 'M' => '([a-zA-Z]{3})', 'n' => '(1[012]|[1-9])', 't' => '(2[89]|3[01])', 'L' => '(0|1)', 'o' => '([1-9][0-9]{0,4})', 'Y' => '([1-9]?[0-9]{4})', 'y' => '([0-9]{2})', 'a' => '(am|pm)', 'A' => '(AM|PM)', 'B' => '([0-9]{3})', 'g' => '(1[012]|[1-9])', 'G' => '(2[0-3]|1?[0-9])', 'h' => '(1[012]|0[1-9])', 'H' => '(2[0-3]|[01][0-9])', 'i' => '([0-5][0-9])', 's' => '([0-5][0-9])', 'u' => '([0-9]{1,6})', 'v' => '([0-9]{1,3})', 'e' => '([a-zA-Z]{1,5})|([a-zA-Z]*\/[a-zA-Z]*)', 'I' => '(0|1)', 'O' => '([\+\-](1[012]|0[0-9])[0134][05])', 'P' => '([\+\-](1[012]|0[0-9]):[0134][05])', 'T' => '([a-zA-Z]{1,5})', 'Z' => '(-?[1-5]?[0-9]{1,4})', 'U' => '([0-9]*)', // The formats below are combinations of the above formats. 'c' => '(([1-9]?[0-9]{4})\-(1[012]|0[1-9])\-(3[01]|[12][0-9]|0[1-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])[\+\-](1[012]|0[0-9]):([0134][05]))', // Y-m-dTH:i:sP 'r' => '(([a-zA-Z]{3}), ([123][0-9]|[1-9]) ([a-zA-Z]{3}) ([1-9]?[0-9]{4}) (2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]) [\+\-](1[012]|0[0-9])([0134][05]))', // D, j M Y H:i:s O ); /** * A test Carbon instance to be returned when now instances are created. * * @var \Carbon\Carbon */ protected static $testNow; /** * A translator to ... er ... translate stuff. * * @var \Symfony\Component\Translation\TranslatorInterface */ protected static $translator; /** * The errors that can occur. * * @var array */ protected static $lastErrors; /** * The custom Carbon JSON serializer. * * @var callable|null */ protected static $serializer; /** * The registered string macros. * * @var array */ protected static $localMacros = array(); /** * Will UTF8 encoding be used to print localized date/time ? * * @var bool */ protected static $utf8 = false; /** * Add microseconds to now on PHP < 7.1 and 7.1.3. true by default. * * @var bool */ protected static $microsecondsFallback = true; /** * Indicates if months should be calculated with overflow. * * @var bool */ protected static $monthsOverflow = true; /** * Indicates if years should be calculated with overflow. * * @var bool */ protected static $yearsOverflow = true; /** * Indicates if years are compared with month by default so isSameMonth and isSameQuarter have $ofSameYear set * to true by default. * * @var bool */ protected static $compareYearWithMonth = false; /** * Options for diffForHumans(). * * @var int */ protected static $humanDiffOptions = self::NO_ZERO_DIFF; /** * @param int $humanDiffOptions */ public static function setHumanDiffOptions($humanDiffOptions) { static::$humanDiffOptions = $humanDiffOptions; } /** * @param int $humanDiffOption */ public static function enableHumanDiffOption($humanDiffOption) { static::$humanDiffOptions = static::getHumanDiffOptions() | $humanDiffOption; } /** * @param int $humanDiffOption */ public static function disableHumanDiffOption($humanDiffOption) { static::$humanDiffOptions = static::getHumanDiffOptions() & ~$humanDiffOption; } /** * @return int */ public static function getHumanDiffOptions() { return static::$humanDiffOptions; } /** * Add microseconds to now on PHP < 7.1 and 7.1.3 if set to true, * let microseconds to 0 on those PHP versions if false. * * @param bool $microsecondsFallback */ public static function useMicrosecondsFallback($microsecondsFallback = true) { static::$microsecondsFallback = $microsecondsFallback; } /** * Return true if microseconds fallback on PHP < 7.1 and 7.1.3 is * enabled. false if disabled. * * @return bool */ public static function isMicrosecondsFallbackEnabled() { return static::$microsecondsFallback; } /** * Indicates if months should be calculated with overflow. * * @param bool $monthsOverflow * * @return void */ public static function useMonthsOverflow($monthsOverflow = true) { static::$monthsOverflow = $monthsOverflow; } /** * Reset the month overflow behavior. * * @return void */ public static function resetMonthsOverflow() { static::$monthsOverflow = true; } /** * Get the month overflow behavior. * * @return bool */ public static function shouldOverflowMonths() { return static::$monthsOverflow; } /** * Indicates if years should be calculated with overflow. * * @param bool $yearsOverflow * * @return void */ public static function useYearsOverflow($yearsOverflow = true) { static::$yearsOverflow = $yearsOverflow; } /** * Reset the month overflow behavior. * * @return void */ public static function resetYearsOverflow() { static::$yearsOverflow = true; } /** * Get the month overflow behavior. * * @return bool */ public static function shouldOverflowYears() { return static::$yearsOverflow; } /** * Get the month comparison default behavior. * * @return bool */ public static function compareYearWithMonth($compareYearWithMonth = true) { static::$compareYearWithMonth = $compareYearWithMonth; } /** * Get the month comparison default behavior. * * @return bool */ public static function shouldCompareYearWithMonth() { return static::$compareYearWithMonth; } /** * Creates a DateTimeZone from a string, DateTimeZone or integer offset. * * @param \DateTimeZone|string|int|null $object * * @throws \InvalidArgumentException * * @return \DateTimeZone */ protected static function safeCreateDateTimeZone($object) { if ($object === null) { // Don't return null... avoid Bug #52063 in PHP <5.3.6 return new DateTimeZone(date_default_timezone_get()); } if ($object instanceof DateTimeZone) { return $object; } if (is_numeric($object)) { $tzName = timezone_name_from_abbr(null, $object * 3600, true); if ($tzName === false) { throw new InvalidArgumentException('Unknown or bad timezone ('.$object.')'); } $object = $tzName; } $tz = @timezone_open($object = (string) $object); if ($tz !== false) { return $tz; } // Work-around for a bug fixed in PHP 5.5.10 https://bugs.php.net/bug.php?id=45528 // See: https://stackoverflow.com/q/14068594/2646927 // @codeCoverageIgnoreStart if (strpos($object, ':') !== false) { try { return static::createFromFormat('O', $object)->getTimezone(); } catch (InvalidArgumentException $e) { // } } // @codeCoverageIgnoreEnd throw new InvalidArgumentException('Unknown or bad timezone ('.$object.')'); } /////////////////////////////////////////////////////////////////// //////////////////////////// CONSTRUCTORS ///////////////////////// /////////////////////////////////////////////////////////////////// /** * Create a new Carbon instance. * * Please see the testing aids section (specifically static::setTestNow()) * for more on the possibility of this constructor returning a test instance. * * @param string|null $time * @param \DateTimeZone|string|null $tz */ public function __construct($time = null, $tz = null) { // If the class has a test now set and we are trying to create a now() // instance then override as required $isNow = empty($time) || $time === 'now'; if (static::hasTestNow() && ($isNow || static::hasRelativeKeywords($time))) { $testInstance = clone static::getTestNow(); //shift the time according to the given time zone if ($tz !== null && $tz !== static::getTestNow()->getTimezone()) { $testInstance->setTimezone($tz); } else { $tz = $testInstance->getTimezone(); } if (static::hasRelativeKeywords($time)) { $testInstance->modify($time); } $time = $testInstance->format(static::MOCK_DATETIME_FORMAT); } $timezone = static::safeCreateDateTimeZone($tz); // @codeCoverageIgnoreStart if ($isNow && !isset($testInstance) && static::isMicrosecondsFallbackEnabled() && ( version_compare(PHP_VERSION, '7.1.0-dev', '<') || version_compare(PHP_VERSION, '7.1.3-dev', '>=') && version_compare(PHP_VERSION, '7.1.4-dev', '<') ) ) { // Get microseconds from microtime() if "now" asked and PHP < 7.1 and PHP 7.1.3 if fallback enabled. list($microTime, $timeStamp) = explode(' ', microtime()); $dateTime = new DateTime('now', $timezone); $dateTime->setTimestamp($timeStamp); // Use the timestamp returned by microtime as now can happen in the next second $time = $dateTime->format(static::DEFAULT_TO_STRING_FORMAT).substr($microTime, 1, 7); } // @codeCoverageIgnoreEnd // Work-around for PHP bug https://bugs.php.net/bug.php?id=67127 if (strpos((string) .1, '.') === false) { $locale = setlocale(LC_NUMERIC, '0'); setlocale(LC_NUMERIC, 'C'); } parent::__construct($time, $timezone); if (isset($locale)) { setlocale(LC_NUMERIC, $locale); } static::setLastErrors(parent::getLastErrors()); } /** * Create a Carbon instance from a DateTime one. * * @param \DateTime|\DateTimeInterface $date * * @return static */ public static function instance($date) { if ($date instanceof static) { return clone $date; } static::expectDateTime($date); return new static($date->format('Y-m-d H:i:s.u'), $date->getTimezone()); } /** * Create a carbon instance from a string. * * This is an alias for the constructor that allows better fluent syntax * as it allows you to do Carbon::parse('Monday next week')->fn() rather * than (new Carbon('Monday next week'))->fn(). * * @param string|null $time * @param \DateTimeZone|string|null $tz * * @return static */ public static function parse($time = null, $tz = null) { return new static($time, $tz); } /** * Get a Carbon instance for the current date and time. * * @param \DateTimeZone|string|null $tz * * @return static */ public static function now($tz = null) { return new static(null, $tz); } /** * Create a Carbon instance for today. * * @param \DateTimeZone|string|null $tz * * @return static */ public static function today($tz = null) { return static::parse('today', $tz); } /** * Create a Carbon instance for tomorrow. * * @param \DateTimeZone|string|null $tz * * @return static */ public static function tomorrow($tz = null) { return static::parse('tomorrow', $tz); } /** * Create a Carbon instance for yesterday. * * @param \DateTimeZone|string|null $tz * * @return static */ public static function yesterday($tz = null) { return static::parse('yesterday', $tz); } /** * Create a Carbon instance for the greatest supported date. * * @return static */ public static function maxValue() { if (self::$PHPIntSize === 4) { // 32 bit return static::createFromTimestamp(PHP_INT_MAX); // @codeCoverageIgnore } // 64 bit return static::create(9999, 12, 31, 23, 59, 59); } /** * Create a Carbon instance for the lowest supported date. * * @return static */ public static function minValue() { if (self::$PHPIntSize === 4) { // 32 bit return static::createFromTimestamp(~PHP_INT_MAX); // @codeCoverageIgnore } // 64 bit return static::create(1, 1, 1, 0, 0, 0); } /** * Create a new Carbon instance from a specific date and time. * * If any of $year, $month or $day are set to null their now() values will * be used. * * If $hour is null it will be set to its now() value and the default * values for $minute and $second will be their now() values. * * If $hour is not null then the default values for $minute and $second * will be 0. * * @param int|null $year * @param int|null $month * @param int|null $day * @param int|null $hour * @param int|null $minute * @param int|null $second * @param \DateTimeZone|string|null $tz * * @throws \InvalidArgumentException * * @return static */ public static function create($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) { $now = static::hasTestNow() ? static::getTestNow() : static::now($tz); $defaults = array_combine(array( 'year', 'month', 'day', 'hour', 'minute', 'second', ), explode('-', $now->format('Y-n-j-G-i-s'))); $year = $year === null ? $defaults['year'] : $year; $month = $month === null ? $defaults['month'] : $month; $day = $day === null ? $defaults['day'] : $day; if ($hour === null) { $hour = $defaults['hour']; $minute = $minute === null ? $defaults['minute'] : $minute; $second = $second === null ? $defaults['second'] : $second; } else { $minute = $minute === null ? 0 : $minute; $second = $second === null ? 0 : $second; } $fixYear = null; if ($year < 0) { $fixYear = $year; $year = 0; } elseif ($year > 9999) { $fixYear = $year - 9999; $year = 9999; } $instance = static::createFromFormat('!Y-n-j G:i:s', sprintf('%s-%s-%s %s:%02s:%02s', $year, $month, $day, $hour, $minute, $second), $tz); if ($fixYear !== null) { $instance->addYears($fixYear); } return $instance; } /** * Create a new safe Carbon instance from a specific date and time. * * If any of $year, $month or $day are set to null their now() values will * be used. * * If $hour is null it will be set to its now() value and the default * values for $minute and $second will be their now() values. * * If $hour is not null then the default values for $minute and $second * will be 0. * * If one of the set values is not valid, an \InvalidArgumentException * will be thrown. * * @param int|null $year * @param int|null $month * @param int|null $day * @param int|null $hour * @param int|null $minute * @param int|null $second * @param \DateTimeZone|string|null $tz * * @throws \Carbon\Exceptions\InvalidDateException|\InvalidArgumentException * * @return static */ public static function createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) { $fields = array( 'year' => array(0, 9999), 'month' => array(0, 12), 'day' => array(0, 31), 'hour' => array(0, 24), 'minute' => array(0, 59), 'second' => array(0, 59), ); foreach ($fields as $field => $range) { if ($$field !== null && (!is_int($$field) || $$field < $range[0] || $$field > $range[1])) { throw new InvalidDateException($field, $$field); } } $instance = static::create($year, $month, $day, $hour, $minute, $second, $tz); foreach (array_reverse($fields) as $field => $range) { if ($$field !== null && (!is_int($$field) || $$field !== $instance->$field)) { throw new InvalidDateException($field, $$field); } } return $instance; } /** * Create a Carbon instance from just a date. The time portion is set to now. * * @param int|null $year * @param int|null $month * @param int|null $day * @param \DateTimeZone|string|null $tz * * @throws \InvalidArgumentException * * @return static */ public static function createFromDate($year = null, $month = null, $day = null, $tz = null) { return static::create($year, $month, $day, null, null, null, $tz); } /** * Create a Carbon instance from just a date. The time portion is set to midnight. * * @param int|null $year * @param int|null $month * @param int|null $day * @param \DateTimeZone|string|null $tz * * @return static */ public static function createMidnightDate($year = null, $month = null, $day = null, $tz = null) { return static::create($year, $month, $day, 0, 0, 0, $tz); } /** * Create a Carbon instance from just a time. The date portion is set to today. * * @param int|null $hour * @param int|null $minute * @param int|null $second * @param \DateTimeZone|string|null $tz * * @throws \InvalidArgumentException * * @return static */ public static function createFromTime($hour = null, $minute = null, $second = null, $tz = null) { return static::create(null, null, null, $hour, $minute, $second, $tz); } /** * Create a Carbon instance from a time string. The date portion is set to today. * * @param string $time * @param \DateTimeZone|string|null $tz * * @throws \InvalidArgumentException * * @return static */ public static function createFromTimeString($time, $tz = null) { return static::today($tz)->setTimeFromTimeString($time); } private static function createFromFormatAndTimezone($format, $time, $tz) { return $tz !== null ? parent::createFromFormat($format, $time, static::safeCreateDateTimeZone($tz)) : parent::createFromFormat($format, $time); } /** * Create a Carbon instance from a specific format. * * @param string $format Datetime format * @param string $time * @param \DateTimeZone|string|null $tz * * @throws InvalidArgumentException * * @return static */ public static function createFromFormat($format, $time, $tz = null) { // First attempt to create an instance, so that error messages are based on the unmodified format. $date = self::createFromFormatAndTimezone($format, $time, $tz); $lastErrors = parent::getLastErrors(); if (($mock = static::getTestNow()) && ($date instanceof DateTime || $date instanceof DateTimeInterface)) { // Set timezone from mock if custom timezone was neither given directly nor as a part of format. // First let's skip the part that will be ignored by the parser. $nonEscaped = '(?getTimezone(); } // Prepend mock datetime only if the format does not contain non escaped unix epoch reset flag. if (!preg_match("/{$nonEscaped}[!|]/", $format)) { $format = static::MOCK_DATETIME_FORMAT.' '.$format; $time = $mock->format(static::MOCK_DATETIME_FORMAT).' '.$time; } // Regenerate date from the modified format to base result on the mocked instance instead of now. $date = self::createFromFormatAndTimezone($format, $time, $tz); } if ($date instanceof DateTime || $date instanceof DateTimeInterface) { $instance = static::instance($date); $instance::setLastErrors($lastErrors); return $instance; } throw new InvalidArgumentException(implode(PHP_EOL, $lastErrors['errors'])); } /** * Set last errors. * * @param array $lastErrors * * @return void */ private static function setLastErrors(array $lastErrors) { static::$lastErrors = $lastErrors; } /** * {@inheritdoc} */ public static function getLastErrors() { return static::$lastErrors; } /** * Create a Carbon instance from a timestamp. * * @param int $timestamp * @param \DateTimeZone|string|null $tz * * @return static */ public static function createFromTimestamp($timestamp, $tz = null) { return static::today($tz)->setTimestamp($timestamp); } /** * Create a Carbon instance from a timestamp in milliseconds. * * @param int $timestamp * @param \DateTimeZone|string|null $tz * * @return static */ public static function createFromTimestampMs($timestamp, $tz = null) { return static::createFromFormat('U.u', sprintf('%F', $timestamp / 1000)) ->setTimezone($tz); } /** * Create a Carbon instance from an UTC timestamp. * * @param int $timestamp * * @return static */ public static function createFromTimestampUTC($timestamp) { return new static('@'.$timestamp); } /** * Make a Carbon instance from given variable if possible. * * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals * and recurrences). Throw an exception for invalid format, but otherwise return null. * * @param mixed $var * * @return static|null */ public static function make($var) { if ($var instanceof DateTime || $var instanceof DateTimeInterface) { return static::instance($var); } if (is_string($var)) { $var = trim($var); $first = substr($var, 0, 1); if (is_string($var) && $first !== 'P' && $first !== 'R' && preg_match('/[a-z0-9]/i', $var)) { return static::parse($var); } } } /** * Get a copy of the instance. * * @return static */ public function copy() { return clone $this; } /** * Returns a present instance in the same timezone. * * @return static */ public function nowWithSameTz() { return static::now($this->getTimezone()); } /** * Throws an exception if the given object is not a DateTime and does not implement DateTimeInterface * and not in $other. * * @param mixed $date * @param string|array $other * * @throws \InvalidArgumentException */ protected static function expectDateTime($date, $other = array()) { $message = 'Expected '; foreach ((array) $other as $expect) { $message .= "{$expect}, "; } if (!$date instanceof DateTime && !$date instanceof DateTimeInterface) { throw new InvalidArgumentException( $message.'DateTime or DateTimeInterface, '. (is_object($date) ? get_class($date) : gettype($date)).' given' ); } } /** * Return the Carbon instance passed through, a now instance in the same timezone * if null given or parse the input if string given. * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * * @return static */ protected function resolveCarbon($date = null) { if (!$date) { return $this->nowWithSameTz(); } if (is_string($date)) { return static::parse($date, $this->getTimezone()); } static::expectDateTime($date, array('null', 'string')); return $date instanceof self ? $date : static::instance($date); } /////////////////////////////////////////////////////////////////// ///////////////////////// GETTERS AND SETTERS ///////////////////// /////////////////////////////////////////////////////////////////// /** * Get a part of the Carbon object * * @param string $name * * @throws \InvalidArgumentException * * @return string|int|bool|\DateTimeZone */ public function __get($name) { static $formats = array( 'year' => 'Y', 'yearIso' => 'o', 'month' => 'n', 'day' => 'j', 'hour' => 'G', 'minute' => 'i', 'second' => 's', 'micro' => 'u', 'dayOfWeek' => 'w', 'dayOfWeekIso' => 'N', 'dayOfYear' => 'z', 'weekOfYear' => 'W', 'daysInMonth' => 't', 'timestamp' => 'U', 'englishDayOfWeek' => 'l', 'shortEnglishDayOfWeek' => 'D', 'englishMonth' => 'F', 'shortEnglishMonth' => 'M', 'localeDayOfWeek' => '%A', 'shortLocaleDayOfWeek' => '%a', 'localeMonth' => '%B', 'shortLocaleMonth' => '%b', ); switch (true) { case isset($formats[$name]): $format = $formats[$name]; $method = substr($format, 0, 1) === '%' ? 'formatLocalized' : 'format'; $value = $this->$method($format); return is_numeric($value) ? (int) $value : $value; case $name === 'weekOfMonth': return (int) ceil($this->day / static::DAYS_PER_WEEK); case $name === 'weekNumberInMonth': return (int) ceil(($this->day + $this->copy()->startOfMonth()->dayOfWeek - 1) / static::DAYS_PER_WEEK); case $name === 'age': return $this->diffInYears(); case $name === 'quarter': return (int) ceil($this->month / static::MONTHS_PER_QUARTER); case $name === 'offset': return $this->getOffset(); case $name === 'offsetHours': return $this->getOffset() / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR; case $name === 'dst': return $this->format('I') === '1'; case $name === 'local': return $this->getOffset() === $this->copy()->setTimezone(date_default_timezone_get())->getOffset(); case $name === 'utc': return $this->getOffset() === 0; case $name === 'timezone' || $name === 'tz': return $this->getTimezone(); case $name === 'timezoneName' || $name === 'tzName': return $this->getTimezone()->getName(); default: throw new InvalidArgumentException(sprintf("Unknown getter '%s'", $name)); } } /** * Check if an attribute exists on the object * * @param string $name * * @return bool */ public function __isset($name) { try { $this->__get($name); } catch (InvalidArgumentException $e) { return false; } return true; } /** * Set a part of the Carbon object * * @param string $name * @param string|int|\DateTimeZone $value * * @throws \InvalidArgumentException * * @return void */ public function __set($name, $value) { switch ($name) { case 'year': case 'month': case 'day': case 'hour': case 'minute': case 'second': list($year, $month, $day, $hour, $minute, $second) = explode('-', $this->format('Y-n-j-G-i-s')); $$name = $value; $this->setDateTime($year, $month, $day, $hour, $minute, $second); break; case 'timestamp': parent::setTimestamp($value); break; case 'timezone': case 'tz': $this->setTimezone($value); break; default: throw new InvalidArgumentException(sprintf("Unknown setter '%s'", $name)); } } /** * Set the instance's year * * @param int $value * * @return static */ public function year($value) { $this->year = $value; return $this; } /** * Set the instance's month * * @param int $value * * @return static */ public function month($value) { $this->month = $value; return $this; } /** * Set the instance's day * * @param int $value * * @return static */ public function day($value) { $this->day = $value; return $this; } /** * Set the instance's hour * * @param int $value * * @return static */ public function hour($value) { $this->hour = $value; return $this; } /** * Set the instance's minute * * @param int $value * * @return static */ public function minute($value) { $this->minute = $value; return $this; } /** * Set the instance's second * * @param int $value * * @return static */ public function second($value) { $this->second = $value; return $this; } /** * Sets the current date of the DateTime object to a different date. * Calls modify as a workaround for a php bug * * @param int $year * @param int $month * @param int $day * * @return static * * @see https://github.com/briannesbitt/Carbon/issues/539 * @see https://bugs.php.net/bug.php?id=63863 */ public function setDate($year, $month, $day) { $this->modify('+0 day'); return parent::setDate($year, $month, $day); } /** * Set the date and time all together * * @param int $year * @param int $month * @param int $day * @param int $hour * @param int $minute * @param int $second * * @return static */ public function setDateTime($year, $month, $day, $hour, $minute, $second = 0) { return $this->setDate($year, $month, $day)->setTime($hour, $minute, $second); } /** * Set the time by time string * * @param string $time * * @return static */ public function setTimeFromTimeString($time) { if (strpos($time, ':') === false) { $time .= ':0'; } return $this->modify($time); } /** * Set the instance's timestamp * * @param int $value * * @return static */ public function timestamp($value) { return $this->setTimestamp($value); } /** * Alias for setTimezone() * * @param \DateTimeZone|string $value * * @return static */ public function timezone($value) { return $this->setTimezone($value); } /** * Alias for setTimezone() * * @param \DateTimeZone|string $value * * @return static */ public function tz($value) { return $this->setTimezone($value); } /** * Set the instance's timezone from a string or object * * @param \DateTimeZone|string $value * * @return static */ public function setTimezone($value) { parent::setTimezone(static::safeCreateDateTimeZone($value)); // https://bugs.php.net/bug.php?id=72338 // just workaround on this bug $this->getTimestamp(); return $this; } /** * Set the year, month, and date for this instance to that of the passed instance. * * @param \Carbon\Carbon|\DateTimeInterface $date * * @return static */ public function setDateFrom($date) { $date = static::instance($date); $this->setDate($date->year, $date->month, $date->day); return $this; } /** * Set the hour, day, and time for this instance to that of the passed instance. * * @param \Carbon\Carbon|\DateTimeInterface $date * * @return static */ public function setTimeFrom($date) { $date = static::instance($date); $this->setTime($date->hour, $date->minute, $date->second); return $this; } /** * Get the days of the week * * @return array */ public static function getDays() { return static::$days; } /////////////////////////////////////////////////////////////////// /////////////////////// WEEK SPECIAL DAYS ///////////////////////// /////////////////////////////////////////////////////////////////// /** * Get the first day of week * * @return int */ public static function getWeekStartsAt() { return static::$weekStartsAt; } /** * Set the first day of week * * @param int $day week start day * * @throws InvalidArgumentException * * @return void */ public static function setWeekStartsAt($day) { if ($day > static::SATURDAY || $day < static::SUNDAY) { throw new InvalidArgumentException('Day of a week should be greater than or equal to 0 and less than or equal to 6.'); } static::$weekStartsAt = $day; } /** * Get the last day of week * * @return int */ public static function getWeekEndsAt() { return static::$weekEndsAt; } /** * Set the last day of week * * @param int $day * * @throws InvalidArgumentException * * @return void */ public static function setWeekEndsAt($day) { if ($day > static::SATURDAY || $day < static::SUNDAY) { throw new InvalidArgumentException('Day of a week should be greater than or equal to 0 and less than or equal to 6.'); } static::$weekEndsAt = $day; } /** * Get weekend days * * @return array */ public static function getWeekendDays() { return static::$weekendDays; } /** * Set weekend days * * @param array $days * * @return void */ public static function setWeekendDays($days) { static::$weekendDays = $days; } /** * get midday/noon hour * * @return int */ public static function getMidDayAt() { return static::$midDayAt; } /** * Set midday/noon hour * * @param int $hour midday hour * * @return void */ public static function setMidDayAt($hour) { static::$midDayAt = $hour; } /////////////////////////////////////////////////////////////////// ///////////////////////// TESTING AIDS //////////////////////////// /////////////////////////////////////////////////////////////////// /** * Set a Carbon instance (real or mock) to be returned when a "now" * instance is created. The provided instance will be returned * specifically under the following conditions: * - A call to the static now() method, ex. Carbon::now() * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') * - When a string containing the desired time is passed to Carbon::parse(). * * Note the timezone parameter was left out of the examples above and * has no affect as the mock value will be returned regardless of its value. * * To clear the test instance call this method using the default * parameter of null. * * @param \Carbon\Carbon|null $testNow real or mock Carbon instance * @param \Carbon\Carbon|string|null $testNow */ public static function setTestNow($testNow = null) { static::$testNow = is_string($testNow) ? static::parse($testNow) : $testNow; } /** * Get the Carbon instance (real or mock) to be returned when a "now" * instance is created. * * @return static the current instance used for testing */ public static function getTestNow() { return static::$testNow; } /** * Determine if there is a valid test instance set. A valid test instance * is anything that is not null. * * @return bool true if there is a test instance, otherwise false */ public static function hasTestNow() { return static::getTestNow() !== null; } /** * Determine if a time string will produce a relative date. * * @param string $time * * @return bool true if time match a relative date, false if absolute or invalid time string */ public static function hasRelativeKeywords($time) { if (strtotime($time) === false) { return false; } $date1 = new DateTime('2000-01-01T00:00:00Z'); $date1->modify($time); $date2 = new DateTime('2001-12-25T00:00:00Z'); $date2->modify($time); return $date1 != $date2; } /////////////////////////////////////////////////////////////////// /////////////////////// LOCALIZATION ////////////////////////////// /////////////////////////////////////////////////////////////////// /** * Initialize the translator instance if necessary. * * @return \Symfony\Component\Translation\TranslatorInterface */ protected static function translator() { if (static::$translator === null) { static::$translator = Translator::get(); } return static::$translator; } /** * Get the translator instance in use * * @return \Symfony\Component\Translation\TranslatorInterface */ public static function getTranslator() { return static::translator(); } /** * Set the translator instance to use * * @param \Symfony\Component\Translation\TranslatorInterface $translator * * @return void */ public static function setTranslator(TranslatorInterface $translator) { static::$translator = $translator; } /** * Get the current translator locale * * @return string */ public static function getLocale() { return static::translator()->getLocale(); } /** * Set the current translator locale and indicate if the source locale file exists * * @param string $locale locale ex. en * * @return bool */ public static function setLocale($locale) { return static::translator()->setLocale($locale) !== false; } /** * Set the current locale to the given, execute the passed function, reset the locale to previous one, * then return the result of the closure (or null if the closure was void). * * @param string $locale locale ex. en * * @return mixed */ public static function executeWithLocale($locale, $func) { $currentLocale = static::getLocale(); $result = call_user_func($func, static::setLocale($locale) ? static::getLocale() : false, static::translator()); static::setLocale($currentLocale); return $result; } /** * Returns true if the given locale is internally supported and has short-units support. * Support is considered enabled if either year, day or hour has a short variant translated. * * @param string $locale locale ex. en * * @return bool */ public static function localeHasShortUnits($locale) { return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { return $newLocale && ( ($y = $translator->trans('y')) !== 'y' && $y !== $translator->trans('year') ) || ( ($y = $translator->trans('d')) !== 'd' && $y !== $translator->trans('day') ) || ( ($y = $translator->trans('h')) !== 'h' && $y !== $translator->trans('hour') ); }); } /** * Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). * Support is considered enabled if the 4 sentences are translated in the given locale. * * @param string $locale locale ex. en * * @return bool */ public static function localeHasDiffSyntax($locale) { return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { return $newLocale && $translator->trans('ago') !== 'ago' && $translator->trans('from_now') !== 'from_now' && $translator->trans('before') !== 'before' && $translator->trans('after') !== 'after'; }); } /** * Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). * Support is considered enabled if the 3 words are translated in the given locale. * * @param string $locale locale ex. en * * @return bool */ public static function localeHasDiffOneDayWords($locale) { return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { return $newLocale && $translator->trans('diff_now') !== 'diff_now' && $translator->trans('diff_yesterday') !== 'diff_yesterday' && $translator->trans('diff_tomorrow') !== 'diff_tomorrow'; }); } /** * Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). * Support is considered enabled if the 2 words are translated in the given locale. * * @param string $locale locale ex. en * * @return bool */ public static function localeHasDiffTwoDayWords($locale) { return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { return $newLocale && $translator->trans('diff_before_yesterday') !== 'diff_before_yesterday' && $translator->trans('diff_after_tomorrow') !== 'diff_after_tomorrow'; }); } /** * Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). * Support is considered enabled if the 4 sentences are translated in the given locale. * * @param string $locale locale ex. en * * @return bool */ public static function localeHasPeriodSyntax($locale) { return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { return $newLocale && $translator->trans('period_recurrences') !== 'period_recurrences' && $translator->trans('period_interval') !== 'period_interval' && $translator->trans('period_start_date') !== 'period_start_date' && $translator->trans('period_end_date') !== 'period_end_date'; }); } /** * Returns the list of internally available locales and already loaded custom locales. * (It will ignore custom translator dynamic loading.) * * @return array */ public static function getAvailableLocales() { $translator = static::translator(); $locales = array(); if ($translator instanceof Translator) { foreach (glob(__DIR__.'/Lang/*.php') as $file) { $locales[] = substr($file, strrpos($file, '/') + 1, -4); } $locales = array_unique(array_merge($locales, array_keys($translator->getMessages()))); } return $locales; } /////////////////////////////////////////////////////////////////// /////////////////////// STRING FORMATTING ///////////////////////// /////////////////////////////////////////////////////////////////// /** * Set if UTF8 will be used for localized date/time * * @param bool $utf8 */ public static function setUtf8($utf8) { static::$utf8 = $utf8; } /** * Format the instance with the current locale. You can set the current * locale using setlocale() http://php.net/setlocale. * * @param string $format * * @return string */ public function formatLocalized($format) { // Check for Windows to find and replace the %e modifier correctly. if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $format = preg_replace('#(?toDateTimeString())); return static::$utf8 ? utf8_encode($formatted) : $formatted; } /** * Reset the format used to the default when type juggling a Carbon instance to a string * * @return void */ public static function resetToStringFormat() { static::setToStringFormat(static::DEFAULT_TO_STRING_FORMAT); } /** * Set the default format used when type juggling a Carbon instance to a string * * @param string|Closure $format * * @return void */ public static function setToStringFormat($format) { static::$toStringFormat = $format; } /** * Format the instance as a string using the set format * * @return string */ public function __toString() { $format = static::$toStringFormat; return $this->format($format instanceof Closure ? $format($this) : $format); } /** * Format the instance as date * * @return string */ public function toDateString() { return $this->format('Y-m-d'); } /** * Format the instance as a readable date * * @return string */ public function toFormattedDateString() { return $this->format('M j, Y'); } /** * Format the instance as time * * @return string */ public function toTimeString() { return $this->format('H:i:s'); } /** * Format the instance as date and time * * @return string */ public function toDateTimeString() { return $this->format('Y-m-d H:i:s'); } /** * Format the instance as date and time T-separated with no timezone * * @example * ``` * echo Carbon::now()->toDateTimeLocalString(); * ``` * * @return string */ public function toDateTimeLocalString() { return $this->format('Y-m-d\TH:i:s'); } /** * Format the instance with day, date and time * * @return string */ public function toDayDateTimeString() { return $this->format('D, M j, Y g:i A'); } /** * Format the instance as ATOM * * @return string */ public function toAtomString() { return $this->format(static::ATOM); } /** * Format the instance as COOKIE * * @return string */ public function toCookieString() { return $this->format(static::COOKIE); } /** * Format the instance as ISO8601 * * @return string */ public function toIso8601String() { return $this->toAtomString(); } /** * Format the instance as RFC822 * * @return string */ public function toRfc822String() { return $this->format(static::RFC822); } /** * Convert the instance to UTC and return as Zulu ISO8601 * * @return string */ public function toIso8601ZuluString() { return $this->copy()->setTimezone('UTC')->format('Y-m-d\TH:i:s\Z'); } /** * Format the instance as RFC850 * * @return string */ public function toRfc850String() { return $this->format(static::RFC850); } /** * Format the instance as RFC1036 * * @return string */ public function toRfc1036String() { return $this->format(static::RFC1036); } /** * Format the instance as RFC1123 * * @return string */ public function toRfc1123String() { return $this->format(static::RFC1123); } /** * Format the instance as RFC2822 * * @return string */ public function toRfc2822String() { return $this->format(static::RFC2822); } /** * Format the instance as RFC3339 * * @return string */ public function toRfc3339String() { return $this->format(static::RFC3339); } /** * Format the instance as RSS * * @return string */ public function toRssString() { return $this->format(static::RSS); } /** * Format the instance as W3C * * @return string */ public function toW3cString() { return $this->format(static::W3C); } /** * Format the instance as RFC7231 * * @return string */ public function toRfc7231String() { return $this->copy() ->setTimezone('GMT') ->format(static::RFC7231_FORMAT); } /** * Get default array representation * * @return array */ public function toArray() { return array( 'year' => $this->year, 'month' => $this->month, 'day' => $this->day, 'dayOfWeek' => $this->dayOfWeek, 'dayOfYear' => $this->dayOfYear, 'hour' => $this->hour, 'minute' => $this->minute, 'second' => $this->second, 'micro' => $this->micro, 'timestamp' => $this->timestamp, 'formatted' => $this->format(self::DEFAULT_TO_STRING_FORMAT), 'timezone' => $this->timezone, ); } /** * Get default object representation. * * @example * ``` * var_dump(Carbon::now()->toObject()); * ``` * * @return object */ public function toObject() { return (object) $this->toArray(); } /** * Returns english human readable complete date string. * * @example * ``` * echo Carbon::now()->toString(); * ``` * * @return string */ public function toString() { return $this->format('D M j Y H:i:s \G\M\TO'); } /** * Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z, if $keepOffset truthy, offset will be kept: * 1977-04-22T01:00:00-05:00). * * @example * ``` * echo Carbon::now('America/Toronto')->toISOString() . "\n"; * echo Carbon::now('America/Toronto')->toISOString(true) . "\n"; * ``` * * @param bool $keepOffset Pass true to keep the date offset. Else forced to UTC. * * @return null|string */ public function toISOString($keepOffset = false) { if ($this->year === 0) { return null; } $year = $this->year < 0 || $this->year > 9999 ? ($this->year < 0 ? '-' : '+').str_pad(abs($this->year), 6, '0', STR_PAD_LEFT) : str_pad($this->year, 4, '0', STR_PAD_LEFT); $tz = $keepOffset ? $this->format('P') : 'Z'; $date = $keepOffset ? $this : $this->copy()->setTimezone('UTC'); return $year.$date->format('-m-d\TH:i:s.u').$tz; } /** * Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z) with UTC timezone. * * @example * ``` * echo Carbon::now('America/Toronto')->toJSON(); * ``` * * @return null|string */ public function toJSON() { return $this->toISOString(); } /** * Return native DateTime PHP object matching the current instance. * * @example * ``` * var_dump(Carbon::now()->toDateTime()); * ``` * * @return DateTime */ public function toDateTime() { return new DateTime($this->format('Y-m-d H:i:s.u'), $this->getTimezone()); } /** * @alias toDateTime * * Return native DateTime PHP object matching the current instance. * * @example * ``` * var_dump(Carbon::now()->toDate()); * ``` * * @return DateTime */ public function toDate() { return $this->toDateTime(); } /////////////////////////////////////////////////////////////////// ////////////////////////// COMPARISONS //////////////////////////// /////////////////////////////////////////////////////////////////// /** * Determines if the instance is equal to another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @return bool */ public function eq($date) { return $this == $date; } /** * Determines if the instance is equal to another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see eq() * * @return bool */ public function equalTo($date) { return $this->eq($date); } /** * Determines if the instance is not equal to another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @return bool */ public function ne($date) { return !$this->eq($date); } /** * Determines if the instance is not equal to another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see ne() * * @return bool */ public function notEqualTo($date) { return $this->ne($date); } /** * Determines if the instance is greater (after) than another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @return bool */ public function gt($date) { return $this > $date; } /** * Determines if the instance is greater (after) than another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see gt() * * @return bool */ public function greaterThan($date) { return $this->gt($date); } /** * Determines if the instance is greater (after) than another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see gt() * * @return bool */ public function isAfter($date) { return $this->gt($date); } /** * Determines if the instance is greater (after) than or equal to another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @return bool */ public function gte($date) { return $this >= $date; } /** * Determines if the instance is greater (after) than or equal to another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see gte() * * @return bool */ public function greaterThanOrEqualTo($date) { return $this->gte($date); } /** * Determines if the instance is less (before) than another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @return bool */ public function lt($date) { return $this < $date; } /** * Determines if the instance is less (before) than another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see lt() * * @return bool */ public function lessThan($date) { return $this->lt($date); } /** * Determines if the instance is less (before) than another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see lt() * * @return bool */ public function isBefore($date) { return $this->lt($date); } /** * Determines if the instance is less (before) or equal to another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @return bool */ public function lte($date) { return $this <= $date; } /** * Determines if the instance is less (before) or equal to another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see lte() * * @return bool */ public function lessThanOrEqualTo($date) { return $this->lte($date); } /** * Determines if the instance is between two others * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 * @param bool $equal Indicates if an equal to comparison should be done * * @return bool */ public function between($date1, $date2, $equal = true) { if ($date1->gt($date2)) { $temp = $date1; $date1 = $date2; $date2 = $temp; } if ($equal) { return $this->gte($date1) && $this->lte($date2); } return $this->gt($date1) && $this->lt($date2); } protected function floatDiffInSeconds($date) { $date = $this->resolveCarbon($date); return abs($this->diffInRealSeconds($date, false) + ($date->micro - $this->micro) / 1000000); } /** * Determines if the instance is between two others * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 * @param bool $equal Indicates if a > and < comparison should be used or <= or >= * * @return bool */ public function isBetween($date1, $date2, $equal = true) { return $this->between($date1, $date2, $equal); } /** * Get the closest date from the instance. * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 * * @return static */ public function closest($date1, $date2) { return $this->floatDiffInSeconds($date1) < $this->floatDiffInSeconds($date2) ? $date1 : $date2; } /** * Get the farthest date from the instance. * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 * * @return static */ public function farthest($date1, $date2) { return $this->floatDiffInSeconds($date1) > $this->floatDiffInSeconds($date2) ? $date1 : $date2; } /** * Get the minimum instance between a given instance (default now) and the current instance. * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * * @return static */ public function min($date = null) { $date = $this->resolveCarbon($date); return $this->lt($date) ? $this : $date; } /** * Get the minimum instance between a given instance (default now) and the current instance. * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see min() * * @return static */ public function minimum($date = null) { return $this->min($date); } /** * Get the maximum instance between a given instance (default now) and the current instance. * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * * @return static */ public function max($date = null) { $date = $this->resolveCarbon($date); return $this->gt($date) ? $this : $date; } /** * Get the maximum instance between a given instance (default now) and the current instance. * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see max() * * @return static */ public function maximum($date = null) { return $this->max($date); } /** * Determines if the instance is a weekday. * * @return bool */ public function isWeekday() { return !$this->isWeekend(); } /** * Determines if the instance is a weekend day. * * @return bool */ public function isWeekend() { return in_array($this->dayOfWeek, static::$weekendDays); } /** * Determines if the instance is yesterday. * * @return bool */ public function isYesterday() { return $this->toDateString() === static::yesterday($this->getTimezone())->toDateString(); } /** * Determines if the instance is today. * * @return bool */ public function isToday() { return $this->toDateString() === $this->nowWithSameTz()->toDateString(); } /** * Determines if the instance is tomorrow. * * @return bool */ public function isTomorrow() { return $this->toDateString() === static::tomorrow($this->getTimezone())->toDateString(); } /** * Determines if the instance is within the next week. * * @return bool */ public function isNextWeek() { return $this->weekOfYear === $this->nowWithSameTz()->addWeek()->weekOfYear; } /** * Determines if the instance is within the last week. * * @return bool */ public function isLastWeek() { return $this->weekOfYear === $this->nowWithSameTz()->subWeek()->weekOfYear; } /** * Determines if the instance is within the next quarter. * * @return bool */ public function isNextQuarter() { return $this->quarter === $this->nowWithSameTz()->addQuarter()->quarter; } /** * Determines if the instance is within the last quarter. * * @return bool */ public function isLastQuarter() { return $this->quarter === $this->nowWithSameTz()->subQuarter()->quarter; } /** * Determines if the instance is within the next month. * * @return bool */ public function isNextMonth() { return $this->month === $this->nowWithSameTz()->addMonthNoOverflow()->month; } /** * Determines if the instance is within the last month. * * @return bool */ public function isLastMonth() { return $this->month === $this->nowWithSameTz()->subMonthNoOverflow()->month; } /** * Determines if the instance is within next year. * * @return bool */ public function isNextYear() { return $this->year === $this->nowWithSameTz()->addYear()->year; } /** * Determines if the instance is within the previous year. * * @return bool */ public function isLastYear() { return $this->year === $this->nowWithSameTz()->subYear()->year; } /** * Determines if the instance is in the future, ie. greater (after) than now. * * @return bool */ public function isFuture() { return $this->gt($this->nowWithSameTz()); } /** * Determines if the instance is in the past, ie. less (before) than now. * * @return bool */ public function isPast() { return $this->lt($this->nowWithSameTz()); } /** * Determines if the instance is a leap year. * * @return bool */ public function isLeapYear() { return $this->format('L') === '1'; } /** * Determines if the instance is a long year * * @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates * * @return bool */ public function isLongYear() { return static::create($this->year, 12, 28, 0, 0, 0, $this->tz)->weekOfYear === 53; } /** * Compares the formatted values of the two dates. * * @param string $format The date formats to compare. * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use current day. * * @throws \InvalidArgumentException * * @return bool */ public function isSameAs($format, $date = null) { $date = $date ?: static::now($this->tz); static::expectDateTime($date, 'null'); return $this->format($format) === $date->format($format); } /** * Determines if the instance is in the current year. * * @return bool */ public function isCurrentYear() { return $this->isSameYear(); } /** * Checks if the passed in date is in the same year as the instance year. * * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use current day. * * @return bool */ public function isSameYear($date = null) { return $this->isSameAs('Y', $date); } /** * Determines if the instance is in the current month. * * @return bool */ public function isCurrentQuarter() { return $this->isSameQuarter(); } /** * Checks if the passed in date is in the same quarter as the instance quarter (and year if needed). * * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use current day. * @param bool $ofSameYear Check if it is the same month in the same year. * * @return bool */ public function isSameQuarter($date = null, $ofSameYear = null) { $date = $date ? static::instance($date) : static::now($this->tz); static::expectDateTime($date, 'null'); $ofSameYear = is_null($ofSameYear) ? static::shouldCompareYearWithMonth() : $ofSameYear; return $this->quarter === $date->quarter && (!$ofSameYear || $this->isSameYear($date)); } /** * Determines if the instance is in the current month. * * @param bool $ofSameYear Check if it is the same month in the same year. * * @return bool */ public function isCurrentMonth($ofSameYear = null) { return $this->isSameMonth(null, $ofSameYear); } /** * Checks if the passed in date is in the same month as the instance´s month. * * Note that this defaults to only comparing the month while ignoring the year. * To test if it is the same exact month of the same year, pass in true as the second parameter. * * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use the current date. * @param bool $ofSameYear Check if it is the same month in the same year. * * @return bool */ public function isSameMonth($date = null, $ofSameYear = null) { $ofSameYear = is_null($ofSameYear) ? static::shouldCompareYearWithMonth() : $ofSameYear; return $this->isSameAs($ofSameYear ? 'Y-m' : 'm', $date); } /** * Determines if the instance is in the current day. * * @return bool */ public function isCurrentDay() { return $this->isSameDay(); } /** * Checks if the passed in date is the same exact day as the instance´s day. * * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use the current date. * * @return bool */ public function isSameDay($date = null) { return $this->isSameAs('Y-m-d', $date); } /** * Determines if the instance is in the current hour. * * @return bool */ public function isCurrentHour() { return $this->isSameHour(); } /** * Checks if the passed in date is the same exact hour as the instance´s hour. * * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use the current date. * * @return bool */ public function isSameHour($date = null) { return $this->isSameAs('Y-m-d H', $date); } /** * Determines if the instance is in the current minute. * * @return bool */ public function isCurrentMinute() { return $this->isSameMinute(); } /** * Checks if the passed in date is the same exact minute as the instance´s minute. * * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use the current date. * * @return bool */ public function isSameMinute($date = null) { return $this->isSameAs('Y-m-d H:i', $date); } /** * Determines if the instance is in the current second. * * @return bool */ public function isCurrentSecond() { return $this->isSameSecond(); } /** * Checks if the passed in date is the same exact second as the instance´s second. * * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use the current date. * * @return bool */ public function isSameSecond($date = null) { return $this->isSameAs('Y-m-d H:i:s', $date); } /** * Checks if this day is a specific day of the week. * * @param int $dayOfWeek * * @return bool */ public function isDayOfWeek($dayOfWeek) { return $this->dayOfWeek === $dayOfWeek; } /** * Checks if this day is a Sunday. * * @return bool */ public function isSunday() { return $this->dayOfWeek === static::SUNDAY; } /** * Checks if this day is a Monday. * * @return bool */ public function isMonday() { return $this->dayOfWeek === static::MONDAY; } /** * Checks if this day is a Tuesday. * * @return bool */ public function isTuesday() { return $this->dayOfWeek === static::TUESDAY; } /** * Checks if this day is a Wednesday. * * @return bool */ public function isWednesday() { return $this->dayOfWeek === static::WEDNESDAY; } /** * Checks if this day is a Thursday. * * @return bool */ public function isThursday() { return $this->dayOfWeek === static::THURSDAY; } /** * Checks if this day is a Friday. * * @return bool */ public function isFriday() { return $this->dayOfWeek === static::FRIDAY; } /** * Checks if this day is a Saturday. * * @return bool */ public function isSaturday() { return $this->dayOfWeek === static::SATURDAY; } /** * Check if its the birthday. Compares the date/month values of the two dates. * * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use current day. * * @return bool */ public function isBirthday($date = null) { return $this->isSameAs('md', $date); } /** * Check if today is the last day of the Month * * @return bool */ public function isLastOfMonth() { return $this->day === $this->daysInMonth; } /** * Check if the instance is start of day / midnight. * * @param bool $checkMicroseconds check time at microseconds precision * /!\ Warning, this is not reliable with PHP < 7.1.4 * * @return bool */ public function isStartOfDay($checkMicroseconds = false) { return $checkMicroseconds ? $this->format('H:i:s.u') === '00:00:00.000000' : $this->format('H:i:s') === '00:00:00'; } /** * Check if the instance is end of day. * * @param bool $checkMicroseconds check time at microseconds precision * /!\ Warning, this is not reliable with PHP < 7.1.4 * * @return bool */ public function isEndOfDay($checkMicroseconds = false) { return $checkMicroseconds ? $this->format('H:i:s.u') === '23:59:59.999999' : $this->format('H:i:s') === '23:59:59'; } /** * Check if the instance is start of day / midnight. * * @return bool */ public function isMidnight() { return $this->isStartOfDay(); } /** * Check if the instance is midday. * * @return bool */ public function isMidday() { return $this->format('G:i:s') === static::$midDayAt.':00:00'; } /** * Checks if the (date)time string is in a given format. * * @param string $date * @param string $format * * @return bool */ public static function hasFormat($date, $format) { try { // Try to create a DateTime object. Throws an InvalidArgumentException if the provided time string // doesn't match the format in any way. static::createFromFormat($format, $date); // createFromFormat() is known to handle edge cases silently. // E.g. "1975-5-1" (Y-n-j) will still be parsed correctly when "Y-m-d" is supplied as the format. // To ensure we're really testing against our desired format, perform an additional regex validation. $regex = strtr( preg_quote($format, '/'), static::$regexFormats ); return (bool) preg_match('/^'.$regex.'$/', $date); } catch (InvalidArgumentException $e) { } return false; } /////////////////////////////////////////////////////////////////// /////////////////// ADDITIONS AND SUBTRACTIONS //////////////////// /////////////////////////////////////////////////////////////////// /** * Add centuries to the instance. Positive $value travels forward while * negative $value travels into the past. * * @param int $value * * @return static */ public function addCenturies($value) { return $this->addYears(static::YEARS_PER_CENTURY * $value); } /** * Add a century to the instance * * @param int $value * * @return static */ public function addCentury($value = 1) { return $this->addCenturies($value); } /** * Remove centuries from the instance * * @param int $value * * @return static */ public function subCenturies($value) { return $this->addCenturies(-1 * $value); } /** * Remove a century from the instance * * @param int $value * * @return static */ public function subCentury($value = 1) { return $this->subCenturies($value); } /** * Add years to the instance. Positive $value travel forward while * negative $value travel into the past. * * @param int $value * * @return static */ public function addYears($value) { if ($this->shouldOverflowYears()) { return $this->addYearsWithOverflow($value); } return $this->addYearsNoOverflow($value); } /** * Add a year to the instance * * @param int $value * * @return static */ public function addYear($value = 1) { return $this->addYears($value); } /** * Add years to the instance with no overflow of months * Positive $value travel forward while * negative $value travel into the past. * * @param int $value * * @return static */ public function addYearsNoOverflow($value) { return $this->addMonthsNoOverflow($value * static::MONTHS_PER_YEAR); } /** * Add year with overflow months set to false * * @param int $value * * @return static */ public function addYearNoOverflow($value = 1) { return $this->addYearsNoOverflow($value); } /** * Add years to the instance. * Positive $value travel forward while * negative $value travel into the past. * * @param int $value * * @return static */ public function addYearsWithOverflow($value) { return $this->modify((int) $value.' year'); } /** * Add year with overflow. * * @param int $value * * @return static */ public function addYearWithOverflow($value = 1) { return $this->addYearsWithOverflow($value); } /** * Remove years from the instance. * * @param int $value * * @return static */ public function subYears($value) { return $this->addYears(-1 * $value); } /** * Remove a year from the instance * * @param int $value * * @return static */ public function subYear($value = 1) { return $this->subYears($value); } /** * Remove years from the instance with no month overflow. * * @param int $value * * @return static */ public function subYearsNoOverflow($value) { return $this->subMonthsNoOverflow($value * static::MONTHS_PER_YEAR); } /** * Remove year from the instance with no month overflow * * @param int $value * * @return static */ public function subYearNoOverflow($value = 1) { return $this->subYearsNoOverflow($value); } /** * Remove years from the instance. * * @param int $value * * @return static */ public function subYearsWithOverflow($value) { return $this->subMonthsWithOverflow($value * static::MONTHS_PER_YEAR); } /** * Remove year from the instance. * * @param int $value * * @return static */ public function subYearWithOverflow($value = 1) { return $this->subYearsWithOverflow($value); } /** * Add quarters to the instance. Positive $value travels forward while * negative $value travels into the past. * * @param int $value * * @return static */ public function addQuarters($value) { return $this->addMonths(static::MONTHS_PER_QUARTER * $value); } /** * Add a quarter to the instance * * @param int $value * * @return static */ public function addQuarter($value = 1) { return $this->addQuarters($value); } /** * Remove quarters from the instance * * @param int $value * * @return static */ public function subQuarters($value) { return $this->addQuarters(-1 * $value); } /** * Remove a quarter from the instance * * @param int $value * * @return static */ public function subQuarter($value = 1) { return $this->subQuarters($value); } /** * Add months to the instance. Positive $value travels forward while * negative $value travels into the past. * * @param int $value * * @return static */ public function addMonths($value) { if (static::shouldOverflowMonths()) { return $this->addMonthsWithOverflow($value); } return $this->addMonthsNoOverflow($value); } /** * Add a month to the instance * * @param int $value * * @return static */ public function addMonth($value = 1) { return $this->addMonths($value); } /** * Remove months from the instance * * @param int $value * * @return static */ public function subMonths($value) { return $this->addMonths(-1 * $value); } /** * Remove a month from the instance * * @param int $value * * @return static */ public function subMonth($value = 1) { return $this->subMonths($value); } /** * Add months to the instance. Positive $value travels forward while * negative $value travels into the past. * * @param int $value * * @return static */ public function addMonthsWithOverflow($value) { return $this->modify((int) $value.' month'); } /** * Add a month to the instance * * @param int $value * * @return static */ public function addMonthWithOverflow($value = 1) { return $this->addMonthsWithOverflow($value); } /** * Remove months from the instance * * @param int $value * * @return static */ public function subMonthsWithOverflow($value) { return $this->addMonthsWithOverflow(-1 * $value); } /** * Remove a month from the instance * * @param int $value * * @return static */ public function subMonthWithOverflow($value = 1) { return $this->subMonthsWithOverflow($value); } /** * Add months without overflowing to the instance. Positive $value * travels forward while negative $value travels into the past. * * @param int $value * * @return static */ public function addMonthsNoOverflow($value) { $day = $this->day; $this->modify((int) $value.' month'); if ($day !== $this->day) { $this->modify('last day of previous month'); } return $this; } /** * Add a month with no overflow to the instance * * @param int $value * * @return static */ public function addMonthNoOverflow($value = 1) { return $this->addMonthsNoOverflow($value); } /** * Remove months with no overflow from the instance * * @param int $value * * @return static */ public function subMonthsNoOverflow($value) { return $this->addMonthsNoOverflow(-1 * $value); } /** * Remove a month with no overflow from the instance * * @param int $value * * @return static */ public function subMonthNoOverflow($value = 1) { return $this->subMonthsNoOverflow($value); } /** * Add days to the instance. Positive $value travels forward while * negative $value travels into the past. * * @param int $value * * @return static */ public function addDays($value) { return $this->modify((int) $value.' day'); } /** * Add a day to the instance * * @param int $value * * @return static */ public function addDay($value = 1) { return $this->addDays($value); } /** * Remove days from the instance * * @param int $value * * @return static */ public function subDays($value) { return $this->addDays(-1 * $value); } /** * Remove a day from the instance * * @param int $value * * @return static */ public function subDay($value = 1) { return $this->subDays($value); } /** * Add weekdays to the instance. Positive $value travels forward while * negative $value travels into the past. * * @param int $value * * @return static */ public function addWeekdays($value) { // Fix for weekday bug https://bugs.php.net/bug.php?id=54909 $t = $this->toTimeString(); $this->modify((int) $value.' weekday'); return $this->setTimeFromTimeString($t); } /** * Add a weekday to the instance * * @param int $value * * @return static */ public function addWeekday($value = 1) { return $this->addWeekdays($value); } /** * Remove weekdays from the instance * * @param int $value * * @return static */ public function subWeekdays($value) { return $this->addWeekdays(-1 * $value); } /** * Remove a weekday from the instance * * @param int $value * * @return static */ public function subWeekday($value = 1) { return $this->subWeekdays($value); } /** * Add weeks to the instance. Positive $value travels forward while * negative $value travels into the past. * * @param int $value * * @return static */ public function addWeeks($value) { return $this->modify((int) $value.' week'); } /** * Add a week to the instance * * @param int $value * * @return static */ public function addWeek($value = 1) { return $this->addWeeks($value); } /** * Remove weeks to the instance * * @param int $value * * @return static */ public function subWeeks($value) { return $this->addWeeks(-1 * $value); } /** * Remove a week from the instance * * @param int $value * * @return static */ public function subWeek($value = 1) { return $this->subWeeks($value); } /** * Add hours to the instance. Positive $value travels forward while * negative $value travels into the past. * * @param int $value * * @return static */ public function addHours($value) { return $this->modify((int) $value.' hour'); } /** * Add hours to the instance using timestamp. Positive $value travels * forward while negative $value travels into the past. * * @param int $value * * @return static */ public function addRealHours($value) { return $this->addRealMinutes($value * static::MINUTES_PER_HOUR); } /** * Add an hour to the instance. * * @param int $value * * @return static */ public function addHour($value = 1) { return $this->addHours($value); } /** * Add an hour to the instance using timestamp. * * @param int $value * * @return static */ public function addRealHour($value = 1) { return $this->addRealHours($value); } /** * Remove hours from the instance. * * @param int $value * * @return static */ public function subHours($value) { return $this->addHours(-1 * $value); } /** * Remove hours from the instance using timestamp. * * @param int $value * * @return static */ public function subRealHours($value) { return $this->addRealHours(-1 * $value); } /** * Remove an hour from the instance. * * @param int $value * * @return static */ public function subHour($value = 1) { return $this->subHours($value); } /** * Remove an hour from the instance. * * @param int $value * * @return static */ public function subRealHour($value = 1) { return $this->subRealHours($value); } /** * Add minutes to the instance using timestamp. Positive $value * travels forward while negative $value travels into the past. * * @param int $value * * @return static */ public function addMinutes($value) { return $this->modify((int) $value.' minute'); } /** * Add minutes to the instance using timestamp. Positive $value travels * forward while negative $value travels into the past. * * @param int $value * * @return static */ public function addRealMinutes($value) { return $this->addRealSeconds($value * static::SECONDS_PER_MINUTE); } /** * Add a minute to the instance. * * @param int $value * * @return static */ public function addMinute($value = 1) { return $this->addMinutes($value); } /** * Add a minute to the instance using timestamp. * * @param int $value * * @return static */ public function addRealMinute($value = 1) { return $this->addRealMinutes($value); } /** * Remove a minute from the instance. * * @param int $value * * @return static */ public function subMinute($value = 1) { return $this->subMinutes($value); } /** * Remove a minute from the instance using timestamp. * * @param int $value * * @return static */ public function subRealMinute($value = 1) { return $this->addRealMinutes(-1 * $value); } /** * Remove minutes from the instance. * * @param int $value * * @return static */ public function subMinutes($value) { return $this->addMinutes(-1 * $value); } /** * Remove a minute from the instance using timestamp. * * @param int $value * * @return static */ public function subRealMinutes($value = 1) { return $this->subRealMinute($value); } /** * Add seconds to the instance. Positive $value travels forward while * negative $value travels into the past. * * @param int $value * * @return static */ public function addSeconds($value) { return $this->modify((int) $value.' second'); } /** * Add seconds to the instance using timestamp. Positive $value travels * forward while negative $value travels into the past. * * @param int $value * * @return static */ public function addRealSeconds($value) { return $this->setTimestamp($this->getTimestamp() + $value); } /** * Add a second to the instance. * * @param int $value * * @return static */ public function addSecond($value = 1) { return $this->addSeconds($value); } /** * Add a second to the instance using timestamp. * * @param int $value * * @return static */ public function addRealSecond($value = 1) { return $this->addRealSeconds($value); } /** * Remove seconds from the instance. * * @param int $value * * @return static */ public function subSeconds($value) { return $this->addSeconds(-1 * $value); } /** * Remove seconds from the instance using timestamp. * * @param int $value * * @return static */ public function subRealSeconds($value) { return $this->addRealSeconds(-1 * $value); } /** * Remove a second from the instance * * @param int $value * * @return static */ public function subSecond($value = 1) { return $this->subSeconds($value); } /** * Remove a second from the instance using timestamp. * * @param int $value * * @return static */ public function subRealSecond($value = 1) { return $this->subRealSeconds($value); } /////////////////////////////////////////////////////////////////// /////////////////////////// DIFFERENCES /////////////////////////// /////////////////////////////////////////////////////////////////// /** * @param DateInterval $diff * @param bool $absolute * @param bool $trimMicroseconds * * @return CarbonInterval */ protected static function fixDiffInterval(DateInterval $diff, $absolute, $trimMicroseconds) { $diff = CarbonInterval::instance($diff, $trimMicroseconds); // @codeCoverageIgnoreStart if (version_compare(PHP_VERSION, '7.1.0-dev', '<')) { return $diff; } // Work-around for https://bugs.php.net/bug.php?id=77145 if ($diff->f > 0 && $diff->y === -1 && $diff->m === 11 && $diff->d >= 27 && $diff->h === 23 && $diff->i === 59 && $diff->s === 59) { $diff->y = 0; $diff->m = 0; $diff->d = 0; $diff->h = 0; $diff->i = 0; $diff->s = 0; $diff->f = (1000000 - round($diff->f * 1000000)) / 1000000; $diff->invert(); } elseif ($diff->f < 0) { if ($diff->s !== 0 || $diff->i !== 0 || $diff->h !== 0 || $diff->d !== 0 || $diff->m !== 0 || $diff->y !== 0) { $diff->f = (round($diff->f * 1000000) + 1000000) / 1000000; $diff->s--; if ($diff->s < 0) { $diff->s += 60; $diff->i--; if ($diff->i < 0) { $diff->i += 60; $diff->h--; if ($diff->h < 0) { $diff->h += 24; $diff->d--; if ($diff->d < 0) { $diff->d += 30; $diff->m--; if ($diff->m < 0) { $diff->m += 12; $diff->y--; } } } } } } else { $diff->f *= -1; $diff->invert(); } } // @codeCoverageIgnoreEnd if ($absolute && $diff->invert) { $diff->invert(); } return $diff; } /** * Get the difference as a CarbonInterval instance. * * Pass false as second argument to get a microseconds-precise interval. Else * microseconds in the original interval will not be kept. * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * @param bool $trimMicroseconds (true by default) * * @return CarbonInterval */ public function diffAsCarbonInterval($date = null, $absolute = true, $trimMicroseconds = true) { $from = $this; $to = $this->resolveCarbon($date); if ($trimMicroseconds) { $from = $from->copy()->startOfSecond(); $to = $to->copy()->startOfSecond(); } return static::fixDiffInterval($from->diff($to, $absolute), $absolute, $trimMicroseconds); } /** * Get the difference in years * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInYears($date = null, $absolute = true) { return (int) $this->diff($this->resolveCarbon($date), $absolute)->format('%r%y'); } /** * Get the difference in months * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInMonths($date = null, $absolute = true) { $date = $this->resolveCarbon($date); return $this->diffInYears($date, $absolute) * static::MONTHS_PER_YEAR + (int) $this->diff($date, $absolute)->format('%r%m'); } /** * Get the difference in weeks * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInWeeks($date = null, $absolute = true) { return (int) ($this->diffInDays($date, $absolute) / static::DAYS_PER_WEEK); } /** * Get the difference in days * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInDays($date = null, $absolute = true) { return (int) $this->diff($this->resolveCarbon($date), $absolute)->format('%r%a'); } /** * Get the difference in days using a filter closure * * @param Closure $callback * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInDaysFiltered(Closure $callback, $date = null, $absolute = true) { return $this->diffFiltered(CarbonInterval::day(), $callback, $date, $absolute); } /** * Get the difference in hours using a filter closure * * @param Closure $callback * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInHoursFiltered(Closure $callback, $date = null, $absolute = true) { return $this->diffFiltered(CarbonInterval::hour(), $callback, $date, $absolute); } /** * Get the difference by the given interval using a filter closure * * @param CarbonInterval $ci An interval to traverse by * @param Closure $callback * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffFiltered(CarbonInterval $ci, Closure $callback, $date = null, $absolute = true) { $start = $this; $end = $this->resolveCarbon($date); $inverse = false; if ($end < $start) { $start = $end; $end = $this; $inverse = true; } $period = new DatePeriod($start, $ci, $end); $values = array_filter(iterator_to_array($period), function ($date) use ($callback) { return call_user_func($callback, Carbon::instance($date)); }); $diff = count($values); return $inverse && !$absolute ? -$diff : $diff; } /** * Get the difference in weekdays * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInWeekdays($date = null, $absolute = true) { return $this->diffInDaysFiltered(function (Carbon $date) { return $date->isWeekday(); }, $date, $absolute); } /** * Get the difference in weekend days using a filter * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInWeekendDays($date = null, $absolute = true) { return $this->diffInDaysFiltered(function (Carbon $date) { return $date->isWeekend(); }, $date, $absolute); } /** * Get the difference in hours. * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInHours($date = null, $absolute = true) { return (int) ($this->diffInSeconds($date, $absolute) / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR); } /** * Get the difference in hours using timestamps. * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInRealHours($date = null, $absolute = true) { return (int) ($this->diffInRealSeconds($date, $absolute) / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR); } /** * Get the difference in minutes. * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInMinutes($date = null, $absolute = true) { return (int) ($this->diffInSeconds($date, $absolute) / static::SECONDS_PER_MINUTE); } /** * Get the difference in minutes using timestamps. * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInRealMinutes($date = null, $absolute = true) { return (int) ($this->diffInRealSeconds($date, $absolute) / static::SECONDS_PER_MINUTE); } /** * Get the difference in seconds. * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInSeconds($date = null, $absolute = true) { $diff = $this->diff($this->resolveCarbon($date)); if (!$diff->days && version_compare(PHP_VERSION, '5.4.0-dev', '>=')) { $diff = static::fixDiffInterval($diff, $absolute, false); } $value = $diff->days * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE + $diff->h * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE + $diff->i * static::SECONDS_PER_MINUTE + $diff->s; return $absolute || !$diff->invert ? $value : -$value; } /** * Get the difference in seconds using timestamps. * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInRealSeconds($date = null, $absolute = true) { $date = $this->resolveCarbon($date); $value = $date->getTimestamp() - $this->getTimestamp(); return $absolute ? abs($value) : $value; } /** * Get the difference in milliseconds. * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInMilliseconds($date = null, $absolute = true) { return (int) ($this->diffInMicroseconds($date, $absolute) / static::MICROSECONDS_PER_MILLISECOND); } /** * Get the difference in milliseconds using timestamps. * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInRealMilliseconds($date = null, $absolute = true) { return (int) ($this->diffInRealMicroseconds($date, $absolute) / static::MICROSECONDS_PER_MILLISECOND); } /** * Get the difference in microseconds. * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInMicroseconds($date = null, $absolute = true) { $diff = $this->diff($this->resolveCarbon($date)); $micro = isset($diff->f) ? $diff->f : 0; $value = (int) round((((($diff->days * static::HOURS_PER_DAY) + $diff->h) * static::MINUTES_PER_HOUR + $diff->i) * static::SECONDS_PER_MINUTE + ($micro + $diff->s)) * static::MICROSECONDS_PER_SECOND); return $absolute || !$diff->invert ? $value : -$value; } /** * Get the difference in microseconds using timestamps. * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInRealMicroseconds($date = null, $absolute = true) { /** @var Carbon $date */ $date = $this->resolveCarbon($date); $value = ($date->timestamp - $this->timestamp) * static::MICROSECONDS_PER_SECOND + $date->micro - $this->micro; return $absolute ? abs($value) : $value; } /** * The number of seconds since midnight. * * @return int */ public function secondsSinceMidnight() { return $this->diffInSeconds($this->copy()->startOfDay()); } /** * The number of seconds until 23:59:59. * * @return int */ public function secondsUntilEndOfDay() { return $this->diffInSeconds($this->copy()->endOfDay()); } /** * Get the difference in a human readable format in the current locale. * * When comparing a value in the past to default now: * 1 hour ago * 5 months ago * * When comparing a value in the future to default now: * 1 hour from now * 5 months from now * * When comparing a value in the past to another value: * 1 hour before * 5 months before * * When comparing a value in the future to another value: * 1 hour after * 5 months after * * @param Carbon|null $other * @param bool $absolute removes time difference modifiers ago, after, etc * @param bool $short displays short format of time units * @param int $parts displays number of parts in the interval * * @return string */ public function diffForHumans($other = null, $absolute = false, $short = false, $parts = 1) { $isNow = $other === null; $relativeToNow = $isNow; if ($absolute === static::DIFF_RELATIVE_TO_NOW) { $absolute = false; $relativeToNow = true; } elseif ($absolute === static::DIFF_RELATIVE_TO_OTHER) { $absolute = false; $relativeToNow = false; } $interval = array(); $parts = min(6, max(1, (int) $parts)); $count = 1; $unit = $short ? 's' : 'second'; if ($isNow) { $other = $this->nowWithSameTz(); } elseif (!$other instanceof DateTime && !$other instanceof DateTimeInterface) { $other = static::parse($other); } $diffInterval = $this->diff($other); $diffIntervalArray = array( array('value' => $diffInterval->y, 'unit' => 'year', 'unitShort' => 'y'), array('value' => $diffInterval->m, 'unit' => 'month', 'unitShort' => 'm'), array('value' => $diffInterval->d, 'unit' => 'day', 'unitShort' => 'd'), array('value' => $diffInterval->h, 'unit' => 'hour', 'unitShort' => 'h'), array('value' => $diffInterval->i, 'unit' => 'minute', 'unitShort' => 'min'), array('value' => $diffInterval->s, 'unit' => 'second', 'unitShort' => 's'), ); foreach ($diffIntervalArray as $diffIntervalData) { if ($diffIntervalData['value'] > 0) { $unit = $short ? $diffIntervalData['unitShort'] : $diffIntervalData['unit']; $count = $diffIntervalData['value']; if ($diffIntervalData['unit'] === 'day' && $count >= static::DAYS_PER_WEEK) { $unit = $short ? 'w' : 'week'; $count = (int) ($count / static::DAYS_PER_WEEK); $interval[] = static::translator()->transChoice($unit, $count, array(':count' => $count)); // get the count days excluding weeks (might be zero) $numOfDaysCount = (int) ($diffIntervalData['value'] - ($count * static::DAYS_PER_WEEK)); if ($numOfDaysCount > 0 && count($interval) < $parts) { $unit = $short ? 'd' : 'day'; $count = $numOfDaysCount; $interval[] = static::translator()->transChoice($unit, $count, array(':count' => $count)); } } else { $interval[] = static::translator()->transChoice($unit, $count, array(':count' => $count)); } } // break the loop after we get the required number of parts in array if (count($interval) >= $parts) { break; } } if (count($interval) === 0) { if ($isNow && static::getHumanDiffOptions() & self::JUST_NOW) { $key = 'diff_now'; $translation = static::translator()->trans($key); if ($translation !== $key) { return $translation; } } $count = static::getHumanDiffOptions() & self::NO_ZERO_DIFF ? 1 : 0; $unit = $short ? 's' : 'second'; $interval[] = static::translator()->transChoice($unit, $count, array(':count' => $count)); } // join the interval parts by a space $time = implode(' ', $interval); unset($diffIntervalArray, $interval); if ($absolute) { return $time; } $isFuture = $diffInterval->invert === 1; $transId = $relativeToNow ? ($isFuture ? 'from_now' : 'ago') : ($isFuture ? 'after' : 'before'); if ($parts === 1) { if ($isNow && $unit === 'day') { if ($count === 1 && static::getHumanDiffOptions() & self::ONE_DAY_WORDS) { $key = $isFuture ? 'diff_tomorrow' : 'diff_yesterday'; $translation = static::translator()->trans($key); if ($translation !== $key) { return $translation; } } if ($count === 2 && static::getHumanDiffOptions() & self::TWO_DAY_WORDS) { $key = $isFuture ? 'diff_after_tomorrow' : 'diff_before_yesterday'; $translation = static::translator()->trans($key); if ($translation !== $key) { return $translation; } } } // Some languages have special pluralization for past and future tense. $key = $unit.'_'.$transId; if ($key !== static::translator()->transChoice($key, $count)) { $time = static::translator()->transChoice($key, $count, array(':count' => $count)); } } return static::translator()->trans($transId, array(':time' => $time)); } /** * @alias diffForHumans * * Get the difference in a human readable format in the current locale. * * When comparing a value in the past to default now: * 1 hour ago * 5 months ago * * When comparing a value in the future to default now: * 1 hour from now * 5 months from now * * When comparing a value in the past to another value: * 1 hour before * 5 months before * * When comparing a value in the future to another value: * 1 hour after * 5 months after * * @param Carbon|null $other * @param bool $absolute removes time difference modifiers ago, after, etc * @param bool $short displays short format of time units * @param int $parts displays number of parts in the interval * * @return string */ public function from($other = null, $absolute = false, $short = false, $parts = 1) { if (!$other && !$absolute) { $absolute = static::DIFF_RELATIVE_TO_NOW; } return $this->diffForHumans($other, $absolute, $short, $parts); } /** * @alias diffForHumans * * Get the difference in a human readable format in the current locale. * * When comparing a value in the past to default now: * 1 hour ago * 5 months ago * * When comparing a value in the future to default now: * 1 hour from now * 5 months from now * * When comparing a value in the past to another value: * 1 hour before * 5 months before * * When comparing a value in the future to another value: * 1 hour after * 5 months after * * @param Carbon|null $other * @param bool $absolute removes time difference modifiers ago, after, etc * @param bool $short displays short format of time units * @param int $parts displays number of parts in the interval * * @return string */ public function since($other = null, $absolute = false, $short = false, $parts = 1) { return $this->diffForHumans($other, $absolute, $short, $parts); } /** * Get the difference in a human readable format in the current locale from an other * instance given (or now if null given) to current instance. * * When comparing a value in the past to default now: * 1 hour from now * 5 months from now * * When comparing a value in the future to default now: * 1 hour ago * 5 months ago * * When comparing a value in the past to another value: * 1 hour after * 5 months after * * When comparing a value in the future to another value: * 1 hour before * 5 months before * * @param Carbon|null $other * @param bool $absolute removes time difference modifiers ago, after, etc * @param bool $short displays short format of time units * @param int $parts displays number of parts in the interval * * @return string */ public function to($other = null, $absolute = false, $short = false, $parts = 1) { if (!$other && !$absolute) { $absolute = static::DIFF_RELATIVE_TO_NOW; } return $this->resolveCarbon($other)->diffForHumans($this, $absolute, $short, $parts); } /** * @alias to * * Get the difference in a human readable format in the current locale from an other * instance given (or now if null given) to current instance. * * @param Carbon|null $other * @param bool $absolute removes time difference modifiers ago, after, etc * @param bool $short displays short format of time units * @param int $parts displays number of parts in the interval * * @return string */ public function until($other = null, $absolute = false, $short = false, $parts = 1) { return $this->to($other, $absolute, $short, $parts); } /** * Get the difference in a human readable format in the current locale from current * instance to now. * * @param bool $absolute removes time difference modifiers ago, after, etc * @param bool $short displays short format of time units * @param int $parts displays number of parts in the interval * * @return string */ public function fromNow($absolute = null, $short = false, $parts = 1) { $other = null; if ($absolute instanceof DateTimeInterface) { list($other, $absolute, $short, $parts) = array_pad(func_get_args(), 5, null); } return $this->from($other, $absolute, $short, $parts); } /** * Get the difference in a human readable format in the current locale from an other * instance given to now * * @param bool $absolute removes time difference modifiers ago, after, etc * @param bool $short displays short format of time units * @param int $parts displays number of parts in the interval * * @return string */ public function toNow($absolute = null, $short = false, $parts = 1) { return $this->to(null, $absolute, $short, $parts); } /** * Get the difference in a human readable format in the current locale from an other * instance given to now * * @param bool $absolute removes time difference modifiers ago, after, etc * @param bool $short displays short format of time units * @param int $parts displays number of parts in the interval * * @return string */ public function ago($absolute = null, $short = false, $parts = 1) { $other = null; if ($absolute instanceof DateTimeInterface) { list($other, $absolute, $short, $parts) = array_pad(func_get_args(), 5, null); } return $this->from($other, $absolute, $short, $parts); } /////////////////////////////////////////////////////////////////// //////////////////////////// MODIFIERS //////////////////////////// /////////////////////////////////////////////////////////////////// /** * Resets the time to 00:00:00 start of day * * @return static */ public function startOfDay() { return $this->modify('00:00:00.000000'); } /** * Resets the time to 23:59:59 end of day * * @return static */ public function endOfDay() { return $this->modify('23:59:59.999999'); } /** * Resets the date to the first day of the month and the time to 00:00:00 * * @return static */ public function startOfMonth() { return $this->setDate($this->year, $this->month, 1)->startOfDay(); } /** * Resets the date to end of the month and time to 23:59:59 * * @return static */ public function endOfMonth() { return $this->setDate($this->year, $this->month, $this->daysInMonth)->endOfDay(); } /** * Resets the date to the first day of the quarter and the time to 00:00:00 * * @return static */ public function startOfQuarter() { $month = ($this->quarter - 1) * static::MONTHS_PER_QUARTER + 1; return $this->setDate($this->year, $month, 1)->startOfDay(); } /** * Resets the date to end of the quarter and time to 23:59:59 * * @return static */ public function endOfQuarter() { return $this->startOfQuarter()->addMonths(static::MONTHS_PER_QUARTER - 1)->endOfMonth(); } /** * Resets the date to the first day of the year and the time to 00:00:00 * * @return static */ public function startOfYear() { return $this->setDate($this->year, 1, 1)->startOfDay(); } /** * Resets the date to end of the year and time to 23:59:59 * * @return static */ public function endOfYear() { return $this->setDate($this->year, 12, 31)->endOfDay(); } /** * Resets the date to the first day of the decade and the time to 00:00:00 * * @return static */ public function startOfDecade() { $year = $this->year - $this->year % static::YEARS_PER_DECADE; return $this->setDate($year, 1, 1)->startOfDay(); } /** * Resets the date to end of the decade and time to 23:59:59 * * @return static */ public function endOfDecade() { $year = $this->year - $this->year % static::YEARS_PER_DECADE + static::YEARS_PER_DECADE - 1; return $this->setDate($year, 12, 31)->endOfDay(); } /** * Resets the date to the first day of the century and the time to 00:00:00 * * @return static */ public function startOfCentury() { $year = $this->year - ($this->year - 1) % static::YEARS_PER_CENTURY; return $this->setDate($year, 1, 1)->startOfDay(); } /** * Resets the date to end of the century and time to 23:59:59 * * @return static */ public function endOfCentury() { $year = $this->year - 1 - ($this->year - 1) % static::YEARS_PER_CENTURY + static::YEARS_PER_CENTURY; return $this->setDate($year, 12, 31)->endOfDay(); } /** * Resets the date to the first day of the century and the time to 00:00:00 * * @return static */ public function startOfMillennium() { $year = $this->year - ($this->year - 1) % static::YEARS_PER_MILLENNIUM; return $this->setDate($year, 1, 1)->startOfDay(); } /** * Resets the date to end of the century and time to 23:59:59 * * @return static */ public function endOfMillennium() { $year = $this->year - 1 - ($this->year - 1) % static::YEARS_PER_MILLENNIUM + static::YEARS_PER_MILLENNIUM; return $this->setDate($year, 12, 31)->endOfDay(); } /** * Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00 * * @return static */ public function startOfWeek() { while ($this->dayOfWeek !== static::$weekStartsAt) { $this->subDay(); } return $this->startOfDay(); } /** * Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59 * * @return static */ public function endOfWeek() { while ($this->dayOfWeek !== static::$weekEndsAt) { $this->addDay(); } return $this->endOfDay(); } /** * Modify to start of current hour, minutes and seconds become 0 * * @return static */ public function startOfHour() { return $this->setTime($this->hour, 0, 0); } /** * Modify to end of current hour, minutes and seconds become 59 * * @return static */ public function endOfHour() { return $this->modify("$this->hour:59:59.999999"); } /** * Modify to start of current minute, seconds become 0 * * @return static */ public function startOfMinute() { return $this->setTime($this->hour, $this->minute, 0); } /** * Modify to end of current minute, seconds become 59 * * @return static */ public function endOfMinute() { return $this->modify("$this->hour:$this->minute:59.999999"); } /** * Modify to start of current minute, seconds become 0 * * @return static */ public function startOfSecond() { return $this->modify("$this->hour:$this->minute:$this->second.0"); } /** * Modify to end of current minute, seconds become 59 * * @return static */ public function endOfSecond() { return $this->modify("$this->hour:$this->minute:$this->second.999999"); } /** * Modify to midday, default to self::$midDayAt * * @return static */ public function midDay() { return $this->setTime(self::$midDayAt, 0, 0); } /** * Modify to the next occurrence of a given day of the week. * If no dayOfWeek is provided, modify to the next occurrence * of the current day of the week. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek * * @return static */ public function next($dayOfWeek = null) { if ($dayOfWeek === null) { $dayOfWeek = $this->dayOfWeek; } return $this->startOfDay()->modify('next '.static::$days[$dayOfWeek]); } /** * Go forward or backward to the next week- or weekend-day. * * @param bool $weekday * @param bool $forward * * @return $this */ private function nextOrPreviousDay($weekday = true, $forward = true) { $step = $forward ? 1 : -1; do { $this->addDay($step); } while ($weekday ? $this->isWeekend() : $this->isWeekday()); return $this; } /** * Go forward to the next weekday. * * @return $this */ public function nextWeekday() { return $this->nextOrPreviousDay(); } /** * Go backward to the previous weekday. * * @return $this */ public function previousWeekday() { return $this->nextOrPreviousDay(true, false); } /** * Go forward to the next weekend day. * * @return $this */ public function nextWeekendDay() { return $this->nextOrPreviousDay(false); } /** * Go backward to the previous weekend day. * * @return $this */ public function previousWeekendDay() { return $this->nextOrPreviousDay(false, false); } /** * Modify to the previous occurrence of a given day of the week. * If no dayOfWeek is provided, modify to the previous occurrence * of the current day of the week. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek * * @return static */ public function previous($dayOfWeek = null) { if ($dayOfWeek === null) { $dayOfWeek = $this->dayOfWeek; } return $this->startOfDay()->modify('last '.static::$days[$dayOfWeek]); } /** * Modify to the first occurrence of a given day of the week * in the current month. If no dayOfWeek is provided, modify to the * first day of the current month. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek * * @return static */ public function firstOfMonth($dayOfWeek = null) { $this->startOfDay(); if ($dayOfWeek === null) { return $this->day(1); } return $this->modify('first '.static::$days[$dayOfWeek].' of '.$this->format('F').' '.$this->year); } /** * Modify to the last occurrence of a given day of the week * in the current month. If no dayOfWeek is provided, modify to the * last day of the current month. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek * * @return static */ public function lastOfMonth($dayOfWeek = null) { $this->startOfDay(); if ($dayOfWeek === null) { return $this->day($this->daysInMonth); } return $this->modify('last '.static::$days[$dayOfWeek].' of '.$this->format('F').' '.$this->year); } /** * Modify to the given occurrence of a given day of the week * in the current month. If the calculated occurrence is outside the scope * of the current month, then return false and no modifications are made. * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int $nth * @param int $dayOfWeek * * @return mixed */ public function nthOfMonth($nth, $dayOfWeek) { $date = $this->copy()->firstOfMonth(); $check = $date->format('Y-m'); $date->modify('+'.$nth.' '.static::$days[$dayOfWeek]); return $date->format('Y-m') === $check ? $this->modify($date) : false; } /** * Modify to the first occurrence of a given day of the week * in the current quarter. If no dayOfWeek is provided, modify to the * first day of the current quarter. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek day of the week default null * * @return static */ public function firstOfQuarter($dayOfWeek = null) { return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER - 2, 1)->firstOfMonth($dayOfWeek); } /** * Modify to the last occurrence of a given day of the week * in the current quarter. If no dayOfWeek is provided, modify to the * last day of the current quarter. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek day of the week default null * * @return static */ public function lastOfQuarter($dayOfWeek = null) { return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER, 1)->lastOfMonth($dayOfWeek); } /** * Modify to the given occurrence of a given day of the week * in the current quarter. If the calculated occurrence is outside the scope * of the current quarter, then return false and no modifications are made. * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int $nth * @param int $dayOfWeek * * @return mixed */ public function nthOfQuarter($nth, $dayOfWeek) { $date = $this->copy()->day(1)->month($this->quarter * static::MONTHS_PER_QUARTER); $lastMonth = $date->month; $year = $date->year; $date->firstOfQuarter()->modify('+'.$nth.' '.static::$days[$dayOfWeek]); return ($lastMonth < $date->month || $year !== $date->year) ? false : $this->modify($date); } /** * Modify to the first occurrence of a given day of the week * in the current year. If no dayOfWeek is provided, modify to the * first day of the current year. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek day of the week default null * * @return static */ public function firstOfYear($dayOfWeek = null) { return $this->month(1)->firstOfMonth($dayOfWeek); } /** * Modify to the last occurrence of a given day of the week * in the current year. If no dayOfWeek is provided, modify to the * last day of the current year. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek day of the week default null * * @return static */ public function lastOfYear($dayOfWeek = null) { return $this->month(static::MONTHS_PER_YEAR)->lastOfMonth($dayOfWeek); } /** * Modify to the given occurrence of a given day of the week * in the current year. If the calculated occurrence is outside the scope * of the current year, then return false and no modifications are made. * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int $nth * @param int $dayOfWeek * * @return mixed */ public function nthOfYear($nth, $dayOfWeek) { $date = $this->copy()->firstOfYear()->modify('+'.$nth.' '.static::$days[$dayOfWeek]); return $this->year === $date->year ? $this->modify($date) : false; } /** * Modify the current instance to the average of a given instance (default now) and the current instance. * * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * * @return static */ public function average($date = null) { $date = $this->resolveCarbon($date); $increment = $this->diffInRealSeconds($date, false) / 2; $intIncrement = floor($increment); $microIncrement = (int) (($date->micro - $this->micro) / 2 + 1000000 * ($increment - $intIncrement)); $micro = (int) ($this->micro + $microIncrement); while ($micro >= 1000000) { $micro -= 1000000; $intIncrement++; } $this->addSeconds($intIncrement); if (version_compare(PHP_VERSION, '7.1.8-dev', '>=')) { $this->setTime($this->hour, $this->minute, $this->second, $micro); } return $this; } /////////////////////////////////////////////////////////////////// /////////////////////////// SERIALIZATION ///////////////////////// /////////////////////////////////////////////////////////////////// /** * Return a serialized string of the instance. * * @return string */ public function serialize() { return serialize($this); } /** * Create an instance from a serialized string. * * @param string $value * * @throws \InvalidArgumentException * * @return static */ public static function fromSerialized($value) { $instance = @unserialize($value); if (!$instance instanceof static) { throw new InvalidArgumentException('Invalid serialized value.'); } return $instance; } /** * The __set_state handler. * * @param array $array * * @return static */ public static function __set_state($array) { return static::instance(parent::__set_state($array)); } /** * Prepare the object for JSON serialization. * * @return array|string */ public function jsonSerialize() { if (static::$serializer) { return call_user_func(static::$serializer, $this); } $carbon = $this; return call_user_func(function () use ($carbon) { return get_object_vars($carbon); }); } /** * JSON serialize all Carbon instances using the given callback. * * @param callable $callback * * @return void */ public static function serializeUsing($callback) { static::$serializer = $callback; } /////////////////////////////////////////////////////////////////// /////////////////////////////// MACRO ///////////////////////////// /////////////////////////////////////////////////////////////////// /** * Register a custom macro. * * @param string $name * @param object|callable $macro * * @return void */ public static function macro($name, $macro) { static::$localMacros[$name] = $macro; } /** * Remove all macros. */ public static function resetMacros() { static::$localMacros = array(); } /** * Mix another object into the class. * * @param object $mixin * * @return void */ public static function mixin($mixin) { $reflection = new \ReflectionClass($mixin); $methods = $reflection->getMethods( \ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED ); foreach ($methods as $method) { $method->setAccessible(true); static::macro($method->name, $method->invoke($mixin)); } } /** * Checks if macro is registered. * * @param string $name * * @return bool */ public static function hasMacro($name) { return isset(static::$localMacros[$name]); } /** * Dynamically handle calls to the class. * * @param string $method * @param array $parameters * * @throws \BadMethodCallException * * @return mixed */ public static function __callStatic($method, $parameters) { if (!static::hasMacro($method)) { throw new \BadMethodCallException("Method $method does not exist."); } if (static::$localMacros[$method] instanceof Closure && method_exists('Closure', 'bind')) { return call_user_func_array(Closure::bind(static::$localMacros[$method], null, get_called_class()), $parameters); } return call_user_func_array(static::$localMacros[$method], $parameters); } /** * Dynamically handle calls to the class. * * @param string $method * @param array $parameters * * @throws \BadMethodCallException|\ReflectionException * * @return mixed */ public function __call($method, $parameters) { if (!static::hasMacro($method)) { throw new \BadMethodCallException("Method $method does not exist."); } $macro = static::$localMacros[$method]; $reflexion = new \ReflectionFunction($macro); $reflectionParameters = $reflexion->getParameters(); $expectedCount = count($reflectionParameters); $actualCount = count($parameters); if ($expectedCount > $actualCount && $reflectionParameters[$expectedCount - 1]->name === 'self') { for ($i = $actualCount; $i < $expectedCount - 1; $i++) { $parameters[] = $reflectionParameters[$i]->getDefaultValue(); } $parameters[] = $this; } if ($macro instanceof Closure && method_exists($macro, 'bindTo')) { return call_user_func_array($macro->bindTo($this, get_class($this)), $parameters); } return call_user_func_array($macro, $parameters); } /** * Show truthy properties on var_dump(). * * @return array */ public function __debugInfo() { return array_filter(get_object_vars($this), function ($var) { return $var; }); } /** * Cast the current instance into the given class. * * @param string $className The $className::instance() method will be called to cast the current object. * * @return object */ public function cast($className) { if (!method_exists($className, 'instance')) { throw new \InvalidArgumentException("$className has not the instance() method needed to cast the date."); } return $className::instance($this); } } carbon/src/Carbon/Laravel/ServiceProvider.php 0000644 00000002160 14716424272 0015225 0 ustar 00 app['events']; if ($events instanceof EventDispatcher || $events instanceof Dispatcher) { $events->listen(class_exists('Illuminate\Foundation\Events\LocaleUpdated') ? 'Illuminate\Foundation\Events\LocaleUpdated' : 'locale.changed', function () use ($service) { $service->updateLocale(); }); $service->updateLocale(); } } public function updateLocale() { $translator = $this->app['translator']; if ($translator instanceof Translator || $translator instanceof IlluminateTranslator) { Carbon::setLocale($translator->getLocale()); } } public function register() { // Needed for Laravel < 5.3 compatibility } } carbon/src/Carbon/Laravel/error_log; 0000644 00000017470 14716424272 0013423 0 ustar 00 [26-Sep-2023 06:14:14 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [29-Nov-2023 02:32:54 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [30-Nov-2023 11:02:35 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [01-Dec-2023 12:16:33 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [02-Dec-2023 09:59:17 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [31-Dec-2023 03:45:55 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [01-Mar-2024 21:58:57 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [19-Mar-2024 15:02:32 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [05-May-2024 01:04:55 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [05-May-2024 11:00:26 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [05-May-2024 20:26:05 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [07-May-2024 11:29:08 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [14-May-2024 20:09:09 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [19-May-2024 13:52:34 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [19-May-2024 21:25:24 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [31-May-2024 07:29:20 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [06-Jun-2024 15:34:10 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [12-Jun-2024 03:58:02 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [19-Jun-2024 01:26:18 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [19-Jun-2024 11:47:33 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [19-Jun-2024 20:16:08 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [29-Jun-2024 02:47:08 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [22-Jul-2024 19:26:56 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [24-Jul-2024 09:08:35 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [10-Aug-2024 12:40:25 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [31-Aug-2024 10:16:08 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [01-Sep-2024 23:15:45 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [10-Sep-2024 17:03:00 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [10-Sep-2024 17:03:04 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [11-Sep-2024 22:55:33 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [16-Sep-2024 15:02:48 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [08-Oct-2024 17:58:56 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [18-Oct-2024 16:30:59 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [24-Oct-2024 02:52:51 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [26-Oct-2024 04:14:23 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 [31-Oct-2024 13:59:45 America/Fortaleza] PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php on line 11 carbon/src/Carbon/Exceptions/InvalidDateException.php 0000644 00000002413 14716424272 0016711 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use Exception; use InvalidArgumentException; class InvalidDateException extends InvalidArgumentException { /** * The invalid field. * * @var string */ private $field; /** * The invalid value. * * @var mixed */ private $value; /** * Constructor. * * @param string $field * @param mixed $value * @param int $code * @param \Exception|null $previous */ public function __construct($field, $value, $code = 0, Exception $previous = null) { $this->field = $field; $this->value = $value; parent::__construct($field.' : '.$value.' is not a valid value.', $code, $previous); } /** * Get the invalid field. * * @return string */ public function getField() { return $this->field; } /** * Get the invalid value. * * @return mixed */ public function getValue() { return $this->value; } } carbon/src/Carbon/error_log; 0000644 00000041426 14716424272 0012033 0 ustar 00 [12-Sep-2023 15:23:59 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [20-Sep-2023 23:46:11 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [01-Oct-2023 14:08:33 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [01-Oct-2023 14:08:35 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [01-Oct-2023 18:20:42 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [01-Oct-2023 18:20:43 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [21-Nov-2023 05:49:31 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [24-Nov-2023 04:18:20 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [24-Nov-2023 04:18:36 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [25-Nov-2023 02:06:26 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [25-Nov-2023 02:06:29 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [26-Nov-2023 07:13:24 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [26-Nov-2023 07:13:40 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [27-Nov-2023 10:27:55 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [27-Nov-2023 10:28:05 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [28-Nov-2023 22:58:58 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [02-Jan-2024 14:07:23 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [08-Jan-2024 08:15:18 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [20-Feb-2024 04:57:52 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [20-Feb-2024 23:31:54 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [01-Mar-2024 11:34:29 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [18-Mar-2024 09:10:20 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [27-Apr-2024 11:08:35 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [28-Apr-2024 22:41:21 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [04-May-2024 07:07:31 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [04-May-2024 22:56:00 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [04-May-2024 22:56:11 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [05-May-2024 08:51:59 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [05-May-2024 08:52:12 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [05-May-2024 19:02:04 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [05-May-2024 19:02:16 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [14-May-2024 18:59:44 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [14-May-2024 18:59:56 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [15-May-2024 14:00:58 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [17-May-2024 14:23:10 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [17-May-2024 17:27:46 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [30-May-2024 21:04:54 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [30-May-2024 21:34:52 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [04-Jun-2024 11:11:58 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [05-Jun-2024 14:44:17 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [06-Jun-2024 09:06:02 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [11-Jun-2024 01:50:24 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [19-Jun-2024 01:20:49 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [19-Jun-2024 01:21:02 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [19-Jun-2024 11:42:05 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [19-Jun-2024 11:42:17 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [19-Jun-2024 20:10:37 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [19-Jun-2024 20:10:49 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [20-Jun-2024 18:28:54 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [08-Jul-2024 20:18:50 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [09-Jul-2024 08:06:52 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [18-Jul-2024 17:31:21 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [22-Jul-2024 17:31:00 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [22-Jul-2024 17:31:12 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [24-Jul-2024 20:21:01 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [15-Aug-2024 15:56:57 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [19-Aug-2024 04:44:21 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [25-Aug-2024 14:47:40 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [31-Aug-2024 16:36:26 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [01-Sep-2024 21:06:49 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [01-Sep-2024 21:07:01 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [10-Sep-2024 14:09:00 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [10-Sep-2024 14:09:12 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [10-Sep-2024 14:09:28 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [10-Sep-2024 14:09:40 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [11-Sep-2024 21:04:32 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [11-Sep-2024 21:04:44 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [22-Sep-2024 00:15:00 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [26-Sep-2024 10:27:27 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [03-Oct-2024 19:07:37 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [08-Oct-2024 18:29:00 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [11-Oct-2024 20:00:52 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [18-Oct-2024 12:29:45 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [18-Oct-2024 14:19:42 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [18-Oct-2024 14:21:22 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [21-Oct-2024 08:39:09 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [30-Oct-2024 04:42:56 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [30-Oct-2024 11:17:12 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [31-Oct-2024 12:06:49 America/Fortaleza] PHP Fatal error: Interface 'UpdateHelper\UpdateHelperInterface' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Upgrade.php on line 16 [31-Oct-2024 12:07:02 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 [11-Nov-2024 23:26:03 America/Fortaleza] PHP Fatal error: Class 'Symfony\Component\Translation\Translator' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Translator.php on line 7 carbon/src/Carbon/Upgrade.php 0000644 00000011560 14716424272 0012117 0 ustar 00 '5.8.0', 'laravel/cashier' => '9.0.1', 'illuminate/support' => '5.8.0', 'laravel/dusk' => '5.0.0', ); protected static $otherLibraries = array( 'spatie/laravel-analytics' => '3.6.4', 'jenssegers/date' => '3.5.0', ); /** * @param \UpdateHelper\UpdateHelper $helper */ public function check(UpdateHelper $helper) { $helper->write(array( 'Carbon 1 is deprecated, see how to migrate to Carbon 2.', 'https://carbon.nesbot.com/docs/#api-carbon-2', )); if (static::SUGGEST_ON_UPDATE || static::ASK_ON_UPDATE || $helper->getIo()->isVerbose()) { $laravelUpdate = array(); foreach (static::$laravelLibraries as $name => $version) { if ($helper->hasAsDependency($name) && $helper->isDependencyLesserThan($name, $version)) { $laravelUpdate[$name] = $version; } } if (count($laravelUpdate)) { $output = array( ' Please consider upgrading your Laravel dependencies to be compatible with Carbon 2:', ); foreach ($laravelUpdate as $name => $version) { $output[] = " - $name at least to version $version"; } $output[] = ''; $output[] = " If you can't update Laravel, check https://carbon.nesbot.com/ to see how to"; $output[] = ' install Carbon 2 using alias version and our adapter kylekatarnls/laravel-carbon-2'; $output[] = ''; $helper->write($output); } foreach (static::$otherLibraries as $name => $version) { if ($helper->hasAsDependency($name) && $helper->isDependencyLesserThan($name, $version)) { $helper->write(" Please consider upgrading $name at least to $version to be compatible with Carbon 2.\n"); } } if (static::ASK_ON_UPDATE) { static::askForUpgrade($helper); return; } } $path = implode(DIRECTORY_SEPARATOR, array('.', 'vendor', 'bin', 'upgrade-carbon')); if (!file_exists($path)) { $path = realpath(__DIR__.'/../../bin/upgrade-carbon'); } $helper->write( ' You can run '.escapeshellarg($path). ' to get help in updating carbon and other frameworks and libraries that depend on it.' ); } private static function getUpgradeQuestion($upgrades) { $message = "Do you want us to try the following upgrade:\n"; foreach ($upgrades as $name => $version) { $message .= " - $name: $version\n"; } return $message.'[Y/N] '; } public static function askForUpgrade(UpdateHelper $helper, $upgradeIfNotInteractive = false) { $upgrades = array( 'nesbot/carbon' => '^2.0.0', ); foreach (array(static::$laravelLibraries, static::$otherLibraries) as $libraries) { foreach ($libraries as $name => $version) { if ($helper->hasAsDependency($name) && $helper->isDependencyLesserThan($name, $version)) { $upgrades[$name] = "^$version"; } } } $shouldUpgrade = $helper->isInteractive() ? $helper->getIo()->askConfirmation(static::getUpgradeQuestion($upgrades)) : $upgradeIfNotInteractive; if ($shouldUpgrade) { $helper->setDependencyVersions($upgrades)->update(); } } public static function upgrade(ScriptEvent $event = null) { if (!$event) { $composer = new Composer(); $baseDir = __DIR__.'/../..'; if (file_exists("$baseDir/autoload.php")) { $baseDir .= '/..'; } $composer->setConfig(new Config(true, $baseDir)); $event = new ScriptEvent( 'upgrade-carbon', $composer, new ConsoleIO(new StringInput(''), new ConsoleOutput(), new HelperSet(array( new QuestionHelper(), ))) ); } static::askForUpgrade(new UpdateHelper($event), true); } } carbon/src/Carbon/Translator.php 0000644 00000007015 14716424272 0012661 0 ustar 00 addLoader('array', new Translation\Loader\ArrayLoader()); parent::__construct($locale, $formatter, $cacheDir, $debug); } /** * Reset messages of a locale (all locale if no locale passed). * Remove custom messages and reload initial messages from matching * file in Lang directory. * * @param string|null $locale * * @return bool */ public function resetMessages($locale = null) { if ($locale === null) { static::$messages = array(); return true; } if (file_exists($filename = __DIR__.'/Lang/'.$locale.'.php')) { static::$messages[$locale] = require $filename; $this->addResource('array', static::$messages[$locale], $locale); return true; } return false; } /** * Init messages language from matching file in Lang directory. * * @param string $locale * * @return bool */ protected function loadMessagesFromFile($locale) { if (isset(static::$messages[$locale])) { return true; } return $this->resetMessages($locale); } /** * Set messages of a locale and take file first if present. * * @param string $locale * @param array $messages * * @return $this */ public function setMessages($locale, $messages) { $this->loadMessagesFromFile($locale); $this->addResource('array', $messages, $locale); static::$messages[$locale] = array_merge( isset(static::$messages[$locale]) ? static::$messages[$locale] : array(), $messages ); return $this; } /** * Get messages of a locale, if none given, return all the * languages. * * @param string|null $locale * * @return array */ public function getMessages($locale = null) { return $locale === null ? static::$messages : static::$messages[$locale]; } /** * Set the current translator locale and indicate if the source locale file exists * * @param string $locale locale ex. en * * @return bool */ public function setLocale($locale) { $locale = preg_replace_callback('/[-_]([a-z]{2,})/', function ($matches) { // _2-letters is a region, _3+-letters is a variant return '_'.call_user_func(strlen($matches[1]) > 2 ? 'ucfirst' : 'strtoupper', $matches[1]); }, strtolower($locale)); if ($this->loadMessagesFromFile($locale)) { parent::setLocale($locale); return true; } return false; } } carbon/src/Carbon/Lang/eo.php 0000644 00000001730 14716424272 0012012 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count jaro|:count jaroj', 'y' => ':count jaro|:count jaroj', 'month' => ':count monato|:count monatoj', 'm' => ':count monato|:count monatoj', 'week' => ':count semajno|:count semajnoj', 'w' => ':count semajno|:count semajnoj', 'day' => ':count tago|:count tagoj', 'd' => ':count tago|:count tagoj', 'hour' => ':count horo|:count horoj', 'h' => ':count horo|:count horoj', 'minute' => ':count minuto|:count minutoj', 'min' => ':count minuto|:count minutoj', 'second' => ':count sekundo|:count sekundoj', 's' => ':count sekundo|:count sekundoj', 'ago' => 'antaŭ :time', 'from_now' => 'je :time', 'after' => ':time poste', 'before' => ':time antaŭe', ); carbon/src/Carbon/Lang/dv_MV.php 0000644 00000002411 14716424272 0012417 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => '{0}އަހަރެއް|[1,Inf]:count އަހަރު', 'y' => '{0}އަހަރެއް|[1,Inf]:count އަހަރު', 'month' => '{0}މައްސަރެއް|[1,Inf]:count މަސް', 'm' => '{0}މައްސަރެއް|[1,Inf]:count މަސް', 'week' => '{0}ހަފްތާއެއް|[1,Inf]:count ހަފްތާ', 'w' => '{0}ހަފްތާއެއް|[1,Inf]:count ހަފްތާ', 'day' => '{0}ދުވަސް|[1,Inf]:count ދުވަސް', 'd' => '{0}ދުވަސް|[1,Inf]:count ދުވަސް', 'hour' => '{0}ގަޑިއިރެއް|[1,Inf]:count ގަޑި', 'h' => '{0}ގަޑިއިރެއް|[1,Inf]:count ގަޑި', 'minute' => '{0}މިނެޓެއް|[1,Inf]:count މިނެޓް', 'min' => '{0}މިނެޓެއް|[1,Inf]:count މިނެޓް', 'second' => '{0}ސިކުންތެއް|[1,Inf]:count ސިކުންތު', 's' => '{0}ސިކުންތެއް|[1,Inf]:count ސިކުންތު', 'ago' => ':time ކުރިން', 'from_now' => ':time ފަހުން', 'after' => ':time ފަހުން', 'before' => ':time ކުރި', ); carbon/src/Carbon/Lang/bn.php 0000644 00000003013 14716424272 0012002 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => '১ বছর|:count বছর', 'y' => '১ বছর|:count বছর', 'month' => '১ মাস|:count মাস', 'm' => '১ মাস|:count মাস', 'week' => '১ সপ্তাহ|:count সপ্তাহ', 'w' => '১ সপ্তাহ|:count সপ্তাহ', 'day' => '১ দিন|:count দিন', 'd' => '১ দিন|:count দিন', 'hour' => '১ ঘন্টা|:count ঘন্টা', 'h' => '১ ঘন্টা|:count ঘন্টা', 'minute' => '১ মিনিট|:count মিনিট', 'min' => '১ মিনিট|:count মিনিট', 'second' => '১ সেকেন্ড|:count সেকেন্ড', 's' => '১ সেকেন্ড|:count সেকেন্ড', 'ago' => ':time পূর্বে', 'from_now' => 'এখন থেকে :time', 'after' => ':time পরে', 'before' => ':time আগে', 'diff_now' => 'এখন', 'diff_yesterday' => 'গতকাল', 'diff_tomorrow' => 'আগামীকাল', 'period_recurrences' => ':count বার|:count বার', 'period_interval' => 'প্রতি :interval', 'period_start_date' => ':date থেকে', 'period_end_date' => ':date পর্যন্ত', ); carbon/src/Carbon/Lang/nl.php 0000644 00000002112 14716424272 0012013 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count jaar', 'y' => ':count jaar', 'month' => ':count maand|:count maanden', 'm' => ':count maand|:count maanden', 'week' => ':count week|:count weken', 'w' => ':count week|:count weken', 'day' => ':count dag|:count dagen', 'd' => ':count dag|:count dagen', 'hour' => ':count uur', 'h' => ':count uur', 'minute' => ':count minuut|:count minuten', 'min' => ':count minuut|:count minuten', 'second' => ':count seconde|:count seconden', 's' => ':count seconde|:count seconden', 'ago' => ':time geleden', 'from_now' => 'over :time', 'after' => ':time later', 'before' => ':time eerder', 'diff_now' => 'nu', 'diff_yesterday' => 'gisteren', 'diff_tomorrow' => 'morgen', 'diff_after_tomorrow' => 'overmorgen', 'diff_before_yesterday' => 'eergisteren', ); carbon/src/Carbon/Lang/sr.php 0000644 00000003106 14716424272 0012032 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count godina|:count godine|:count godina', 'y' => ':count godina|:count godine|:count godina', 'month' => ':count mesec|:count meseca|:count meseci', 'm' => ':count mesec|:count meseca|:count meseci', 'week' => ':count nedelja|:count nedelje|:count nedelja', 'w' => ':count nedelja|:count nedelje|:count nedelja', 'day' => ':count dan|:count dana|:count dana', 'd' => ':count dan|:count dana|:count dana', 'hour' => ':count sat|:count sata|:count sati', 'h' => ':count sat|:count sata|:count sati', 'minute' => ':count minut|:count minuta |:count minuta', 'min' => ':count minut|:count minuta |:count minuta', 'second' => ':count sekund|:count sekunde|:count sekunde', 's' => ':count sekund|:count sekunde|:count sekunde', 'ago' => 'pre :time', 'from_now' => ':time od sada', 'after' => 'nakon :time', 'before' => 'pre :time', 'year_from_now' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina', 'year_ago' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina', 'week_from_now' => '{1} :count nedelju|{2,3,4} :count nedelje|[5,Inf[ :count nedelja', 'week_ago' => '{1} :count nedelju|{2,3,4} :count nedelje|[5,Inf[ :count nedelja', ); carbon/src/Carbon/Lang/sr_Latn_ME.php 0000644 00000003367 14716424272 0013402 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count godine|[0,Inf[ :count godina', 'y' => ':count g.', 'month' => '{1} :count mjesec|{2,3,4}:count mjeseca|[5,Inf[ :count mjeseci', 'm' => ':count mj.', 'week' => '{1} :count nedjelja|{2,3,4}:count nedjelje|[5,Inf[ :count nedjelja', 'w' => ':count ned.', 'day' => '{1,21,31} :count dan|[2,Inf[ :count dana', 'd' => ':count d.', 'hour' => '{1,21} :count sat|{2,3,4,22,23,24}:count sata|[5,Inf[ :count sati', 'h' => ':count č.', 'minute' => '{1,21,31,41,51} :count minut|[2,Inf[ :count minuta', 'min' => ':count min.', 'second' => '{1,21,31,41,51} :count sekund|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count sekunde|[5,Inf[:count sekundi', 's' => ':count sek.', 'ago' => 'prije :time', 'from_now' => 'za :time', 'after' => ':time nakon', 'before' => ':time prije', 'year_from_now' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina', 'year_ago' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina', 'week_from_now' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja', 'week_ago' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja', 'diff_now' => 'upravo sada', 'diff_yesterday' => 'juče', 'diff_tomorrow' => 'sutra', 'diff_before_yesterday' => 'prekjuče', 'diff_after_tomorrow' => 'preksutra', ); carbon/src/Carbon/Lang/it.php 0000644 00000002204 14716424272 0012020 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count anno|:count anni', 'y' => ':count anno|:count anni', 'month' => ':count mese|:count mesi', 'm' => ':count mese|:count mesi', 'week' => ':count settimana|:count settimane', 'w' => ':count settimana|:count settimane', 'day' => ':count giorno|:count giorni', 'd' => ':count giorno|:count giorni', 'hour' => ':count ora|:count ore', 'h' => ':count ora|:count ore', 'minute' => ':count minuto|:count minuti', 'min' => ':count minuto|:count minuti', 'second' => ':count secondo|:count secondi', 's' => ':count secondo|:count secondi', 'ago' => ':time fa', 'from_now' => 'tra :time', 'after' => ':time dopo', 'before' => ':time prima', 'diff_now' => 'proprio ora', 'diff_yesterday' => 'ieri', 'diff_tomorrow' => 'domani', 'diff_before_yesterday' => "l'altro ieri", 'diff_after_tomorrow' => 'dopodomani', ); carbon/src/Carbon/Lang/et.php 0000644 00000002353 14716424272 0012021 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count aasta|:count aastat', 'y' => ':count aasta|:count aastat', 'month' => ':count kuu|:count kuud', 'm' => ':count kuu|:count kuud', 'week' => ':count nädal|:count nädalat', 'w' => ':count nädal|:count nädalat', 'day' => ':count päev|:count päeva', 'd' => ':count päev|:count päeva', 'hour' => ':count tund|:count tundi', 'h' => ':count tund|:count tundi', 'minute' => ':count minut|:count minutit', 'min' => ':count minut|:count minutit', 'second' => ':count sekund|:count sekundit', 's' => ':count sekund|:count sekundit', 'ago' => ':time tagasi', 'from_now' => ':time pärast', 'after' => ':time pärast', 'before' => ':time enne', 'year_from_now' => ':count aasta', 'month_from_now' => ':count kuu', 'week_from_now' => ':count nädala', 'day_from_now' => ':count päeva', 'hour_from_now' => ':count tunni', 'minute_from_now' => ':count minuti', 'second_from_now' => ':count sekundi', ); carbon/src/Carbon/Lang/af.php 0000644 00000001665 14716424272 0012004 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count jaar|:count jare', 'y' => ':count jaar|:count jare', 'month' => ':count maand|:count maande', 'm' => ':count maand|:count maande', 'week' => ':count week|:count weke', 'w' => ':count week|:count weke', 'day' => ':count dag|:count dae', 'd' => ':count dag|:count dae', 'hour' => ':count uur|:count ure', 'h' => ':count uur|:count ure', 'minute' => ':count minuut|:count minute', 'min' => ':count minuut|:count minute', 'second' => ':count sekond|:count sekondes', 's' => ':count sekond|:count sekondes', 'ago' => ':time terug', 'from_now' => ':time van nou af', 'after' => ':time na', 'before' => ':time voor', ); carbon/src/Carbon/Lang/is.php 0000644 00000001670 14716424272 0012025 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => '1 ár|:count ár', 'y' => '1 ár|:count ár', 'month' => '1 mánuður|:count mánuðir', 'm' => '1 mánuður|:count mánuðir', 'week' => '1 vika|:count vikur', 'w' => '1 vika|:count vikur', 'day' => '1 dagur|:count dagar', 'd' => '1 dagur|:count dagar', 'hour' => '1 klukkutími|:count klukkutímar', 'h' => '1 klukkutími|:count klukkutímar', 'minute' => '1 mínúta|:count mínútur', 'min' => '1 mínúta|:count mínútur', 'second' => '1 sekúnda|:count sekúndur', 's' => '1 sekúnda|:count sekúndur', 'ago' => ':time síðan', 'from_now' => ':time síðan', 'after' => ':time eftir', 'before' => ':time fyrir', ); carbon/src/Carbon/Lang/mk.php 0000644 00000001405 14716424272 0012015 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count година|:count години', 'month' => ':count месец|:count месеци', 'week' => ':count седмица|:count седмици', 'day' => ':count ден|:count дена', 'hour' => ':count час|:count часа', 'minute' => ':count минута|:count минути', 'second' => ':count секунда|:count секунди', 'ago' => 'пред :time', 'from_now' => ':time од сега', 'after' => 'по :time', 'before' => 'пред :time', ); carbon/src/Carbon/Lang/hy.php 0000644 00000001444 14716424272 0012031 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count տարի', 'y' => ':countտ', 'month' => ':count ամիս', 'm' => ':countամ', 'week' => ':count շաբաթ', 'w' => ':countշ', 'day' => ':count օր', 'd' => ':countօր', 'hour' => ':count ժամ', 'h' => ':countժ', 'minute' => ':count րոպե', 'min' => ':countր', 'second' => ':count վարկյան', 's' => ':countվրկ', 'ago' => ':time առաջ', 'from_now' => ':time ներկա պահից', 'after' => ':time հետո', 'before' => ':time առաջ', ); carbon/src/Carbon/Lang/uk.php 0000644 00000003453 14716424272 0012032 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count рік|:count роки|:count років', 'y' => ':count рік|:count роки|:count років', 'month' => ':count місяць|:count місяці|:count місяців', 'm' => ':count місяць|:count місяці|:count місяців', 'week' => ':count тиждень|:count тижні|:count тижнів', 'w' => ':count тиждень|:count тижні|:count тижнів', 'day' => ':count день|:count дні|:count днів', 'd' => ':count день|:count дні|:count днів', 'hour' => ':count година|:count години|:count годин', 'h' => ':count година|:count години|:count годин', 'minute' => ':count хвилину|:count хвилини|:count хвилин', 'min' => ':count хвилину|:count хвилини|:count хвилин', 'second' => ':count секунду|:count секунди|:count секунд', 's' => ':count секунду|:count секунди|:count секунд', 'ago' => ':time тому', 'from_now' => 'через :time', 'after' => ':time після', 'before' => ':time до', 'diff_now' => 'щойно', 'diff_yesterday' => 'вчора', 'diff_tomorrow' => 'завтра', 'diff_before_yesterday' => 'позавчора', 'diff_after_tomorrow' => 'післязавтра', 'period_recurrences' => 'один раз|:count рази|:count разів', 'period_interval' => 'кожні :interval', 'period_start_date' => 'з :date', 'period_end_date' => 'до :date', ); carbon/src/Carbon/Lang/bs_BA.php 0000644 00000002222 14716424272 0012352 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count godina|:count godine|:count godina', 'y' => ':count godina|:count godine|:count godina', 'month' => ':count mjesec|:count mjeseca|:count mjeseci', 'm' => ':count mjesec|:count mjeseca|:count mjeseci', 'week' => ':count nedjelja|:count nedjelje|:count nedjelja', 'w' => ':count nedjelja|:count nedjelje|:count nedjelja', 'day' => ':count dan|:count dana|:count dana', 'd' => ':count dan|:count dana|:count dana', 'hour' => ':count sat|:count sata|:count sati', 'h' => ':count sat|:count sata|:count sati', 'minute' => ':count minut|:count minuta|:count minuta', 'min' => ':count minut|:count minuta|:count minuta', 'second' => ':count sekund|:count sekunda|:count sekundi', 's' => ':count sekund|:count sekunda|:count sekundi', 'ago' => 'prije :time', 'from_now' => 'za :time', 'after' => 'nakon :time', 'before' => ':time ranije', ); carbon/src/Carbon/Lang/fo.php 0000644 00000001726 14716424272 0012020 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count ár|:count ár', 'y' => ':count ár|:count ár', 'month' => ':count mánaður|:count mánaðir', 'm' => ':count mánaður|:count mánaðir', 'week' => ':count vika|:count vikur', 'w' => ':count vika|:count vikur', 'day' => ':count dag|:count dagar', 'd' => ':count dag|:count dagar', 'hour' => ':count tími|:count tímar', 'h' => ':count tími|:count tímar', 'minute' => ':count minutt|:count minuttir', 'min' => ':count minutt|:count minuttir', 'second' => ':count sekund|:count sekundir', 's' => ':count sekund|:count sekundir', 'ago' => ':time síðan', 'from_now' => 'um :time', 'after' => ':time aftaná', 'before' => ':time áðrenn', ); carbon/src/Carbon/Lang/mn.php 0000644 00000004304 14716424272 0012021 0 ustar 00 * * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * @translator Batmandakh Erdenebileg
*/ return array( 'year' => ':count жил', 'y' => ':count жил', 'month' => ':count сар', 'm' => ':count сар', 'week' => ':count долоо хоног', 'w' => ':count долоо хоног', 'day' => ':count өдөр', 'd' => ':count өдөр', 'hour' => ':count цаг', 'h' => ':countц', 'minute' => ':count минут', 'min' => ':countм', 'second' => ':count секунд', 's' => ':countс', 'ago' => ':timeн өмнө', 'year_ago' => ':count жилий', 'month_ago' => ':count сары', 'day_ago' => ':count хоногий', 'hour_ago' => ':count цагий', 'minute_ago' => ':count минуты', 'second_ago' => ':count секунды', 'from_now' => 'одоогоос :time', 'year_from_now' => ':count жилийн дараа', 'month_from_now' => ':count сарын дараа', 'day_from_now' => ':count хоногийн дараа', 'hour_from_now' => ':count цагийн дараа', 'minute_from_now' => ':count минутын дараа', 'second_from_now' => ':count секундын дараа', // Does it required to make translation for before, after as follows? hmm, I think we've made it with ago and from now keywords already. Anyway, I've included it just in case of undesired action... 'after' => ':timeн дараа', 'year_after' => ':count жилий', 'month_after' => ':count сары', 'day_after' => ':count хоногий', 'hour_after' => ':count цагий', 'minute_after' => ':count минуты', 'second_after' => ':count секунды', 'before' => ':timeн өмнө', 'year_before' => ':count жилий', 'month_before' => ':count сары', 'day_before' => ':count хоногий', 'hour_before' => ':count цагий', 'minute_before' => ':count минуты', 'second_before' => ':count секунды', ); carbon/src/Carbon/Lang/ar_Shakl.php 0000644 00000004032 14716424272 0013131 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => '[0,1] سَنَة|{2} سَنَتَيْن|[3,10]:count سَنَوَات|[11,Inf]:count سَنَة', 'y' => '[0,1] سَنَة|{2} سَنَتَيْن|[3,10]:count سَنَوَات|[11,Inf]:count سَنَة', 'month' => '[0,1] شَهْرَ|{2} شَهْرَيْن|[3,10]:count أَشْهُر|[11,Inf]:count شَهْرَ', 'm' => '[0,1] شَهْرَ|{2} شَهْرَيْن|[3,10]:count أَشْهُر|[11,Inf]:count شَهْرَ', 'week' => '[0,1] أُسْبُوع|{2} أُسْبُوعَيْن|[3,10]:count أَسَابِيع|[11,Inf]:count أُسْبُوع', 'w' => '[0,1] أُسْبُوع|{2} أُسْبُوعَيْن|[3,10]:count أَسَابِيع|[11,Inf]:count أُسْبُوع', 'day' => '[0,1] يَوْم|{2} يَوْمَيْن|[3,10]:count أَيَّام|[11,Inf] يَوْم', 'd' => '[0,1] يَوْم|{2} يَوْمَيْن|[3,10]:count أَيَّام|[11,Inf] يَوْم', 'hour' => '[0,1] سَاعَة|{2} سَاعَتَيْن|[3,10]:count سَاعَات|[11,Inf]:count سَاعَة', 'h' => '[0,1] سَاعَة|{2} سَاعَتَيْن|[3,10]:count سَاعَات|[11,Inf]:count سَاعَة', 'minute' => '[0,1] دَقِيقَة|{2} دَقِيقَتَيْن|[3,10]:count دَقَائِق|[11,Inf]:count دَقِيقَة', 'min' => '[0,1] دَقِيقَة|{2} دَقِيقَتَيْن|[3,10]:count دَقَائِق|[11,Inf]:count دَقِيقَة', 'second' => '[0,1] ثَانِيَة|{2} ثَانِيَتَيْن|[3,10]:count ثَوَان|[11,Inf]:count ثَانِيَة', 's' => '[0,1] ثَانِيَة|{2} ثَانِيَتَيْن|[3,10]:count ثَوَان|[11,Inf]:count ثَانِيَة', 'ago' => 'مُنْذُ :time', 'from_now' => 'مِنَ الْآن :time', 'after' => 'بَعْدَ :time', 'before' => 'قَبْلَ :time', ); carbon/src/Carbon/Lang/sv.php 0000644 00000001707 14716424272 0012043 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count år|:count år', 'y' => ':count år|:count år', 'month' => ':count månad|:count månader', 'm' => ':count månad|:count månader', 'week' => ':count vecka|:count veckor', 'w' => ':count vecka|:count veckor', 'day' => ':count dag|:count dagar', 'd' => ':count dag|:count dagar', 'hour' => ':count timme|:count timmar', 'h' => ':count timme|:count timmar', 'minute' => ':count minut|:count minuter', 'min' => ':count minut|:count minuter', 'second' => ':count sekund|:count sekunder', 's' => ':count sekund|:count sekunder', 'ago' => ':time sedan', 'from_now' => 'om :time', 'after' => ':time efter', 'before' => ':time före', ); carbon/src/Carbon/Lang/ko.php 0000644 00000001374 14716424272 0012024 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count 년', 'y' => ':count 년', 'month' => ':count 개월', 'm' => ':count 개월', 'week' => ':count 주일', 'w' => ':count 주일', 'day' => ':count 일', 'd' => ':count 일', 'hour' => ':count 시간', 'h' => ':count 시간', 'minute' => ':count 분', 'min' => ':count 분', 'second' => ':count 초', 's' => ':count 초', 'ago' => ':time 전', 'from_now' => ':time 후', 'after' => ':time 이후', 'before' => ':time 이전', ); carbon/src/Carbon/Lang/no.php 0000644 00000002176 14716424272 0012030 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count år|:count år', 'y' => ':count år|:count år', 'month' => ':count måned|:count måneder', 'm' => ':count måned|:count måneder', 'week' => ':count uke|:count uker', 'w' => ':count uke|:count uker', 'day' => ':count dag|:count dager', 'd' => ':count dag|:count dager', 'hour' => ':count time|:count timer', 'h' => ':count time|:count timer', 'minute' => ':count minutt|:count minutter', 'min' => ':count minutt|:count minutter', 'second' => ':count sekund|:count sekunder', 's' => ':count sekund|:count sekunder', 'ago' => ':time siden', 'from_now' => 'om :time', 'after' => ':time etter', 'before' => ':time før', 'diff_now' => 'akkurat nå', 'diff_yesterday' => 'i går', 'diff_tomorrow' => 'i morgen', 'diff_before_yesterday' => 'i forgårs', 'diff_after_tomorrow' => 'i overmorgen', ); carbon/src/Carbon/Lang/oc.php 0000644 00000002644 14716424272 0012015 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ \Symfony\Component\Translation\PluralizationRules::set(function ($number) { return $number == 1 ? 0 : 1; }, 'oc'); return array( 'year' => ':count an|:count ans', 'y' => ':count an|:count ans', 'month' => ':count mes|:count meses', 'm' => ':count mes|:count meses', 'week' => ':count setmana|:count setmanas', 'w' => ':count setmana|:count setmanas', 'day' => ':count jorn|:count jorns', 'd' => ':count jorn|:count jorns', 'hour' => ':count ora|:count oras', 'h' => ':count ora|:count oras', 'minute' => ':count minuta|:count minutas', 'min' => ':count minuta|:count minutas', 'second' => ':count segonda|:count segondas', 's' => ':count segonda|:count segondas', 'ago' => 'fa :time', 'from_now' => 'dins :time', 'after' => ':time aprèp', 'before' => ':time abans', 'diff_now' => 'ara meteis', 'diff_yesterday' => 'ièr', 'diff_tomorrow' => 'deman', 'diff_before_yesterday' => 'ièr delà', 'diff_after_tomorrow' => 'deman passat', 'period_recurrences' => ':count còp|:count còps', 'period_interval' => 'cada :interval', 'period_start_date' => 'de :date', 'period_end_date' => 'fins a :date', ); carbon/src/Carbon/Lang/sq.php 0000644 00000001704 14716424272 0012033 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count vit|:count vjet', 'y' => ':count vit|:count vjet', 'month' => ':count muaj|:count muaj', 'm' => ':count muaj|:count muaj', 'week' => ':count javë|:count javë', 'w' => ':count javë|:count javë', 'day' => ':count ditë|:count ditë', 'd' => ':count ditë|:count ditë', 'hour' => ':count orë|:count orë', 'h' => ':count orë|:count orë', 'minute' => ':count minutë|:count minuta', 'min' => ':count minutë|:count minuta', 'second' => ':count sekondë|:count sekonda', 's' => ':count sekondë|:count sekonda', 'ago' => ':time më parë', 'from_now' => ':time nga tani', 'after' => ':time pas', 'before' => ':time para', ); carbon/src/Carbon/Lang/lv.php 0000644 00000004062 14716424272 0012031 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => '0 gadiem|:count gada|:count gadiem', 'y' => '0 gadiem|:count gada|:count gadiem', 'month' => '0 mēnešiem|:count mēneša|:count mēnešiem', 'm' => '0 mēnešiem|:count mēneša|:count mēnešiem', 'week' => '0 nedēļām|:count nedēļas|:count nedēļām', 'w' => '0 nedēļām|:count nedēļas|:count nedēļām', 'day' => '0 dienām|:count dienas|:count dienām', 'd' => '0 dienām|:count dienas|:count dienām', 'hour' => '0 stundām|:count stundas|:count stundām', 'h' => '0 stundām|:count stundas|:count stundām', 'minute' => '0 minūtēm|:count minūtes|:count minūtēm', 'min' => '0 minūtēm|:count minūtes|:count minūtēm', 'second' => '0 sekundēm|:count sekundes|:count sekundēm', 's' => '0 sekundēm|:count sekundes|:count sekundēm', 'ago' => 'pirms :time', 'from_now' => 'pēc :time', 'after' => ':time vēlāk', 'before' => ':time pirms', 'year_after' => '0 gadus|:count gadu|:count gadus', 'month_after' => '0 mēnešus|:count mēnesi|:count mēnešus', 'week_after' => '0 nedēļas|:count nedēļu|:count nedēļas', 'day_after' => '0 dienas|:count dienu|:count dienas', 'hour_after' => '0 stundas|:count stundu|:count stundas', 'minute_after' => '0 minūtes|:count minūti|:count minūtes', 'second_after' => '0 sekundes|:count sekundi|:count sekundes', 'year_before' => '0 gadus|:count gadu|:count gadus', 'month_before' => '0 mēnešus|:count mēnesi|:count mēnešus', 'week_before' => '0 nedēļas|:count nedēļu|:count nedēļas', 'day_before' => '0 dienas|:count dienu|:count dienas', 'hour_before' => '0 stundas|:count stundu|:count stundas', 'minute_before' => '0 minūtes|:count minūti|:count minūtes', 'second_before' => '0 sekundes|:count sekundi|:count sekundes', ); carbon/src/Carbon/Lang/km.php 0000644 00000001664 14716424272 0012024 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count ឆ្នាំ', 'y' => ':count ឆ្នាំ', 'month' => ':count ខែ', 'm' => ':count ខែ', 'week' => ':count សប្ដាហ៍', 'w' => ':count សប្ដាហ៍', 'day' => ':count ថ្ងៃ', 'd' => ':count ថ្ងៃ', 'hour' => ':count ម៉ោង', 'h' => ':count ម៉ោង', 'minute' => ':count នាទី', 'min' => ':count នាទី', 'second' => ':count វិនាទី', 's' => ':count វិនាទី', 'ago' => ':timeមុន', 'from_now' => ':timeពីឥឡូវ', 'after' => 'នៅក្រោយ :time', 'before' => 'នៅមុន :time', ); carbon/src/Carbon/Lang/fa.php 0000644 00000001472 14716424272 0012000 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count سال', 'y' => ':count سال', 'month' => ':count ماه', 'm' => ':count ماه', 'week' => ':count هفته', 'w' => ':count هفته', 'day' => ':count روز', 'd' => ':count روز', 'hour' => ':count ساعت', 'h' => ':count ساعت', 'minute' => ':count دقیقه', 'min' => ':count دقیقه', 'second' => ':count ثانیه', 's' => ':count ثانیه', 'ago' => ':time پیش', 'from_now' => ':time بعد', 'after' => ':time پس از', 'before' => ':time پیش از', ); carbon/src/Carbon/Lang/uz.php 0000644 00000001370 14716424272 0012045 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count yil', 'y' => ':count yil', 'month' => ':count oy', 'm' => ':count oy', 'week' => ':count hafta', 'w' => ':count hafta', 'day' => ':count kun', 'd' => ':count kun', 'hour' => ':count soat', 'h' => ':count soat', 'minute' => ':count daqiqa', 'min' => ':count daq', 'second' => ':count soniya', 's' => ':count s', 'ago' => ':time avval', 'from_now' => ':time dan keyin', 'after' => ':time keyin', 'before' => ':time oldin', ); carbon/src/Carbon/Lang/my.php 0000644 00000003052 14716424272 0012033 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count နှစ်|:count နှစ်', 'y' => ':count နှစ်|:count နှစ်', 'month' => ':count လ|:count လ', 'm' => ':count လ|:count လ', 'week' => ':count ပတ်|:count ပတ်', 'w' => ':count ပတ်|:count ပတ်', 'day' => ':count ရက်|:count ရက်', 'd' => ':count ရက်|:count ရက်', 'hour' => ':count နာရီ|:count နာရီ', 'h' => ':count နာရီ|:count နာရီ', 'minute' => ':count မိနစ်|:count မိနစ်', 'min' => ':count မိနစ်|:count မိနစ်', 'second' => ':count စက္ကန့်|:count စက္ကန့်', 's' => ':count စက္ကန့်|:count စက္ကန့်', 'ago' => 'လွန်ခဲ့သော :time က', 'from_now' => 'ယခုမှစ၍နောက် :time အကြာ', 'after' => ':time ကြာပြီးနောက်', 'before' => ':time မတိုင်ခင်', 'diff_now' => 'အခုလေးတင်', 'diff_yesterday' => 'မနေ့က', 'diff_tomorrow' => 'မနက်ဖြန်', 'diff_before_yesterday' => 'တမြန်နေ့က', 'diff_after_tomorrow' => 'တဘက်ခါ', 'period_recurrences' => ':count ကြိမ်', ); carbon/src/Carbon/Lang/es.php 0000644 00000002213 14716424272 0012013 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count año|:count años', 'y' => ':count año|:count años', 'month' => ':count mes|:count meses', 'm' => ':count mes|:count meses', 'week' => ':count semana|:count semanas', 'w' => ':count semana|:count semanas', 'day' => ':count día|:count días', 'd' => ':count día|:count días', 'hour' => ':count hora|:count horas', 'h' => ':count hora|:count horas', 'minute' => ':count minuto|:count minutos', 'min' => ':count minuto|:count minutos', 'second' => ':count segundo|:count segundos', 's' => ':count segundo|:count segundos', 'ago' => 'hace :time', 'from_now' => 'dentro de :time', 'after' => ':time después', 'before' => ':time antes', 'diff_now' => 'ahora mismo', 'diff_yesterday' => 'ayer', 'diff_tomorrow' => 'mañana', 'diff_before_yesterday' => 'antier', 'diff_after_tomorrow' => 'pasado mañana', ); carbon/src/Carbon/Lang/th.php 0000644 00000001720 14716424272 0012021 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count ปี', 'y' => ':count ปี', 'month' => ':count เดือน', 'm' => ':count เดือน', 'week' => ':count สัปดาห์', 'w' => ':count สัปดาห์', 'day' => ':count วัน', 'd' => ':count วัน', 'hour' => ':count ชั่วโมง', 'h' => ':count ชั่วโมง', 'minute' => ':count นาที', 'min' => ':count นาที', 'second' => ':count วินาที', 's' => ':count วินาที', 'ago' => ':timeที่แล้ว', 'from_now' => ':timeต่อจากนี้', 'after' => ':timeหลังจากนี้', 'before' => ':timeก่อน', ); carbon/src/Carbon/Lang/lt.php 0000644 00000003321 14716424272 0012024 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count metus|:count metus|:count metų', 'y' => ':count metus|:count metus|:count metų', 'month' => ':count mėnesį|:count mėnesius|:count mėnesių', 'm' => ':count mėnesį|:count mėnesius|:count mėnesių', 'week' => ':count savaitę|:count savaites|:count savaičių', 'w' => ':count savaitę|:count savaites|:count savaičių', 'day' => ':count dieną|:count dienas|:count dienų', 'd' => ':count dieną|:count dienas|:count dienų', 'hour' => ':count valandą|:count valandas|:count valandų', 'h' => ':count valandą|:count valandas|:count valandų', 'minute' => ':count minutę|:count minutes|:count minučių', 'min' => ':count minutę|:count minutes|:count minučių', 'second' => ':count sekundę|:count sekundes|:count sekundžių', 's' => ':count sekundę|:count sekundes|:count sekundžių', 'second_from_now' => ':count sekundės|:count sekundžių|:count sekundžių', 'minute_from_now' => ':count minutės|:count minučių|:count minučių', 'hour_from_now' => ':count valandos|:count valandų|:count valandų', 'day_from_now' => ':count dienos|:count dienų|:count dienų', 'week_from_now' => ':count savaitės|:count savaičių|:count savaičių', 'month_from_now' => ':count mėnesio|:count mėnesių|:count mėnesių', 'year_from_now' => ':count metų', 'ago' => 'prieš :time', 'from_now' => 'už :time', 'after' => 'po :time', 'before' => ':time nuo dabar', ); carbon/src/Carbon/Lang/sr_ME.php 0000644 00000000422 14716424272 0012411 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/sr_Latn_ME.php'; carbon/src/Carbon/Lang/error_log; 0000644 00000057552 14716424272 0012723 0 ustar 00 [28-Nov-2023 07:22:39 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [28-Nov-2023 07:22:45 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [29-Nov-2023 20:03:08 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [29-Nov-2023 20:03:11 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [29-Nov-2023 20:31:41 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [29-Nov-2023 20:31:57 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [02-Dec-2023 12:40:29 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [02-Dec-2023 12:40:42 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [16-Feb-2024 00:43:14 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [25-Feb-2024 12:24:15 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [26-Feb-2024 06:07:22 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [01-May-2024 13:01:21 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [05-May-2024 00:26:16 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [05-May-2024 00:26:41 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [05-May-2024 10:21:44 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [05-May-2024 10:22:07 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [05-May-2024 20:01:56 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [05-May-2024 20:02:20 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [11-May-2024 11:21:21 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [11-May-2024 18:02:20 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [14-May-2024 19:43:00 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [14-May-2024 19:43:25 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [18-May-2024 16:05:23 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [18-May-2024 17:14:13 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [30-May-2024 21:25:41 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [30-May-2024 21:48:43 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [06-Jun-2024 08:28:40 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [06-Jun-2024 10:04:26 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [07-Jun-2024 11:53:42 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [19-Jun-2024 01:22:09 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [19-Jun-2024 01:22:33 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [19-Jun-2024 11:43:21 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [19-Jun-2024 11:43:45 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [19-Jun-2024 20:11:57 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [19-Jun-2024 20:12:21 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [21-Jun-2024 04:36:02 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [22-Jun-2024 11:09:06 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [05-Jul-2024 06:56:28 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [16-Jul-2024 02:31:34 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [22-Jul-2024 18:55:20 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [22-Jul-2024 18:55:44 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [28-Jul-2024 10:58:23 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [29-Jul-2024 18:00:11 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [03-Aug-2024 08:18:34 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [09-Aug-2024 07:14:44 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [21-Aug-2024 18:36:34 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [01-Sep-2024 22:37:05 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [01-Sep-2024 22:37:29 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [04-Sep-2024 01:51:54 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [04-Sep-2024 20:21:57 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [10-Sep-2024 15:55:36 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [10-Sep-2024 15:56:03 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [10-Sep-2024 15:59:56 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [10-Sep-2024 16:00:20 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [11-Sep-2024 22:24:52 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [11-Sep-2024 22:25:16 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [28-Sep-2024 07:25:08 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [12-Oct-2024 07:14:35 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [13-Oct-2024 01:13:28 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [13-Oct-2024 06:42:11 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [16-Oct-2024 08:53:54 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [18-Oct-2024 16:29:07 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [18-Oct-2024 16:31:26 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [26-Oct-2024 03:51:51 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [29-Oct-2024 14:49:15 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [31-Oct-2024 13:11:45 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [31-Oct-2024 13:12:09 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 [06-Nov-2024 05:44:24 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/sh.php on line 12 [06-Nov-2024 15:47:45 America/Fortaleza] PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Translation\PluralizationRules' not found in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php:12 Stack trace: #0 {main} thrown in /home/mgatv524/public_html/edurocha/vendor/nesbot/carbon/src/Carbon/Lang/oc.php on line 12 carbon/src/Carbon/Lang/hr.php 0000644 00000002212 14716424272 0012014 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count godinu|:count godine|:count godina', 'y' => ':count godinu|:count godine|:count godina', 'month' => ':count mjesec|:count mjeseca|:count mjeseci', 'm' => ':count mjesec|:count mjeseca|:count mjeseci', 'week' => ':count tjedan|:count tjedna|:count tjedana', 'w' => ':count tjedan|:count tjedna|:count tjedana', 'day' => ':count dan|:count dana|:count dana', 'd' => ':count dan|:count dana|:count dana', 'hour' => ':count sat|:count sata|:count sati', 'h' => ':count sat|:count sata|:count sati', 'minute' => ':count minutu|:count minute |:count minuta', 'min' => ':count minutu|:count minute |:count minuta', 'second' => ':count sekundu|:count sekunde|:count sekundi', 's' => ':count sekundu|:count sekunde|:count sekundi', 'ago' => 'prije :time', 'from_now' => 'za :time', 'after' => 'za :time', 'before' => 'prije :time', ); carbon/src/Carbon/Lang/id.php 0000644 00000001424 14716424272 0012003 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count tahun', 'y' => ':count tahun', 'month' => ':count bulan', 'm' => ':count bulan', 'week' => ':count minggu', 'w' => ':count minggu', 'day' => ':count hari', 'd' => ':count hari', 'hour' => ':count jam', 'h' => ':count jam', 'minute' => ':count menit', 'min' => ':count menit', 'second' => ':count detik', 's' => ':count detik', 'ago' => ':time yang lalu', 'from_now' => ':time dari sekarang', 'after' => ':time setelah', 'before' => ':time sebelum', ); carbon/src/Carbon/Lang/hu.php 0000644 00000003064 14716424272 0012025 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count év', 'y' => ':count év', 'month' => ':count hónap', 'm' => ':count hónap', 'week' => ':count hét', 'w' => ':count hét', 'day' => ':count nap', 'd' => ':count nap', 'hour' => ':count óra', 'h' => ':count óra', 'minute' => ':count perc', 'min' => ':count perc', 'second' => ':count másodperc', 's' => ':count másodperc', 'ago' => ':time', 'from_now' => ':time múlva', 'after' => ':time később', 'before' => ':time korábban', 'year_ago' => ':count éve', 'month_ago' => ':count hónapja', 'week_ago' => ':count hete', 'day_ago' => ':count napja', 'hour_ago' => ':count órája', 'minute_ago' => ':count perce', 'second_ago' => ':count másodperce', 'year_after' => ':count évvel', 'month_after' => ':count hónappal', 'week_after' => ':count héttel', 'day_after' => ':count nappal', 'hour_after' => ':count órával', 'minute_after' => ':count perccel', 'second_after' => ':count másodperccel', 'year_before' => ':count évvel', 'month_before' => ':count hónappal', 'week_before' => ':count héttel', 'day_before' => ':count nappal', 'hour_before' => ':count órával', 'minute_before' => ':count perccel', 'second_before' => ':count másodperccel', ); carbon/src/Carbon/Lang/ja.php 0000644 00000001352 14716424272 0012001 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count年', 'y' => ':count年', 'month' => ':countヶ月', 'm' => ':countヶ月', 'week' => ':count週間', 'w' => ':count週間', 'day' => ':count日', 'd' => ':count日', 'hour' => ':count時間', 'h' => ':count時間', 'minute' => ':count分', 'min' => ':count分', 'second' => ':count秒', 's' => ':count秒', 'ago' => ':time前', 'from_now' => '今から:time', 'after' => ':time後', 'before' => ':time前', ); carbon/src/Carbon/Lang/de.php 0000644 00000002737 14716424272 0012007 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count Jahr|:count Jahre', 'y' => ':countJ|:countJ', 'month' => ':count Monat|:count Monate', 'm' => ':countMon|:countMon', 'week' => ':count Woche|:count Wochen', 'w' => ':countWo|:countWo', 'day' => ':count Tag|:count Tage', 'd' => ':countTg|:countTg', 'hour' => ':count Stunde|:count Stunden', 'h' => ':countStd|:countStd', 'minute' => ':count Minute|:count Minuten', 'min' => ':countMin|:countMin', 'second' => ':count Sekunde|:count Sekunden', 's' => ':countSek|:countSek', 'ago' => 'vor :time', 'from_now' => 'in :time', 'after' => ':time später', 'before' => ':time zuvor', 'year_from_now' => ':count Jahr|:count Jahren', 'month_from_now' => ':count Monat|:count Monaten', 'week_from_now' => ':count Woche|:count Wochen', 'day_from_now' => ':count Tag|:count Tagen', 'year_ago' => ':count Jahr|:count Jahren', 'month_ago' => ':count Monat|:count Monaten', 'week_ago' => ':count Woche|:count Wochen', 'day_ago' => ':count Tag|:count Tagen', 'diff_now' => 'Gerade eben', 'diff_yesterday' => 'Gestern', 'diff_tomorrow' => 'Heute', 'diff_before_yesterday' => 'Vorgestern', 'diff_after_tomorrow' => 'Übermorgen', ); carbon/src/Carbon/Lang/pt.php 0000644 00000001703 14716424272 0012032 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count ano|:count anos', 'y' => ':count ano|:count anos', 'month' => ':count mês|:count meses', 'm' => ':count mês|:count meses', 'week' => ':count semana|:count semanas', 'w' => ':count semana|:count semanas', 'day' => ':count dia|:count dias', 'd' => ':count dia|:count dias', 'hour' => ':count hora|:count horas', 'h' => ':count hora|:count horas', 'minute' => ':count minuto|:count minutos', 'min' => ':count minuto|:count minutos', 'second' => ':count segundo|:count segundos', 's' => ':count segundo|:count segundos', 'ago' => ':time atrás', 'from_now' => 'em :time', 'after' => ':time depois', 'before' => ':time antes', ); carbon/src/Carbon/Lang/he.php 0000644 00000002214 14716424272 0012001 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => 'שנה|{2}שנתיים|:count שנים', 'y' => 'שנה|{2}שנתיים|:count שנים', 'month' => 'חודש|{2}חודשיים|:count חודשים', 'm' => 'חודש|{2}חודשיים|:count חודשים', 'week' => 'שבוע|{2}שבועיים|:count שבועות', 'w' => 'שבוע|{2}שבועיים|:count שבועות', 'day' => 'יום|{2}יומיים|:count ימים', 'd' => 'יום|{2}יומיים|:count ימים', 'hour' => 'שעה|{2}שעתיים|:count שעות', 'h' => 'שעה|{2}שעתיים|:count שעות', 'minute' => 'דקה|{2}דקותיים|:count דקות', 'min' => 'דקה|{2}דקותיים|:count דקות', 'second' => 'שניה|:count שניות', 's' => 'שניה|:count שניות', 'ago' => 'לפני :time', 'from_now' => 'בעוד :time', 'after' => 'אחרי :time', 'before' => 'לפני :time', ); carbon/src/Carbon/Lang/sr_Cyrl.php 0000644 00000003705 14716424272 0013030 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[ :count година', 'y' => ':count г.', 'month' => '{1} :count месец|{2,3,4}:count месеца|[5,Inf[ :count месеци', 'm' => ':count м.', 'week' => '{1} :count недеља|{2,3,4}:count недеље|[5,Inf[ :count недеља', 'w' => ':count нед.', 'day' => '{1,21,31} :count дан|[2,Inf[ :count дана', 'd' => ':count д.', 'hour' => '{1,21} :count сат|{2,3,4,22,23,24}:count сата|[5,Inf[ :count сати', 'h' => ':count ч.', 'minute' => '{1,21,31,41,51} :count минут|[2,Inf[ :count минута', 'min' => ':count мин.', 'second' => '{1,21,31,41,51} :count секунд|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count секунде|[5,Inf[:count секунди', 's' => ':count сек.', 'ago' => 'пре :time', 'from_now' => 'за :time', 'after' => ':time након', 'before' => ':time пре', 'year_from_now' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година', 'year_ago' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година', 'week_from_now' => '{1} :count недељу|{2,3,4} :count недеље|[5,Inf[ :count недеља', 'week_ago' => '{1} :count недељу|{2,3,4} :count недеље|[5,Inf[ :count недеља', 'diff_now' => 'управо сада', 'diff_yesterday' => 'јуче', 'diff_tomorrow' => 'сутра', 'diff_before_yesterday' => 'прекјуче', 'diff_after_tomorrow' => 'прекосутра', ); carbon/src/Carbon/Lang/cy.php 0000644 00000001407 14716424272 0012023 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => '1 flwyddyn|:count blynedd', 'y' => ':countbl', 'month' => '1 mis|:count fis', 'm' => ':countmi', 'week' => ':count wythnos', 'w' => ':countw', 'day' => ':count diwrnod', 'd' => ':countd', 'hour' => ':count awr', 'h' => ':counth', 'minute' => ':count munud', 'min' => ':countm', 'second' => ':count eiliad', 's' => ':counts', 'ago' => ':time yn ôl', 'from_now' => ':time o hyn ymlaen', 'after' => ':time ar ôl', 'before' => ':time o\'r blaen', ); carbon/src/Carbon/Lang/sw.php 0000644 00000001604 14716424272 0012040 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => 'mwaka 1|miaka :count', 'y' => 'mwaka 1|miaka :count', 'month' => 'mwezi 1|miezi :count', 'm' => 'mwezi 1|miezi :count', 'week' => 'wiki 1|wiki :count', 'w' => 'wiki 1|wiki :count', 'day' => 'siku 1|siku :count', 'd' => 'siku 1|siku :count', 'hour' => 'saa 1|masaa :count', 'h' => 'saa 1|masaa :count', 'minute' => 'dakika 1|dakika :count', 'min' => 'dakika 1|dakika :count', 'second' => 'sekunde 1|sekunde :count', 's' => 'sekunde 1|sekunde :count', 'ago' => ':time ziliyopita', 'from_now' => ':time kwanzia sasa', 'after' => ':time baada', 'before' => ':time kabla', ); carbon/src/Carbon/Lang/ps.php 0000644 00000002066 14716424272 0012034 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count کال|:count کاله', 'y' => ':countکال|:countکاله', 'month' => ':count مياشت|:count مياشتي', 'm' => ':countمياشت|:countمياشتي', 'week' => ':count اونۍ|:count اونۍ', 'w' => ':countاونۍ|:countاونۍ', 'day' => ':count ورځ|:count ورځي', 'd' => ':countورځ|:countورځي', 'hour' => ':count ساعت|:count ساعته', 'h' => ':countساعت|:countساعته', 'minute' => ':count دقيقه|:count دقيقې', 'min' => ':countدقيقه|:countدقيقې', 'second' => ':count ثانيه|:count ثانيې', 's' => ':countثانيه|:countثانيې', 'ago' => ':time دمخه', 'from_now' => ':time له اوس څخه', 'after' => ':time وروسته', 'before' => ':time دمخه', ); carbon/src/Carbon/Lang/sl.php 0000644 00000003772 14716424272 0012035 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count leto|:count leti|:count leta|:count let', 'y' => ':count leto|:count leti|:count leta|:count let', 'month' => ':count mesec|:count meseca|:count mesece|:count mesecev', 'm' => ':count mesec|:count meseca|:count mesece|:count mesecev', 'week' => ':count teden|:count tedna|:count tedne|:count tednov', 'w' => ':count teden|:count tedna|:count tedne|:count tednov', 'day' => ':count dan|:count dni|:count dni|:count dni', 'd' => ':count dan|:count dni|:count dni|:count dni', 'hour' => ':count uro|:count uri|:count ure|:count ur', 'h' => ':count uro|:count uri|:count ure|:count ur', 'minute' => ':count minuto|:count minuti|:count minute|:count minut', 'min' => ':count minuto|:count minuti|:count minute|:count minut', 'second' => ':count sekundo|:count sekundi|:count sekunde|:count sekund', 's' => ':count sekundo|:count sekundi|:count sekunde|:count sekund', 'year_ago' => ':count letom|:count leti|:count leti|:count leti', 'month_ago' => ':count mesecem|:count meseci|:count meseci|:count meseci', 'week_ago' => ':count tednom|:count tednoma|:count tedni|:count tedni', 'day_ago' => ':count dnem|:count dnevoma|:count dnevi|:count dnevi', 'hour_ago' => ':count uro|:count urama|:count urami|:count urami', 'minute_ago' => ':count minuto|:count minutama|:count minutami|:count minutami', 'second_ago' => ':count sekundo|:count sekundama|:count sekundami|:count sekundami', 'ago' => 'pred :time', 'from_now' => 'čez :time', 'after' => 'čez :time', 'before' => 'pred :time', 'diff_now' => 'ravnokar', 'diff_yesterday' => 'včeraj', 'diff_tomorrow' => 'jutri', 'diff_before_yesterday' => 'predvčerajšnjim', 'diff_after_tomorrow' => 'pojutrišnjem', ); carbon/src/Carbon/Lang/eu.php 0000644 00000001572 14716424272 0012024 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => 'Urte 1|:count urte', 'y' => 'Urte 1|:count urte', 'month' => 'Hile 1|:count hile', 'm' => 'Hile 1|:count hile', 'week' => 'Aste 1|:count aste', 'w' => 'Aste 1|:count aste', 'day' => 'Egun 1|:count egun', 'd' => 'Egun 1|:count egun', 'hour' => 'Ordu 1|:count ordu', 'h' => 'Ordu 1|:count ordu', 'minute' => 'Minutu 1|:count minutu', 'min' => 'Minutu 1|:count minutu', 'second' => 'Segundu 1|:count segundu', 's' => 'Segundu 1|:count segundu', 'ago' => 'Orain dela :time', 'from_now' => ':time barru', 'after' => ':time geroago', 'before' => ':time lehenago', ); carbon/src/Carbon/Lang/zh_TW.php 0000644 00000001344 14716424272 0012443 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count年', 'y' => ':count年', 'month' => ':count月', 'm' => ':count月', 'week' => ':count週', 'w' => ':count週', 'day' => ':count天', 'd' => ':count天', 'hour' => ':count小時', 'h' => ':count小時', 'minute' => ':count分鐘', 'min' => ':count分鐘', 'second' => ':count秒', 's' => ':count秒', 'ago' => ':time前', 'from_now' => '距現在:time', 'after' => ':time後', 'before' => ':time前', ); carbon/src/Carbon/Lang/hi.php 0000644 00000002234 14716424272 0012007 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => '1 वर्ष|:count वर्षों', 'y' => '1 वर्ष|:count वर्षों', 'month' => '1 माह|:count महीने', 'm' => '1 माह|:count महीने', 'week' => '1 सप्ताह|:count सप्ताह', 'w' => '1 सप्ताह|:count सप्ताह', 'day' => '1 दिन|:count दिनों', 'd' => '1 दिन|:count दिनों', 'hour' => '1 घंटा|:count घंटे', 'h' => '1 घंटा|:count घंटे', 'minute' => '1 मिनट|:count मिनटों', 'min' => '1 मिनट|:count मिनटों', 'second' => '1 सेकंड|:count सेकंड', 's' => '1 सेकंड|:count सेकंड', 'ago' => ':time पूर्व', 'from_now' => ':time से', 'after' => ':time के बाद', 'before' => ':time के पहले', ); carbon/src/Carbon/Lang/fr.php 0000644 00000002300 14716424272 0012010 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count an|:count ans', 'y' => ':count an|:count ans', 'month' => ':count mois', 'm' => ':count mois', 'week' => ':count semaine|:count semaines', 'w' => ':count sem.', 'day' => ':count jour|:count jours', 'd' => ':count j.', 'hour' => ':count heure|:count heures', 'h' => ':count h.', 'minute' => ':count minute|:count minutes', 'min' => ':count min.', 'second' => ':count seconde|:count secondes', 's' => ':count sec.', 'ago' => 'il y a :time', 'from_now' => 'dans :time', 'after' => ':time après', 'before' => ':time avant', 'diff_now' => "à l'instant", 'diff_yesterday' => 'hier', 'diff_tomorrow' => 'demain', 'diff_before_yesterday' => 'avant-hier', 'diff_after_tomorrow' => 'après-demain', 'period_recurrences' => ':count fois', 'period_interval' => 'tous les :interval', 'period_start_date' => 'de :date', 'period_end_date' => 'à :date', ); carbon/src/Carbon/Lang/ms.php 0000644 00000001422 14716424272 0012024 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count tahun', 'y' => ':count tahun', 'month' => ':count bulan', 'm' => ':count bulan', 'week' => ':count minggu', 'w' => ':count minggu', 'day' => ':count hari', 'd' => ':count hari', 'hour' => ':count jam', 'h' => ':count jam', 'minute' => ':count minit', 'min' => ':count minit', 'second' => ':count saat', 's' => ':count saat', 'ago' => ':time yang lalu', 'from_now' => ':time dari sekarang', 'after' => ':time selepas', 'before' => ':time sebelum', ); carbon/src/Carbon/Lang/fi.php 0000644 00000002016 14716424272 0012003 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count vuosi|:count vuotta', 'y' => ':count vuosi|:count vuotta', 'month' => ':count kuukausi|:count kuukautta', 'm' => ':count kuukausi|:count kuukautta', 'week' => ':count viikko|:count viikkoa', 'w' => ':count viikko|:count viikkoa', 'day' => ':count päivä|:count päivää', 'd' => ':count päivä|:count päivää', 'hour' => ':count tunti|:count tuntia', 'h' => ':count tunti|:count tuntia', 'minute' => ':count minuutti|:count minuuttia', 'min' => ':count minuutti|:count minuuttia', 'second' => ':count sekunti|:count sekuntia', 's' => ':count sekunti|:count sekuntia', 'ago' => ':time sitten', 'from_now' => ':time tästä hetkestä', 'after' => ':time sen jälkeen', 'before' => ':time ennen', ); carbon/src/Carbon/Lang/az.php 0000644 00000002214 14716424272 0012017 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count il', 'y' => ':count il', 'month' => ':count ay', 'm' => ':count ay', 'week' => ':count həftə', 'w' => ':count həftə', 'day' => ':count gün', 'd' => ':count gün', 'hour' => ':count saat', 'h' => ':count saat', 'minute' => ':count dəqiqə', 'min' => ':count dəqiqə', 'second' => ':count saniyə', 's' => ':count saniyə', 'ago' => ':time əvvəl', 'from_now' => ':time sonra', 'after' => ':time sonra', 'before' => ':time əvvəl', 'diff_now' => 'indi', 'diff_yesterday' => 'dünən', 'diff_tomorrow' => 'sabah', 'diff_before_yesterday' => 'srağagün', 'diff_after_tomorrow' => 'birisi gün', 'period_recurrences' => ':count dəfədən bir', 'period_interval' => 'hər :interval', 'period_start_date' => ':date tarixindən başlayaraq', 'period_end_date' => ':date tarixinədək', ); carbon/src/Carbon/Lang/sh.php 0000644 00000002621 14716424272 0012021 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ \Symfony\Component\Translation\PluralizationRules::set(function ($number) { return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); }, 'sh'); return array( 'year' => ':count godina|:count godine|:count godina', 'y' => ':count godina|:count godine|:count godina', 'month' => ':count mesec|:count meseca|:count meseci', 'm' => ':count mesec|:count meseca|:count meseci', 'week' => ':count nedelja|:count nedelje|:count nedelja', 'w' => ':count nedelja|:count nedelje|:count nedelja', 'day' => ':count dan|:count dana|:count dana', 'd' => ':count dan|:count dana|:count dana', 'hour' => ':count čas|:count časa|:count časova', 'h' => ':count čas|:count časa|:count časova', 'minute' => ':count minut|:count minuta|:count minuta', 'min' => ':count minut|:count minuta|:count minuta', 'second' => ':count sekund|:count sekunda|:count sekundi', 's' => ':count sekund|:count sekunda|:count sekundi', 'ago' => 'pre :time', 'from_now' => 'za :time', 'after' => 'nakon :time', 'before' => ':time raniјe', ); carbon/src/Carbon/Lang/ca.php 0000644 00000002452 14716424272 0011774 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count any|:count anys', 'y' => ':count any|:count anys', 'month' => ':count mes|:count mesos', 'm' => ':count mes|:count mesos', 'week' => ':count setmana|:count setmanes', 'w' => ':count setmana|:count setmanes', 'day' => ':count dia|:count dies', 'd' => ':count dia|:count dies', 'hour' => ':count hora|:count hores', 'h' => ':count hora|:count hores', 'minute' => ':count minut|:count minuts', 'min' => ':count minut|:count minuts', 'second' => ':count segon|:count segons', 's' => ':count segon|:count segons', 'ago' => 'fa :time', 'from_now' => 'd\'aquí :time', 'after' => ':time després', 'before' => ':time abans', 'diff_now' => 'ara mateix', 'diff_yesterday' => 'ahir', 'diff_tomorrow' => 'demà', 'diff_before_yesterday' => "abans d'ahir", 'diff_after_tomorrow' => 'demà passat', 'period_recurrences' => ':count cop|:count cops', 'period_interval' => 'cada :interval', 'period_start_date' => 'de :date', 'period_end_date' => 'fins a :date', ); carbon/src/Carbon/Lang/da.php 0000644 00000001672 14716424272 0012000 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count år|:count år', 'y' => ':count år|:count år', 'month' => ':count måned|:count måneder', 'm' => ':count måned|:count måneder', 'week' => ':count uge|:count uger', 'w' => ':count uge|:count uger', 'day' => ':count dag|:count dage', 'd' => ':count dag|:count dage', 'hour' => ':count time|:count timer', 'h' => ':count time|:count timer', 'minute' => ':count minut|:count minutter', 'min' => ':count minut|:count minutter', 'second' => ':count sekund|:count sekunder', 's' => ':count sekund|:count sekunder', 'ago' => ':time siden', 'from_now' => 'om :time', 'after' => ':time efter', 'before' => ':time før', ); carbon/src/Carbon/Lang/zh.php 0000644 00000001352 14716424272 0012030 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count年', 'y' => ':count年', 'month' => ':count个月', 'm' => ':count个月', 'week' => ':count周', 'w' => ':count周', 'day' => ':count天', 'd' => ':count天', 'hour' => ':count小时', 'h' => ':count小时', 'minute' => ':count分钟', 'min' => ':count分钟', 'second' => ':count秒', 's' => ':count秒', 'ago' => ':time前', 'from_now' => '距现在:time', 'after' => ':time后', 'before' => ':time前', ); carbon/src/Carbon/Lang/ro.php 0000644 00000002112 14716424272 0012022 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => 'un an|:count ani|:count ani', 'y' => 'un an|:count ani|:count ani', 'month' => 'o lună|:count luni|:count luni', 'm' => 'o lună|:count luni|:count luni', 'week' => 'o săptămână|:count săptămâni|:count săptămâni', 'w' => 'o săptămână|:count săptămâni|:count săptămâni', 'day' => 'o zi|:count zile|:count zile', 'd' => 'o zi|:count zile|:count zile', 'hour' => 'o oră|:count ore|:count ore', 'h' => 'o oră|:count ore|:count ore', 'minute' => 'un minut|:count minute|:count minute', 'min' => 'un minut|:count minute|:count minute', 'second' => 'o secundă|:count secunde|:count secunde', 's' => 'o secundă|:count secunde|:count secunde', 'ago' => 'acum :time', 'from_now' => ':time de acum', 'after' => 'peste :time', 'before' => 'acum :time', ); carbon/src/Carbon/Lang/gl.php 0000644 00000001254 14716424272 0012012 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count ano|:count anos', 'month' => ':count mes|:count meses', 'week' => ':count semana|:count semanas', 'day' => ':count día|:count días', 'hour' => ':count hora|:count horas', 'minute' => ':count minuto|:count minutos', 'second' => ':count segundo|:count segundos', 'ago' => 'fai :time', 'from_now' => 'dentro de :time', 'after' => ':time despois', 'before' => ':time antes', ); carbon/src/Carbon/Lang/kk.php 0000644 00000001504 14716424272 0012013 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count жыл', 'y' => ':count жыл', 'month' => ':count ай', 'm' => ':count ай', 'week' => ':count апта', 'w' => ':count апта', 'day' => ':count күн', 'd' => ':count күн', 'hour' => ':count сағат', 'h' => ':count сағат', 'minute' => ':count минут', 'min' => ':count минут', 'second' => ':count секунд', 's' => ':count секунд', 'ago' => ':time бұрын', 'from_now' => ':time кейін', 'after' => ':time кейін', 'before' => ':time бұрын', ); carbon/src/Carbon/Lang/en.php 0000644 00000002364 14716424272 0012015 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count year|:count years', 'y' => ':countyr|:countyrs', 'month' => ':count month|:count months', 'm' => ':countmo|:countmos', 'week' => ':count week|:count weeks', 'w' => ':countw|:countw', 'day' => ':count day|:count days', 'd' => ':countd|:countd', 'hour' => ':count hour|:count hours', 'h' => ':counth|:counth', 'minute' => ':count minute|:count minutes', 'min' => ':countm|:countm', 'second' => ':count second|:count seconds', 's' => ':counts|:counts', 'ago' => ':time ago', 'from_now' => ':time from now', 'after' => ':time after', 'before' => ':time before', 'diff_now' => 'just now', 'diff_yesterday' => 'yesterday', 'diff_tomorrow' => 'tomorrow', 'diff_before_yesterday' => 'before yesterday', 'diff_after_tomorrow' => 'after tomorrow', 'period_recurrences' => 'once|:count times', 'period_interval' => 'every :interval', 'period_start_date' => 'from :date', 'period_end_date' => 'to :date', ); carbon/src/Carbon/Lang/ru.php 0000644 00000002272 14716424272 0012037 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count год|:count года|:count лет', 'y' => ':count г|:count г|:count л', 'month' => ':count месяц|:count месяца|:count месяцев', 'm' => ':count м|:count м|:count м', 'week' => ':count неделю|:count недели|:count недель', 'w' => ':count н|:count н|:count н', 'day' => ':count день|:count дня|:count дней', 'd' => ':count д|:count д|:count д', 'hour' => ':count час|:count часа|:count часов', 'h' => ':count ч|:count ч|:count ч', 'minute' => ':count минуту|:count минуты|:count минут', 'min' => ':count мин|:count мин|:count мин', 'second' => ':count секунду|:count секунды|:count секунд', 's' => ':count с|:count с|:count с', 'ago' => ':time назад', 'from_now' => 'через :time', 'after' => ':time после', 'before' => ':time до', ); carbon/src/Carbon/Lang/tr.php 0000644 00000001400 14716424272 0012026 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count yıl', 'y' => ':count yıl', 'month' => ':count ay', 'm' => ':count ay', 'week' => ':count hafta', 'w' => ':count hafta', 'day' => ':count gün', 'd' => ':count gün', 'hour' => ':count saat', 'h' => ':count saat', 'minute' => ':count dakika', 'min' => ':count dakika', 'second' => ':count saniye', 's' => ':count saniye', 'ago' => ':time önce', 'from_now' => ':time sonra', 'after' => ':time sonra', 'before' => ':time önce', ); carbon/src/Carbon/Lang/bg.php 0000644 00000002167 14716424272 0012004 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count година|:count години', 'y' => ':count година|:count години', 'month' => ':count месец|:count месеца', 'm' => ':count месец|:count месеца', 'week' => ':count седмица|:count седмици', 'w' => ':count седмица|:count седмици', 'day' => ':count ден|:count дни', 'd' => ':count ден|:count дни', 'hour' => ':count час|:count часа', 'h' => ':count час|:count часа', 'minute' => ':count минута|:count минути', 'min' => ':count минута|:count минути', 'second' => ':count секунда|:count секунди', 's' => ':count секунда|:count секунди', 'ago' => 'преди :time', 'from_now' => ':time от сега', 'after' => 'след :time', 'before' => 'преди :time', ); carbon/src/Carbon/Lang/vi.php 0000644 00000001430 14716424272 0012022 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count năm', 'y' => ':count năm', 'month' => ':count tháng', 'm' => ':count tháng', 'week' => ':count tuần', 'w' => ':count tuần', 'day' => ':count ngày', 'd' => ':count ngày', 'hour' => ':count giờ', 'h' => ':count giờ', 'minute' => ':count phút', 'min' => ':count phút', 'second' => ':count giây', 's' => ':count giây', 'ago' => ':time trước', 'from_now' => ':time từ bây giờ', 'after' => ':time sau', 'before' => ':time trước', ); carbon/src/Carbon/Lang/pl.php 0000644 00000002174 14716424272 0012025 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count rok|:count lata|:count lat', 'y' => ':countr|:countl', 'month' => ':count miesiąc|:count miesiące|:count miesięcy', 'm' => ':countmies', 'week' => ':count tydzień|:count tygodnie|:count tygodni', 'w' => ':counttyg', 'day' => ':count dzień|:count dni|:count dni', 'd' => ':countd', 'hour' => ':count godzina|:count godziny|:count godzin', 'h' => ':countg', 'minute' => ':count minuta|:count minuty|:count minut', 'min' => ':countm', 'second' => ':count sekunda|:count sekundy|:count sekund', 's' => ':counts', 'ago' => ':time temu', 'from_now' => ':time od teraz', 'after' => ':time po', 'before' => ':time przed', 'diff_now' => 'przed chwilą', 'diff_yesterday' => 'wczoraj', 'diff_tomorrow' => 'jutro', 'diff_before_yesterday' => 'przedwczoraj', 'diff_after_tomorrow' => 'pojutrze', ); carbon/src/Carbon/Lang/sr_Cyrl_ME.php 0000644 00000003746 14716424272 0013416 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[ :count година', 'y' => ':count г.', 'month' => '{1} :count мјесец|{2,3,4}:count мјесеца|[5,Inf[ :count мјесеци', 'm' => ':count мј.', 'week' => '{1} :count недјеља|{2,3,4}:count недјеље|[5,Inf[ :count недјеља', 'w' => ':count нед.', 'day' => '{1,21,31} :count дан|[2,Inf[ :count дана', 'd' => ':count д.', 'hour' => '{1,21} :count сат|{2,3,4,22,23,24}:count сата|[5,Inf[ :count сати', 'h' => ':count ч.', 'minute' => '{1,21,31,41,51} :count минут|[2,Inf[ :count минута', 'min' => ':count мин.', 'second' => '{1,21,31,41,51} :count секунд|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count секунде|[5,Inf[:count секунди', 's' => ':count сек.', 'ago' => 'прије :time', 'from_now' => 'за :time', 'after' => ':time након', 'before' => ':time прије', 'year_from_now' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година', 'year_ago' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година', 'week_from_now' => '{1} :count недјељу|{2,3,4} :count недјеље|[5,Inf[ :count недјеља', 'week_ago' => '{1} :count недјељу|{2,3,4} :count недјеље|[5,Inf[ :count недјеља', 'diff_now' => 'управо сада', 'diff_yesterday' => 'јуче', 'diff_tomorrow' => 'сутра', 'diff_before_yesterday' => 'прекјуче', 'diff_after_tomorrow' => 'прекосјутра', ); carbon/src/Carbon/Lang/sk.php 0000644 00000002770 14716424272 0012031 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => 'rok|:count roky|:count rokov', 'y' => 'rok|:count roky|:count rokov', 'month' => 'mesiac|:count mesiace|:count mesiacov', 'm' => 'mesiac|:count mesiace|:count mesiacov', 'week' => 'týždeň|:count týždne|:count týždňov', 'w' => 'týždeň|:count týždne|:count týždňov', 'day' => 'deň|:count dni|:count dní', 'd' => 'deň|:count dni|:count dní', 'hour' => 'hodinu|:count hodiny|:count hodín', 'h' => 'hodinu|:count hodiny|:count hodín', 'minute' => 'minútu|:count minúty|:count minút', 'min' => 'minútu|:count minúty|:count minút', 'second' => 'sekundu|:count sekundy|:count sekúnd', 's' => 'sekundu|:count sekundy|:count sekúnd', 'ago' => 'pred :time', 'from_now' => 'za :time', 'after' => 'o :time neskôr', 'before' => ':time predtým', 'year_ago' => 'rokom|:count rokmi|:count rokmi', 'month_ago' => 'mesiacom|:count mesiacmi|:count mesiacmi', 'week_ago' => 'týždňom|:count týždňami|:count týždňami', 'day_ago' => 'dňom|:count dňami|:count dňami', 'hour_ago' => 'hodinou|:count hodinami|:count hodinami', 'minute_ago' => 'minútou|:count minútami|:count minútami', 'second_ago' => 'sekundou|:count sekundami|:count sekundami', ); carbon/src/Carbon/Lang/ne.php 0000644 00000001647 14716424272 0012020 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count वर्ष', 'y' => ':count वर्ष', 'month' => ':count महिना', 'm' => ':count महिना', 'week' => ':count हप्ता', 'w' => ':count हप्ता', 'day' => ':count दिन', 'd' => ':count दिन', 'hour' => ':count घण्टा', 'h' => ':count घण्टा', 'minute' => ':count मिनेट', 'min' => ':count मिनेट', 'second' => ':count सेकेण्ड', 's' => ':count सेकेण्ड', 'ago' => ':time पहिले', 'from_now' => ':time देखि', 'after' => ':time पछि', 'before' => ':time अघि', ); carbon/src/Carbon/Lang/el.php 0000644 00000002265 14716424272 0012013 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count χρόνος|:count χρόνια', 'y' => ':count χρόνος|:count χρόνια', 'month' => ':count μήνας|:count μήνες', 'm' => ':count μήνας|:count μήνες', 'week' => ':count εβδομάδα|:count εβδομάδες', 'w' => ':count εβδομάδα|:count εβδομάδες', 'day' => ':count μέρα|:count μέρες', 'd' => ':count μέρα|:count μέρες', 'hour' => ':count ώρα|:count ώρες', 'h' => ':count ώρα|:count ώρες', 'minute' => ':count λεπτό|:count λεπτά', 'min' => ':count λεπτό|:count λεπτά', 'second' => ':count δευτερόλεπτο|:count δευτερόλεπτα', 's' => ':count δευτερόλεπτο|:count δευτερόλεπτα', 'ago' => 'πριν από :time', 'from_now' => 'σε :time από τώρα', 'after' => ':time μετά', 'before' => ':time πριν', ); carbon/src/Carbon/Lang/pt_BR.php 0000644 00000002342 14716424272 0012415 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count ano|:count anos', 'y' => ':counta|:counta', 'month' => ':count mês|:count meses', 'm' => ':countm|:countm', 'week' => ':count semana|:count semanas', 'w' => ':countsem|:countsem', 'day' => ':count dia|:count dias', 'd' => ':countd|:countd', 'hour' => ':count hora|:count horas', 'h' => ':counth|:counth', 'minute' => ':count minuto|:count minutos', 'min' => ':countmin|:countmin', 'second' => ':count segundo|:count segundos', 's' => ':counts|:counts', 'ago' => 'há :time', 'from_now' => 'em :time', 'after' => 'após :time', 'before' => ':time atrás', 'diff_now' => 'agora', 'diff_yesterday' => 'ontem', 'diff_tomorrow' => 'amanhã', 'diff_before_yesterday' => 'anteontem', 'diff_after_tomorrow' => 'depois de amanhã', 'period_recurrences' => 'uma|:count vez', 'period_interval' => 'toda :interval', 'period_start_date' => 'de :date', 'period_end_date' => 'até :date', ); carbon/src/Carbon/Lang/ar.php 0000644 00000003433 14716424272 0012013 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => '{0}سنة|{1}سنة|{2}سنتين|[3,10]:count سنوات|[11,Inf]:count سنة', 'y' => '{0}سنة|{1}سنة|{2}سنتين|[3,10]:count سنوات|[11,Inf]:count سنة', 'month' => '{0}شهر|{1} شهر|{2}شهرين|[3,10]:count أشهر|[11,Inf]:count شهر', 'm' => '{0}شهر|{1} شهر|{2}شهرين|[3,10]:count أشهر|[11,Inf]:count شهر', 'week' => '{0}أسبوع|{1}أسبوع|{2}أسبوعين|[3,10]:count أسابيع|[11,Inf]:count أسبوع', 'w' => '{0}أسبوع|{1}أسبوع|{2}أسبوعين|[3,10]:count أسابيع|[11,Inf]:count أسبوع', 'day' => '{0}يوم|{1}يوم|{2}يومين|[3,10]:count أيام|[11,Inf] يوم', 'd' => '{0}يوم|{1}يوم|{2}يومين|[3,10]:count أيام|[11,Inf] يوم', 'hour' => '{0}ساعة|{1}ساعة|{2}ساعتين|[3,10]:count ساعات|[11,Inf]:count ساعة', 'h' => '{0}ساعة|{1}ساعة|{2}ساعتين|[3,10]:count ساعات|[11,Inf]:count ساعة', 'minute' => '{0}دقيقة|{1}دقيقة|{2}دقيقتين|[3,10]:count دقائق|[11,Inf]:count دقيقة', 'min' => '{0}دقيقة|{1}دقيقة|{2}دقيقتين|[3,10]:count دقائق|[11,Inf]:count دقيقة', 'second' => '{0}ثانية|{1}ثانية|{2}ثانيتين|[3,10]:count ثوان|[11,Inf]:count ثانية', 's' => '{0}ثانية|{1}ثانية|{2}ثانيتين|[3,10]:count ثوان|[11,Inf]:count ثانية', 'ago' => 'منذ :time', 'from_now' => ':time من الآن', 'after' => 'بعد :time', 'before' => 'قبل :time', ); carbon/src/Carbon/Lang/cs.php 0000644 00000002222 14716424272 0012011 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count rok|:count roky|:count let', 'y' => ':count rok|:count roky|:count let', 'month' => ':count měsíc|:count měsíce|:count měsíců', 'm' => ':count měsíc|:count měsíce|:count měsíců', 'week' => ':count týden|:count týdny|:count týdnů', 'w' => ':count týden|:count týdny|:count týdnů', 'day' => ':count den|:count dny|:count dní', 'd' => ':count den|:count dny|:count dní', 'hour' => ':count hodinu|:count hodiny|:count hodin', 'h' => ':count hodinu|:count hodiny|:count hodin', 'minute' => ':count minutu|:count minuty|:count minut', 'min' => ':count minutu|:count minuty|:count minut', 'second' => ':count sekundu|:count sekundy|:count sekund', 's' => ':count sekundu|:count sekundy|:count sekund', 'ago' => ':time nazpět', 'from_now' => 'za :time', 'after' => ':time později', 'before' => ':time předtím', ); carbon/src/Carbon/Lang/ur.php 0000644 00000001142 14716424272 0012032 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count سال', 'month' => ':count ماه', 'week' => ':count ہفتے', 'day' => ':count روز', 'hour' => ':count گھنٹے', 'minute' => ':count منٹ', 'second' => ':count سیکنڈ', 'ago' => ':time پہلے', 'from_now' => ':time بعد', 'after' => ':time بعد', 'before' => ':time پہلے', ); carbon/src/Carbon/Lang/ka.php 0000644 00000001666 14716424272 0012012 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count წლის', 'y' => ':count წლის', 'month' => ':count თვის', 'm' => ':count თვის', 'week' => ':count კვირის', 'w' => ':count კვირის', 'day' => ':count დღის', 'd' => ':count დღის', 'hour' => ':count საათის', 'h' => ':count საათის', 'minute' => ':count წუთის', 'min' => ':count წუთის', 'second' => ':count წამის', 's' => ':count წამის', 'ago' => ':time უკან', 'from_now' => ':time შემდეგ', 'after' => ':time შემდეგ', 'before' => ':time უკან', ); carbon/src/Carbon/Lang/gu.php 0000644 00000002262 14716424272 0012023 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array( 'year' => ':count વર્ષ|:count વર્ષો', 'y' => ':countવર્ષ|:countવર્ષો', 'month' => ':count મહિનો|:count મહિના', 'm' => ':countમહિનો|:countમહિના', 'week' => ':count અઠવાડિયું|:count અઠવાડિયા', 'w' => ':countઅઠ.|:countઅઠ.', 'day' => ':count દિવસ|:count દિવસો', 'd' => ':countદિ.|:countદિ.', 'hour' => ':count કલાક|:count કલાકો', 'h' => ':countક.|:countક.', 'minute' => ':count મિનિટ|:count મિનિટ', 'min' => ':countમિ.|:countમિ.', 'second' => ':count સેકેન્ડ|:count સેકેન્ડ', 's' => ':countસે.|:countસે.', 'ago' => ':time પહેલા', 'from_now' => ':time અત્યારથી', 'after' => ':time પછી', 'before' => ':time પહેલા', ); carbon/src/Carbon/CarbonPeriod.php 0000644 00000114633 14716424272 0013104 0 ustar 00 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use BadMethodCallException; use Closure; use Countable; use DateInterval; use DateTime; use DateTimeInterface; use InvalidArgumentException; use Iterator; use ReflectionClass; use ReflectionFunction; use ReflectionMethod; use RuntimeException; /** * Substitution of DatePeriod with some modifications and many more features. * Fully compatible with PHP 5.3+! * * @method static CarbonPeriod start($date, $inclusive = null) Create instance specifying start date. * @method static CarbonPeriod since($date, $inclusive = null) Alias for start(). * @method static CarbonPeriod sinceNow($inclusive = null) Create instance with start date set to now. * @method static CarbonPeriod end($date = null, $inclusive = null) Create instance specifying end date. * @method static CarbonPeriod until($date = null, $inclusive = null) Alias for end(). * @method static CarbonPeriod untilNow($inclusive = null) Create instance with end date set to now. * @method static CarbonPeriod dates($start, $end = null) Create instance with start and end date. * @method static CarbonPeriod between($start, $end = null) Create instance with start and end date. * @method static CarbonPeriod recurrences($recurrences = null) Create instance with maximum number of recurrences. * @method static CarbonPeriod times($recurrences = null) Alias for recurrences(). * @method static CarbonPeriod options($options = null) Create instance with options. * @method static CarbonPeriod toggle($options, $state = null) Create instance with options toggled on or off. * @method static CarbonPeriod filter($callback, $name = null) Create instance with filter added to the stack. * @method static CarbonPeriod push($callback, $name = null) Alias for filter(). * @method static CarbonPeriod prepend($callback, $name = null) Create instance with filter prepened to the stack. * @method static CarbonPeriod filters(array $filters) Create instance with filters stack. * @method static CarbonPeriod interval($interval) Create instance with given date interval. * @method static CarbonPeriod each($interval) Create instance with given date interval. * @method static CarbonPeriod every($interval) Create instance with given date interval. * @method static CarbonPeriod step($interval) Create instance with given date interval. * @method static CarbonPeriod stepBy($interval) Create instance with given date interval. * @method static CarbonPeriod invert() Create instance with inverted date interval. * @method static CarbonPeriod years($years = 1) Create instance specifying a number of years for date interval. * @method static CarbonPeriod year($years = 1) Alias for years(). * @method static CarbonPeriod months($months = 1) Create instance specifying a number of months for date interval. * @method static CarbonPeriod month($months = 1) Alias for months(). * @method static CarbonPeriod weeks($weeks = 1) Create instance specifying a number of weeks for date interval. * @method static CarbonPeriod week($weeks = 1) Alias for weeks(). * @method static CarbonPeriod days($days = 1) Create instance specifying a number of days for date interval. * @method static CarbonPeriod dayz($days = 1) Alias for days(). * @method static CarbonPeriod day($days = 1) Alias for days(). * @method static CarbonPeriod hours($hours = 1) Create instance specifying a number of hours for date interval. * @method static CarbonPeriod hour($hours = 1) Alias for hours(). * @method static CarbonPeriod minutes($minutes = 1) Create instance specifying a number of minutes for date interval. * @method static CarbonPeriod minute($minutes = 1) Alias for minutes(). * @method static CarbonPeriod seconds($seconds = 1) Create instance specifying a number of seconds for date interval. * @method static CarbonPeriod second($seconds = 1) Alias for seconds(). * @method CarbonPeriod start($date, $inclusive = null) Change the period start date. * @method CarbonPeriod since($date, $inclusive = null) Alias for start(). * @method CarbonPeriod sinceNow($inclusive = null) Change the period start date to now. * @method CarbonPeriod end($date = null, $inclusive = null) Change the period end date. * @method CarbonPeriod until($date = null, $inclusive = null) Alias for end(). * @method CarbonPeriod untilNow($inclusive = null) Change the period end date to now. * @method CarbonPeriod dates($start, $end = null) Change the period start and end date. * @method CarbonPeriod recurrences($recurrences = null) Change the maximum number of recurrences. * @method CarbonPeriod times($recurrences = null) Alias for recurrences(). * @method CarbonPeriod options($options = null) Change the period options. * @method CarbonPeriod toggle($options, $state = null) Toggle given options on or off. * @method CarbonPeriod filter($callback, $name = null) Add a filter to the stack. * @method CarbonPeriod push($callback, $name = null) Alias for filter(). * @method CarbonPeriod prepend($callback, $name = null) Prepend a filter to the stack. * @method CarbonPeriod filters(array $filters = array()) Set filters stack. * @method CarbonPeriod interval($interval) Change the period date interval. * @method CarbonPeriod invert() Invert the period date interval. * @method CarbonPeriod years($years = 1) Set the years portion of the date interval. * @method CarbonPeriod year($years = 1) Alias for years(). * @method CarbonPeriod months($months = 1) Set the months portion of the date interval. * @method CarbonPeriod month($months = 1) Alias for months(). * @method CarbonPeriod weeks($weeks = 1) Set the weeks portion of the date interval. * @method CarbonPeriod week($weeks = 1) Alias for weeks(). * @method CarbonPeriod days($days = 1) Set the days portion of the date interval. * @method CarbonPeriod dayz($days = 1) Alias for days(). * @method CarbonPeriod day($days = 1) Alias for days(). * @method CarbonPeriod hours($hours = 1) Set the hours portion of the date interval. * @method CarbonPeriod hour($hours = 1) Alias for hours(). * @method CarbonPeriod minutes($minutes = 1) Set the minutes portion of the date interval. * @method CarbonPeriod minute($minutes = 1) Alias for minutes(). * @method CarbonPeriod seconds($seconds = 1) Set the seconds portion of the date interval. * @method CarbonPeriod second($seconds = 1) Alias for seconds(). */ class CarbonPeriod implements Iterator, Countable { /** * Built-in filters. * * @var string */ const RECURRENCES_FILTER = 'Carbon\CarbonPeriod::filterRecurrences'; const END_DATE_FILTER = 'Carbon\CarbonPeriod::filterEndDate'; /** * Special value which can be returned by filters to end iteration. Also a filter. * * @var string */ const END_ITERATION = 'Carbon\CarbonPeriod::endIteration'; /** * Available options. * * @var int */ const EXCLUDE_START_DATE = 1; const EXCLUDE_END_DATE = 2; /** * Number of maximum attempts before giving up on finding next valid date. * * @var int */ const NEXT_MAX_ATTEMPTS = 1000; /** * The registered macros. * * @var array */ protected static $macros = array(); /** * Underlying date interval instance. Always present, one day by default. * * @var CarbonInterval */ protected $dateInterval; /** * Whether current date interval was set by default. * * @var bool */ protected $isDefaultInterval; /** * The filters stack. * * @var array */ protected $filters = array(); /** * Period start date. Applied on rewind. Always present, now by default. * * @var Carbon */ protected $startDate; /** * Period end date. For inverted interval should be before the start date. Applied via a filter. * * @var Carbon|null */ protected $endDate; /** * Limit for number of recurrences. Applied via a filter. * * @var int|null */ protected $recurrences; /** * Iteration options. * * @var int */ protected $options; /** * Index of current date. Always sequential, even if some dates are skipped by filters. * Equal to null only before the first iteration. * * @var int */ protected $key; /** * Current date. May temporarily hold unaccepted value when looking for a next valid date. * Equal to null only before the first iteration. * * @var Carbon */ protected $current; /** * Timezone of current date. Taken from the start date. * * @var \DateTimeZone|null */ protected $timezone; /** * The cached validation result for current date. * * @var bool|string|null */ protected $validationResult; /** * Create a new instance. * * @return static */ public static function create() { return static::createFromArray(func_get_args()); } /** * Create a new instance from an array of parameters. * * @param array $params * * @return static */ public static function createFromArray(array $params) { // PHP 5.3 equivalent of new static(...$params). $reflection = new ReflectionClass(get_class()); /** @var static $instance */ $instance = $reflection->newInstanceArgs($params); return $instance; } /** * Create CarbonPeriod from ISO 8601 string. * * @param string $iso * @param int|null $options * * @return static */ public static function createFromIso($iso, $options = null) { $params = static::parseIso8601($iso); $instance = static::createFromArray($params); if ($options !== null) { $instance->setOptions($options); } return $instance; } /** * Return whether given interval contains non zero value of any time unit. * * @param \DateInterval $interval * * @return bool */ protected static function intervalHasTime(DateInterval $interval) { // The array_key_exists and get_object_vars are used as a workaround to check microsecond support. // Both isset and property_exists will fail on PHP 7.0.14 - 7.0.21 due to the following bug: // https://bugs.php.net/bug.php?id=74852 return $interval->h || $interval->i || $interval->s || array_key_exists('f', get_object_vars($interval)) && $interval->f; } /** * Return whether given callable is a string pointing to one of Carbon's is* methods * and should be automatically converted to a filter callback. * * @param callable $callable * * @return bool */ protected static function isCarbonPredicateMethod($callable) { return is_string($callable) && substr($callable, 0, 2) === 'is' && (method_exists('Carbon\Carbon', $callable) || Carbon::hasMacro($callable)); } /** * Return whether given variable is an ISO 8601 specification. * * Note: Check is very basic, as actual validation will be done later when parsing. * We just want to ensure that variable is not any other type of a valid parameter. * * @param mixed $var * * @return bool */ protected static function isIso8601($var) { if (!is_string($var)) { return false; } // Match slash but not within a timezone name. $part = '[a-z]+(?:[_-][a-z]+)*'; preg_match("#\b$part/$part\b|(/)#i", $var, $match); return isset($match[1]); } /** * Parse given ISO 8601 string into an array of arguments. * * @param string $iso * * @return array */ protected static function parseIso8601($iso) { $result = array(); $interval = null; $start = null; $end = null; foreach (explode('/', $iso) as $key => $part) { if ($key === 0 && preg_match('/^R([0-9]*)$/', $part, $match)) { $parsed = strlen($match[1]) ? (int) $match[1] : null; } elseif ($interval === null && $parsed = CarbonInterval::make($part)) { $interval = $part; } elseif ($start === null && $parsed = Carbon::make($part)) { $start = $part; } elseif ($end === null && $parsed = Carbon::make(static::addMissingParts($start, $part))) { $end = $part; } else { throw new InvalidArgumentException("Invalid ISO 8601 specification: $iso."); } $result[] = $parsed; } return $result; } /** * Add missing parts of the target date from the soure date. * * @param string $source * @param string $target * * @return string */ protected static function addMissingParts($source, $target) { $pattern = '/'.preg_replace('/[0-9]+/', '[0-9]+', preg_quote($target, '/')).'$/'; $result = preg_replace($pattern, $target, $source, 1, $count); return $count ? $result : $target; } /** * Register a custom macro. * * @param string $name * @param object|callable $macro * * @return void */ public static function macro($name, $macro) { static::$macros[$name] = $macro; } /** * Remove all macros. */ public static function resetMacros() { static::$macros = array(); } /** * Register macros from a mixin object. * * @param object $mixin * * @throws \ReflectionException * * @return void */ public static function mixin($mixin) { $reflection = new ReflectionClass($mixin); $methods = $reflection->getMethods( ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED ); foreach ($methods as $method) { $method->setAccessible(true); static::macro($method->name, $method->invoke($mixin)); } } /** * Check if macro is registered. * * @param string $name * * @return bool */ public static function hasMacro($name) { return isset(static::$macros[$name]); } /** * Provide static proxy for instance aliases. * * @param string $method * @param array $parameters * * @return mixed */ public static function __callStatic($method, $parameters) { return call_user_func_array( array(new static, $method), $parameters ); } /** * CarbonPeriod constructor. * * @throws InvalidArgumentException */ public function __construct() { // Parse and assign arguments one by one. First argument may be an ISO 8601 spec, // which will be first parsed into parts and then processed the same way. $arguments = func_get_args(); if (count($arguments) && static::isIso8601($iso = $arguments[0])) { array_splice($arguments, 0, 1, static::parseIso8601($iso)); } foreach ($arguments as $argument) { if ($this->dateInterval === null && $parsed = CarbonInterval::make($argument)) { $this->setDateInterval($parsed); } elseif ($this->startDate === null && $parsed = Carbon::make($argument)) { $this->setStartDate($parsed); } elseif ($this->endDate === null && $parsed = Carbon::make($argument)) { $this->setEndDate($parsed); } elseif ($this->recurrences === null && $this->endDate === null && is_numeric($argument)) { $this->setRecurrences($argument); } elseif ($this->options === null && (is_int($argument) || $argument === null)) { $this->setOptions($argument); } else { throw new InvalidArgumentException('Invalid constructor parameters.'); } } if ($this->startDate === null) { $this->setStartDate(Carbon::now()); } if ($this->dateInterval === null) { $this->setDateInterval(CarbonInterval::day()); $this->isDefaultInterval = true; } if ($this->options === null) { $this->setOptions(0); } } /** * Change the period date interval. * * @param DateInterval|string $interval * * @throws \InvalidArgumentException * * @return $this */ public function setDateInterval($interval) { if (!$interval = CarbonInterval::make($interval)) { throw new InvalidArgumentException('Invalid interval.'); } if ($interval->spec() === 'PT0S') { throw new InvalidArgumentException('Empty interval is not accepted.'); } $this->dateInterval = $interval; $this->isDefaultInterval = false; $this->handleChangedParameters(); return $this; } /** * Invert the period date interval. * * @return $this */ public function invertDateInterval() { $interval = $this->dateInterval->invert(); return $this->setDateInterval($interval); } /** * Set start and end date. * * @param DateTime|DateTimeInterface|string $start * @param DateTime|DateTimeInterface|string|null $end * * @return $this */ public function setDates($start, $end) { $this->setStartDate($start); $this->setEndDate($end); return $this; } /** * Change the period options. * * @param int|null $options * * @throws \InvalidArgumentException * * @return $this */ public function setOptions($options) { if (!is_int($options) && !is_null($options)) { throw new InvalidArgumentException('Invalid options.'); } $this->options = $options ?: 0; $this->handleChangedParameters(); return $this; } /** * Get the period options. * * @return int */ public function getOptions() { return $this->options; } /** * Toggle given options on or off. * * @param int $options * @param bool|null $state * * @throws \InvalidArgumentException * * @return $this */ public function toggleOptions($options, $state = null) { if ($state === null) { $state = ($this->options & $options) !== $options; } return $this->setOptions($state ? $this->options | $options : $this->options & ~$options ); } /** * Toggle EXCLUDE_START_DATE option. * * @param bool $state * * @return $this */ public function excludeStartDate($state = true) { return $this->toggleOptions(static::EXCLUDE_START_DATE, $state); } /** * Toggle EXCLUDE_END_DATE option. * * @param bool $state * * @return $this */ public function excludeEndDate($state = true) { return $this->toggleOptions(static::EXCLUDE_END_DATE, $state); } /** * Get the underlying date interval. * * @return CarbonInterval */ public function getDateInterval() { return $this->dateInterval->copy(); } /** * Get start date of the period. * * @return Carbon */ public function getStartDate() { return $this->startDate->copy(); } /** * Get end date of the period. * * @return Carbon|null */ public function getEndDate() { if ($this->endDate) { return $this->endDate->copy(); } } /** * Get number of recurrences. * * @return int|null */ public function getRecurrences() { return $this->recurrences; } /** * Returns true if the start date should be excluded. * * @return bool */ public function isStartExcluded() { return ($this->options & static::EXCLUDE_START_DATE) !== 0; } /** * Returns true if the end date should be excluded. * * @return bool */ public function isEndExcluded() { return ($this->options & static::EXCLUDE_END_DATE) !== 0; } /** * Add a filter to the stack. * * @param callable $callback * @param string $name * * @return $this */ public function addFilter($callback, $name = null) { $tuple = $this->createFilterTuple(func_get_args()); $this->filters[] = $tuple; $this->handleChangedParameters(); return $this; } /** * Prepend a filter to the stack. * * @param callable $callback * @param string $name * * @return $this */ public function prependFilter($callback, $name = null) { $tuple = $this->createFilterTuple(func_get_args()); array_unshift($this->filters, $tuple); $this->handleChangedParameters(); return $this; } /** * Create a filter tuple from raw parameters. * * Will create an automatic filter callback for one of Carbon's is* methods. * * @param array $parameters * * @return array */ protected function createFilterTuple(array $parameters) { $method = array_shift($parameters); if (!$this->isCarbonPredicateMethod($method)) { return array($method, array_shift($parameters)); } return array(function ($date) use ($method, $parameters) { return call_user_func_array(array($date, $method), $parameters); }, $method); } /** * Remove a filter by instance or name. * * @param callable|string $filter * * @return $this */ public function removeFilter($filter) { $key = is_callable($filter) ? 0 : 1; $this->filters = array_values(array_filter( $this->filters, function ($tuple) use ($key, $filter) { return $tuple[$key] !== $filter; } )); $this->updateInternalState(); $this->handleChangedParameters(); return $this; } /** * Return whether given instance or name is in the filter stack. * * @param callable|string $filter * * @return bool */ public function hasFilter($filter) { $key = is_callable($filter) ? 0 : 1; foreach ($this->filters as $tuple) { if ($tuple[$key] === $filter) { return true; } } return false; } /** * Get filters stack. * * @return array */ public function getFilters() { return $this->filters; } /** * Set filters stack. * * @param array $filters * * @return $this */ public function setFilters(array $filters) { $this->filters = $filters; $this->updateInternalState(); $this->handleChangedParameters(); return $this; } /** * Reset filters stack. * * @return $this */ public function resetFilters() { $this->filters = array(); if ($this->endDate !== null) { $this->filters[] = array(static::END_DATE_FILTER, null); } if ($this->recurrences !== null) { $this->filters[] = array(static::RECURRENCES_FILTER, null); } $this->handleChangedParameters(); return $this; } /** * Update properties after removing built-in filters. * * @return void */ protected function updateInternalState() { if (!$this->hasFilter(static::END_DATE_FILTER)) { $this->endDate = null; } if (!$this->hasFilter(static::RECURRENCES_FILTER)) { $this->recurrences = null; } } /** * Add a recurrences filter (set maximum number of recurrences). * * @param int|null $recurrences * * @throws \InvalidArgumentException * * @return $this */ public function setRecurrences($recurrences) { if (!is_numeric($recurrences) && !is_null($recurrences) || $recurrences < 0) { throw new InvalidArgumentException('Invalid number of recurrences.'); } if ($recurrences === null) { return $this->removeFilter(static::RECURRENCES_FILTER); } $this->recurrences = (int) $recurrences; if (!$this->hasFilter(static::RECURRENCES_FILTER)) { return $this->addFilter(static::RECURRENCES_FILTER); } $this->handleChangedParameters(); return $this; } /** * Recurrences filter callback (limits number of recurrences). * * @param \Carbon\Carbon $current * @param int $key * * @return bool|string */ protected function filterRecurrences($current, $key) { if ($key < $this->recurrences) { return true; } return static::END_ITERATION; } /** * Change the period start date. * * @param DateTime|DateTimeInterface|string $date * @param bool|null $inclusive * * @throws \InvalidArgumentException * * @return $this */ public function setStartDate($date, $inclusive = null) { if (!$date = Carbon::make($date)) { throw new InvalidArgumentException('Invalid start date.'); } $this->startDate = $date; if ($inclusive !== null) { $this->toggleOptions(static::EXCLUDE_START_DATE, !$inclusive); } return $this; } /** * Change the period end date. * * @param DateTime|DateTimeInterface|string|null $date * @param bool|null $inclusive * * @throws \InvalidArgumentException * * @return $this */ public function setEndDate($date, $inclusive = null) { if (!is_null($date) && !$date = Carbon::make($date)) { throw new InvalidArgumentException('Invalid end date.'); } if (!$date) { return $this->removeFilter(static::END_DATE_FILTER); } $this->endDate = $date; if ($inclusive !== null) { $this->toggleOptions(static::EXCLUDE_END_DATE, !$inclusive); } if (!$this->hasFilter(static::END_DATE_FILTER)) { return $this->addFilter(static::END_DATE_FILTER); } $this->handleChangedParameters(); return $this; } /** * End date filter callback. * * @param \Carbon\Carbon $current * * @return bool|string */ protected function filterEndDate($current) { if (!$this->isEndExcluded() && $current == $this->endDate) { return true; } if ($this->dateInterval->invert ? $current > $this->endDate : $current < $this->endDate) { return true; } return static::END_ITERATION; } /** * End iteration filter callback. * * @return string */ protected function endIteration() { return static::END_ITERATION; } /** * Handle change of the parameters. */ protected function handleChangedParameters() { $this->validationResult = null; } /** * Validate current date and stop iteration when necessary. * * Returns true when current date is valid, false if it is not, or static::END_ITERATION * when iteration should be stopped. * * @return bool|string */ protected function validateCurrentDate() { if ($this->current === null) { $this->rewind(); } // Check after the first rewind to avoid repeating the initial validation. if ($this->validationResult !== null) { return $this->validationResult; } return $this->validationResult = $this->checkFilters(); } /** * Check whether current value and key pass all the filters. * * @return bool|string */ protected function checkFilters() { $current = $this->prepareForReturn($this->current); foreach ($this->filters as $tuple) { $result = call_user_func( $tuple[0], $current->copy(), $this->key, $this ); if ($result === static::END_ITERATION) { return static::END_ITERATION; } if (!$result) { return false; } } return true; } /** * Prepare given date to be returned to the external logic. * * @param Carbon $date * * @return Carbon */ protected function prepareForReturn(Carbon $date) { $date = $date->copy(); if ($this->timezone) { $date->setTimezone($this->timezone); } return $date; } /** * Check if the current position is valid. * * @return bool */ public function valid() { return $this->validateCurrentDate() === true; } /** * Return the current key. * * @return int|null */ public function key() { if ($this->valid()) { return $this->key; } } /** * Return the current date. * * @return Carbon|null */ public function current() { if ($this->valid()) { return $this->prepareForReturn($this->current); } } /** * Move forward to the next date. * * @throws \RuntimeException * * @return void */ public function next() { if ($this->current === null) { $this->rewind(); } if ($this->validationResult !== static::END_ITERATION) { $this->key++; $this->incrementCurrentDateUntilValid(); } } /** * Rewind to the start date. * * Iterating over a date in the UTC timezone avoids bug during backward DST change. * * @see https://bugs.php.net/bug.php?id=72255 * @see https://bugs.php.net/bug.php?id=74274 * @see https://wiki.php.net/rfc/datetime_and_daylight_saving_time * * @throws \RuntimeException * * @return void */ public function rewind() { $this->key = 0; $this->current = $this->startDate->copy(); $this->timezone = static::intervalHasTime($this->dateInterval) ? $this->current->getTimezone() : null; if ($this->timezone) { $this->current->setTimezone('UTC'); } $this->validationResult = null; if ($this->isStartExcluded() || $this->validateCurrentDate() === false) { $this->incrementCurrentDateUntilValid(); } } /** * Skip iterations and returns iteration state (false if ended, true if still valid). * * @param int $count steps number to skip (1 by default) * * @return bool */ public function skip($count = 1) { for ($i = $count; $this->valid() && $i > 0; $i--) { $this->next(); } return $this->valid(); } /** * Keep incrementing the current date until a valid date is found or the iteration is ended. * * @throws \RuntimeException * * @return void */ protected function incrementCurrentDateUntilValid() { $attempts = 0; do { $this->current->add($this->dateInterval); $this->validationResult = null; if (++$attempts > static::NEXT_MAX_ATTEMPTS) { throw new RuntimeException('Could not find next valid date.'); } } while ($this->validateCurrentDate() === false); } /** * Format the date period as ISO 8601. * * @return string */ public function toIso8601String() { $parts = array(); if ($this->recurrences !== null) { $parts[] = 'R'.$this->recurrences; } $parts[] = $this->startDate->toIso8601String(); $parts[] = $this->dateInterval->spec(); if ($this->endDate !== null) { $parts[] = $this->endDate->toIso8601String(); } return implode('/', $parts); } /** * Convert the date period into a string. * * @return string */ public function toString() { $translator = Carbon::getTranslator(); $parts = array(); $format = !$this->startDate->isStartOfDay() || $this->endDate && !$this->endDate->isStartOfDay() ? 'Y-m-d H:i:s' : 'Y-m-d'; if ($this->recurrences !== null) { $parts[] = $translator->transChoice('period_recurrences', $this->recurrences, array(':count' => $this->recurrences)); } $parts[] = $translator->trans('period_interval', array(':interval' => $this->dateInterval->forHumans())); $parts[] = $translator->trans('period_start_date', array(':date' => $this->startDate->format($format))); if ($this->endDate !== null) { $parts[] = $translator->trans('period_end_date', array(':date' => $this->endDate->format($format))); } $result = implode(' ', $parts); return mb_strtoupper(mb_substr($result, 0, 1)).mb_substr($result, 1); } /** * Format the date period as ISO 8601. * * @return string */ public function spec() { return $this->toIso8601String(); } /** * Convert the date period into an array without changing current iteration state. * * @return array */ public function toArray() { $state = array( $this->key, $this->current ? $this->current->copy() : null, $this->validationResult, ); $result = iterator_to_array($this); list( $this->key, $this->current, $this->validationResult ) = $state; return $result; } /** * Count dates in the date period. * * @return int */ public function count() { return count($this->toArray()); } /** * Return the first date in the date period. * * @return Carbon|null */ public function first() { if ($array = $this->toArray()) { return $array[0]; } } /** * Return the last date in the date period. * * @return Carbon|null */ public function last() { if ($array = $this->toArray()) { return $array[count($array) - 1]; } } /** * Call given macro. * * @param string $name * @param array $parameters * * @return mixed */ protected function callMacro($name, $parameters) { $macro = static::$macros[$name]; $reflection = new ReflectionFunction($macro); $reflectionParameters = $reflection->getParameters(); $expectedCount = count($reflectionParameters); $actualCount = count($parameters); if ($expectedCount > $actualCount && $reflectionParameters[$expectedCount - 1]->name === 'self') { for ($i = $actualCount; $i < $expectedCount - 1; $i++) { $parameters[] = $reflectionParameters[$i]->getDefaultValue(); } $parameters[] = $this; } if ($macro instanceof Closure && method_exists($macro, 'bindTo')) { $macro = $macro->bindTo($this, get_class($this)); } return call_user_func_array($macro, $parameters); } /** * Convert the date period into a string. * * @return string */ public function __toString() { return $this->toString(); } /** * Add aliases for setters. * * CarbonPeriod::days(3)->hours(5)->invert() * ->sinceNow()->until('2010-01-10') * ->filter(...) * ->count() * * Note: We use magic method to let static and instance aliases with the same names. * * @param string $method * @param array $parameters * * @return mixed */ public function __call($method, $parameters) { if (static::hasMacro($method)) { return $this->callMacro($method, $parameters); } $first = count($parameters) >= 1 ? $parameters[0] : null; $second = count($parameters) >= 2 ? $parameters[1] : null; switch ($method) { case 'start': case 'since': return $this->setStartDate($first, $second); case 'sinceNow': return $this->setStartDate(new Carbon, $first); case 'end': case 'until': return $this->setEndDate($first, $second); case 'untilNow': return $this->setEndDate(new Carbon, $first); case 'dates': case 'between': return $this->setDates($first, $second); case 'recurrences': case 'times': return $this->setRecurrences($first); case 'options': return $this->setOptions($first); case 'toggle': return $this->toggleOptions($first, $second); case 'filter': case 'push': return $this->addFilter($first, $second); case 'prepend': return $this->prependFilter($first, $second); case 'filters': return $this->setFilters($first ?: array()); case 'interval': case 'each': case 'every': case 'step': case 'stepBy': return $this->setDateInterval($first); case 'invert': return $this->invertDateInterval(); case 'years': case 'year': case 'months': case 'month': case 'weeks': case 'week': case 'days': case 'dayz': case 'day': case 'hours': case 'hour': case 'minutes': case 'minute': case 'seconds': case 'second': return $this->setDateInterval(call_user_func( // Override default P1D when instantiating via fluent setters. array($this->isDefaultInterval ? new CarbonInterval('PT0S') : $this->dateInterval, $method), count($parameters) === 0 ? 1 : $first )); } throw new BadMethodCallException("Method $method does not exist."); } } carbon/src/JsonSerializable.php 0000644 00000000776 14716424272 0012573 0 ustar 00 json_encode, * which is a value of any type other than a resource. * * @since 5.4.0 */ public function jsonSerialize(); } } carbon/bin/upgrade-carbon 0000644 00000001154 14716424272 0011406 0 ustar 00 #!/usr/bin/env php