PHP code example of eightpoints / guzzle-bundle

1. Go to this page and download the library: Download eightpoints/guzzle-bundle 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/ */

    

eightpoints / guzzle-bundle example snippets




return [
    // other bundles here
    EightPoints\Bundle\GuzzleBundle\EightPointsGuzzleBundle::class => ['all' => true],
];



namespace App\Controller;

use Guzzle\Client;

class ExampleController
{
    public function __construct(Client $client)
    {
        $this->client = $client;
    }
}

foreach ($contents as $class => $envs) {
    if ($envs[$this->environment] ?? $envs['all'] ?? false) {
        yield new $class();
    }
}

foreach ($contents as $class => $envs) {
    if ($envs[$this->environment] ?? $envs['all'] ?? false) {
        if ($class === \EightPoints\Bundle\GuzzleBundle\EightPointsGuzzleBundle::class) {
            yield new $class([
                new \Gregurco\Bundle\GuzzleBundleOAuth2Plugin\GuzzleBundleOAuth2Plugin(),
            ]);
        } else {
            yield new $class();
        }
    }
}

[2017-12-01 00:00:00] eight_points_guzzle.INFO: GET http://api.domain.tld 200