public function setExpression($value)
    {
        $this->cronParts = preg_split('/\s/', $value, -1, PREG_SPLIT_NO_EMPTY);
        if (count($this->cronParts) < 6) {
            throw new InvalidArgumentException(
                $value . ' is not a valid CRON expression'
            );
        }

        foreach ($this->cronParts as $position => $part) {
            $this->setPart($position, $part);
        }

        return $this;
    }
public function setExpression($value)
    {
        $this->cronParts = preg_split('/\s/', $value, -1, PREG_SPLIT_NO_EMPTY);
        if (count($this->cronParts) < 6) {
            throw new InvalidArgumentException(
                $value . ' is not a valid CRON expression'
            );
        }

        foreach ($this->cronParts as $position => $part) {
            $this->setPart($position, $part);
        }

        return $this;
    }
public function setExpression ( $ value ) { $ this -> cronParts = preg_split ( '/\s/' , $ value , - 1 , PREG_SPLIT_NO_EMPTY ) ; if ( count ( $ this -> cronParts ) < 6 ) { throw new InvalidArgumentException ( $ value . ' is not a valid CRON expression' ) ; } foreach ( $ this -> cronParts as $ position => $ part ) { $ this -> setPart ( $ position , $ part ) ; } return $ this ; }
Set or change the CRON expression

@param string $schedule CRON expression (e.g. 8 * * * *)

@return CronExpression
@throws InvalidArgumentException if not a valid CRON expression
Set or change the CRON expression