src/Event.php
public function cron(string $expression): self
    {
        /** @var array $parts */
        $parts = \preg_split(
            '/\s/',
            $expression,
            -1,
            PREG_SPLIT_NO_EMPTY
        );

        if (\count($parts) > 5) {
            throw new TaskException("Expression '{$expression}' has more than five parts and this is not allowed.");
        }

        $this->expression = $expression;

        return $this;
    }
public function cron(string $expression): self
    {
        /** @var array $parts */
        $parts = \preg_split(
            '/\s/',
            $expression,
            -1,
            PREG_SPLIT_NO_EMPTY
        );

        if (\count($parts) > 5) {
            throw new TaskException("Expression '{$expression}' has more than five parts and this is not allowed.");
        }

        $this->expression = $expression;

        return $this;
    }
public function cron ( string $ expression ) : self { /** @var array $parts */ $ parts = \ preg_split ( '/\s/' , $ expression , - 1 , PREG_SPLIT_NO_EMPTY ) ; if ( \ count ( $ parts ) > 5 ) { throw new TaskException ( "Expression '{$expression}' has more than five parts and this is not allowed." ) ; } $ this -> expression = $ expression ; return $ this ; }
The Cron expression representing the event's frequency.

@throws TaskException
The Cron expression representing the event s frequency .