Pionia Core

Deprecated

Table of Contents

vendor/nesbot/carbon/lazy/Carbon/ProtectedDatePeriod.php
vendor/nesbot/carbon/src/Carbon/CarbonInterface.php
vendor/nesbot/carbon/src/Carbon/Traits/Date.php
vendor/nesbot/carbon/src/Carbon/Traits/DeprecatedPeriodProperties.php
vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php
vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php
vendor/nesbot/carbon/src/Carbon/Traits/StaticLocalization.php
vendor/nesbot/carbon/src/Carbon/Traits/StaticOptions.php
vendor/nesbot/carbon/src/Carbon/Traits/ToStringFormat.php
vendor/nesbot/carbon/src/Carbon/Traits/Units.php

ProtectedDatePeriod.php

Line Element Reason
26 DatePeriodBase::$start

PHP 8.2 this property is no longer in sync with the actual period start.

35 DatePeriodBase::$end

PHP 8.2 this property is no longer in sync with the actual period end.

44 DatePeriodBase::$current

PHP 8.2 this property is no longer in sync with the actual period current iterated date.

53 DatePeriodBase::$interval

PHP 8.2 this property is no longer in sync with the actual period interval.

62 DatePeriodBase::$recurrences

PHP 8.2 this property is no longer in sync with the actual period recurrences.

71 DatePeriodBase::$include_start_date

PHP 8.2 this property is no longer in sync with the actual period start included option.

CarbonInterface.php

Line Element Reason
1103 CarbonInterface::addRealUnit()

Prefer to use add addUTCUnit() which more accurately defines what it's doing.

Add seconds to the instance using timestamp. Positive $value travels forward while negative $value travels into the past.

1816 CarbonInterface::disableHumanDiffOption()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.

1823 CarbonInterface::enableHumanDiffOption()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.

3694 CarbonInterface::resetMonthsOverflow()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).

3714 CarbonInterface::resetYearsOverflow()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).

3758 CarbonInterface::serializeUsing()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather transform Carbon object before the serialization.

JSON serialize all Carbon instances using the given callback.

3816 CarbonInterface::setHumanDiffOptions()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.

3852 CarbonInterface::setMidDayAt()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather consider mid-day is always 12pm, then if you need to test if it's an other hour, test it explicitly: $date->format('G') == 13 or to set explicitly to a given hour: $date->setTime(13, 0, 0, 0)

Set midday/noon hour

3940 CarbonInterface::setToStringFormat()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and use other method or custom format passed to format() method if you need to dump another string format.

Set the default format used when type juggling a Carbon instance to a string.

3991 CarbonInterface::setWeekendDays()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather consider week-end is always saturday and sunday, and if you have some custom week-end days to handle, give to those days an other name and create a macro for them:

        ```
        Carbon::macro('isDayOff', function ($date) {
            return $date->isSunday() || $date->isMonday();
        });
        Carbon::macro('isNotDayOff', function ($date) {
            return !$date->isDayOff();
        });
        if ($someDate->isDayOff()) ...
        if ($someDate->isNotDayOff()) ...
        // Add 5 not-off days
        $count = 5;
        while ($someDate->isDayOff() || ($count-- > 0)) {
            $someDate->addDay();
        }
        ```

Set weekend days

4229 CarbonInterface::subRealUnit()

Prefer to use add subUTCUnit() which more accurately defines what it's doing.

Subtract seconds to the instance using timestamp. Positive $value travels into the past while negative $value travels forward.

4822 CarbonInterface::useMonthsOverflow()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).

4833 CarbonInterface::useStrictMode()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.

4848 CarbonInterface::useYearsOverflow()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).

Date.php

Line Element Reason
1974 Date::setWeekendDays()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather consider week-end is always saturday and sunday, and if you have some custom week-end days to handle, give to those days an other name and create a macro for them:

        ```
        Carbon::macro('isDayOff', function ($date) {
            return $date->isSunday() || $date->isMonday();
        });
        Carbon::macro('isNotDayOff', function ($date) {
            return !$date->isDayOff();
        });
        if ($someDate->isDayOff()) ...
        if ($someDate->isNotDayOff()) ...
        // Add 5 not-off days
        $count = 5;
        while ($someDate->isDayOff() || ($count-- > 0)) {
            $someDate->addDay();
        }
        ```

Set weekend days

DeprecatedPeriodProperties.php

Line Element Reason
28 DeprecatedPeriodProperties::$start

PHP 8.2 this property is no longer in sync with the actual period start.

37 DeprecatedPeriodProperties::$end

PHP 8.2 this property is no longer in sync with the actual period end.

46 DeprecatedPeriodProperties::$current

PHP 8.2 this property is no longer in sync with the actual period current iterated date.

55 DeprecatedPeriodProperties::$interval

PHP 8.2 this property is no longer in sync with the actual period interval.

64 DeprecatedPeriodProperties::$recurrences

PHP 8.2 this property is no longer in sync with the actual period recurrences.

73 DeprecatedPeriodProperties::$include_start_date

PHP 8.2 this property is no longer in sync with the actual period start included option.

82 DeprecatedPeriodProperties::$include_end_date

PHP 8.2 this property is no longer in sync with the actual period end included option.

Modifiers.php

Line Element Reason
58 Modifiers::setMidDayAt()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather consider mid-day is always 12pm, then if you need to test if it's an other hour, test it explicitly: $date->format('G') == 13 or to set explicitly to a given hour: $date->setTime(13, 0, 0, 0)

Set midday/noon hour

Serialization.php

Line Element Reason
264 Serialization::serializeUsing()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather transform Carbon object before the serialization.

JSON serialize all Carbon instances using the given callback.

StaticLocalization.php

Line Element Reason
29 StaticLocalization::setHumanDiffOptions()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.

39 StaticLocalization::enableHumanDiffOption()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.

49 StaticLocalization::disableHumanDiffOption()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.

StaticOptions.php

Line Element Reason
61 StaticOptions::useStrictMode()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.

90 StaticOptions::useMonthsOverflow()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).

106 StaticOptions::resetMonthsOverflow()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).

134 StaticOptions::useYearsOverflow()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).

150 StaticOptions::resetYearsOverflow()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).

ToStringFormat.php

Line Element Reason
48 ToStringFormat::setToStringFormat()

To avoid conflict between different third-party libraries, static setters should not be used. You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and use other method or custom format passed to format() method if you need to dump another string format.

Set the default format used when type juggling a Carbon instance to a string.

Units.php

Line Element Reason
47 Units::addRealUnit()

Prefer to use add addUTCUnit() which more accurately defines what it's doing.

Add seconds to the instance using timestamp. Positive $value travels forward while negative $value travels into the past.

180 Units::subRealUnit()

Prefer to use add subUTCUnit() which more accurately defines what it's doing.

Subtract seconds to the instance using timestamp. Positive $value travels into the past while negative $value travels forward.

Search results