Cake\Chronos\ChronosInterval::__callStatic PHP Method

__callStatic() public static method

ChronosInterval::years(3) or ChronosInterval::month(1); Note: This is done using the magic method to allow static and instance methods to have the same names.
public static __callStatic ( string $name, array $args ) : static
$name string The property to configure. Accepts singular and plural forms.
$args array Contains the value to use.
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);
        }
    }