public function testReturnsNullWhenNonResolve() { $called = []; $a = function () use(&$called) { $called[] = 'a'; }; $b = function () use(&$called) { $called[] = 'b'; }; $c = function () use(&$called) { $called[] = 'c'; }; $comp = Utils::orFn($a, $b, $c); $this->assertNull($comp()); $this->assertEquals(['a', 'b', 'c'], $called); }
/** * Create a default credential provider that first checks for environment * variables, then checks for the "default" profile in ~/.Vws/credentials, * and finally checks for credentials using EC2 instance profile * credentials. * * @param array $config Optional array of instance profile credentials * provider options. * * @return callable */ public static function defaultProvider(array $config = []) { return Utils::orFn(self::env(), self::ini()); }