src/Backoff.php
protected function buildStrategy($strategy)
    {
        if (is_string($strategy) && array_key_exists($strategy, $this->strategies)) {
            return new $this->strategies[$strategy];
        }

        if (is_callable($strategy)) {
            return $strategy;
        }

        if (is_int($strategy)) {
            return new ConstantStrategy($strategy);
        }

        throw new InvalidArgumentException("Invalid strategy: " . $strategy);
    }
protected function buildStrategy($strategy)
    {
        if (is_string($strategy) && array_key_exists($strategy, $this->strategies)) {
            return new $this->strategies[$strategy];
        }

        if (is_callable($strategy)) {
            return $strategy;
        }

        if (is_int($strategy)) {
            return new ConstantStrategy($strategy);
        }

        throw new InvalidArgumentException("Invalid strategy: " . $strategy);
    }
protected function buildStrategy ( $ strategy ) { if ( is_string ( $ strategy ) && array_key_exists ( $ strategy , $ this -> strategies ) ) { return new $ this -> strategies [ $ strategy ] ; } if ( is_callable ( $ strategy ) ) { return $ strategy ; } if ( is_int ( $ strategy ) ) { return new ConstantStrategy ( $ strategy ) ; } throw new InvalidArgumentException ( "Invalid strategy: " . $ strategy ) ; }
Builds a callable strategy.

@param mixed $strategy   Can be a string that matches a key in $strategies, an instance of AbstractStrategy
(or any other instance that has an __invoke method), a callback function, or
an integer (which we interpret to mean you want a ConstantStrategy)

@return callable
Builds a callable strategy .