public function maxDepth(int $depth = null): int
    {
        if (null === $depth) {
            return $this->maxDepth;
        }

        $previous = $this->maxDepth;
        
        $this->maxDepth = 0 > $depth ? 0 : $depth;

        return $previous;
    }
public function maxDepth(int $depth = null): int
    {
        if (null === $depth) {
            return $this->maxDepth;
        }

        $previous = $this->maxDepth;
        
        $this->maxDepth = 0 > $depth ? 0 : $depth;

        return $previous;
    }
public function maxDepth ( int $ depth = null ) : int { if ( null === $ depth ) { return $ this -> maxDepth ; } $ previous = $ this -> maxDepth ; $ this -> maxDepth = 0 > $ depth ? 0 : $ depth ; return $ previous ; }
Sets the maximum number of functions that can be called when the queue is called.

@param int|null $depth Maximum number of functions to execute when the queue is called. Use 0 for unlimited.
Use null to just retrieve the current max depth.

@return int Previous max depth.
Sets the maximum number of functions that can be called when the queue is called .