PHP code example of ehough / guzzle-commands

1. Go to this page and download the library: Download ehough/guzzle-commands library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ehough / guzzle-commands example snippets


$commandName = 'foo';
$arguments = ['baz' => 'bar'];
$command = $client->getCommand($commandName, $arguments);


$result = $client->execute($command);

$result = $client->foo(['baz' => 'bar']);

// Create and execute an asynchronous command.
$command = $command = $client->getCommand('foo', ['baz' => 'bar']);
$promise = $client->executeAsync($command);

// Use asynchronous commands with magic methods.
$promise = $client->fooAsync(['baz' => 'bar']);

$result = $promise->wait();

echo $result['fizz']; //> 'buzz'