public static function defaultCommandFactory(Description $description)
    {
        return function (
            $name,
            array $args = [],
            GuzzleClientInterface $client
        ) use ($description) {

            $operation = null;

            if ($description->hasOperation($name)) {
                $operation = $description->getOperation($name);
            } else {
                $name = ucfirst($name);
                if ($description->hasOperation($name)) {
                    $operation = $description->getOperation($name);
                }
            }

            if (!$operation) {
                return null;
            }

            // this is the only line which is patched
            $args += ($operation->getData('defaults') ?: []);

            return new Command($operation, $args, clone $client->getEmitter());
        };
    }
public static function defaultCommandFactory(Description $description)
    {
        return function (
            $name,
            array $args = [],
            GuzzleClientInterface $client
        ) use ($description) {

            $operation = null;

            if ($description->hasOperation($name)) {
                $operation = $description->getOperation($name);
            } else {
                $name = ucfirst($name);
                if ($description->hasOperation($name)) {
                    $operation = $description->getOperation($name);
                }
            }

            if (!$operation) {
                return null;
            }

            // this is the only line which is patched
            $args += ($operation->getData('defaults') ?: []);

            return new Command($operation, $args, clone $client->getEmitter());
        };
    }
public static function defaultCommandFactory ( Description $ description ) { return function ( $ name , array $ args = [ ] , GuzzleClientInterface $ client ) use ( $ description ) { $ operation = null ; if ( $ description -> hasOperation ( $ name ) ) { $ operation = $ description -> getOperation ( $ name ) ; } else { $ name = ucfirst ( $ name ) ; if ( $ description -> hasOperation ( $ name ) ) { $ operation = $ description -> getOperation ( $ name ) ; } } if ( ! $ operation ) { return null ; } // this is the only line which is patched $ args += ( $ operation -> getData ( 'defaults' ) ? : [ ] ) ; return new Command ( $ operation , $ args , clone $ client -> getEmitter ( ) ) ; } ; }
We're overriding this to support operation-specific requestion options.
Currently this is for disabling `auth` on specific operations.
We re overriding this to support operation - specific requestion options . Currently this is for disabling auth on specific operations .