Cake\Chronos\ChronosInterval::create PHP Method

create() public static method

This is an alias for the constructor that allows better fluent syntax as it allows you to do ChronosInterval::create(1)->fn() rather than (new ChronosInterval(1))->fn().
public static create ( integer | null $years = 1, integer | null $months = null, integer | null $weeks = null, integer | null $days = null, integer | null $hours = null, integer | null $minutes = null, integer | null $seconds = null ) : static
$years integer | null The year to use.
$months integer | null The month to use.
$weeks integer | null The week to use.
$days integer | null The day to use.
$hours integer | null The hours to use.
$minutes integer | null The minutes to use.
$seconds integer | null The seconds to use.
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);
    }