src/ClientSideMonitoring/ConfigurationProvider.php
public static function chain()
    {
        $links = func_get_args();
        if (empty($links)) {
            throw new \InvalidArgumentException('No providers in chain');
        }

        return function () use ($links) {
            /** @var callable $parent */
            $parent = array_shift($links);
            $promise = $parent();
            while ($next = array_shift($links)) {
                $promise = $promise->otherwise($next);
            }
            return $promise;
        };
    }
public static function chain()
    {
        $links = func_get_args();
        if (empty($links)) {
            throw new \InvalidArgumentException('No providers in chain');
        }

        return function () use ($links) {
            /** @var callable $parent */
            $parent = array_shift($links);
            $promise = $parent();
            while ($next = array_shift($links)) {
                $promise = $promise->otherwise($next);
            }
            return $promise;
        };
    }
public static function chain ( ) { $ links = func_get_args ( ) ; if ( empty ( $ links ) ) { throw new \ InvalidArgumentException ( 'No providers in chain' ) ; } return function ( ) use ( $ links ) { /** @var callable $parent */ $ parent = array_shift ( $ links ) ; $ promise = $ parent ( ) ; while ( $ next = array_shift ( $ links ) ) { $ promise = $ promise -> otherwise ( $ next ) ; } return $ promise ; } ; }
Creates an aggregate credentials provider that invokes the provided
variadic providers one after the other until a provider returns
credentials.

@return callable
Creates an aggregate credentials provider that invokes the provided variadic providers one after the other until a provider returns credentials .