Cake\Chronos\ChronosInterval::__call PHP Method

__call() public method

.. ChronosInterval::years(3)->months(5)->day(). Note: This is done using the magic method to allow static and instance methods to have the same names.
public __call ( string $name, array $args ) : static
$name string The property name to augment. Accepts plural forms in addition to singular ones.
$args array The value to set.
return static
    public function __call($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 * ChronosInterface::DAYS_PER_WEEK;
                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;
    }