@param Client $client

@return \GuzzleHttp\Message\ResponseInterface|void
487323
public function execute(Client $client)
    {
        if (!$this->request instanceof Request) {
            throw new \InvalidArgumentException('request is not an instanceof \GuzzleHttp\Message\Request');
        }

        $this->copyClientDefaults($client);

        return $client->send($this->request);
    }
885884
public function setClient(\Yurun\Swoole\SharedMemory\Client\Client $client)
    {
        $this->client = $client;

        return $this;
    }
1210386
protected function clientFetch(Client $client, FetchRequest $msg)
    {
        $requestId     = $msg->getRequestId();
        $waitForResult = $msg->getWaitForResult();

        $client->setRequest($requestId, $waitForResult);

        $this->getLogger()->debug(
            sprintf(
                'Client %s is requesting the result of request %s.',
                bin2hex($client->getId()),
                $requestId
            )
        );

        if ($this->storage->has($requestId)) {
            $this->sendResponseToClients($requestId);

            return;
        }

        $this->logger->debug(
            sprintf(
                'The result for request %s is not yet available, but '.
                'client %s is %s to wait for it.',
                $requestId,
                bin2hex($client->getId()),
                ($waitForResult) ? 'willing' : 'not willing'
            )
        );

        if (!$waitForResult) {
            $this->reply($client, new TimeoutResponse($requestId));;
        }
    }
691751
protected function attachSubscribers(Client $client)
    {
        $client->getEmitter()->attach($this->getRetrySubscriber());
        $client->getEmitter()->attach($this->getErrorSubscriber());

        return $client;
    }
596007
protected function createClient($client)
    {
        try {
            new \ReflectionClass($client);
        } catch (\ReflectionException $e) {
            throw new FoundationException(sprintf("Could not load class '%s'.", $client), null, $e);
        }

        $client_instance = new $client();

        return $client_instance;
    }
405729
private function addScopeAndRedirectUris(Client $client): void
    {
        $client->setScopeIdentifiers($this->readScopeIdentifiers($client->getIdentifier()));
        $client->setRedirectUriStrings($this->readRedirectUriStrings($client->getIdentifier()));
    }
212111
public function deleteClientAction(Client $client)
    {
        $oldid = $client->getId();
        $this->oauthManager->deleteClient($client);

        return new JsonResponse(['id' => $oldid]);
    }
692976
public function remove(Client $client)
    {
        $clientId = $client->getId();
        if (!isset($this->clients[$clientId])) {
            return $this;
        }

        $requestId = $client->getRequest();
        $this->removeClientForRequest($clientId, $requestId);
        unset($this->clients[$clientId]);

        return $this;
    }
351502
protected function outputClientDetails(Client $client)
    {
        $this->line('<comment>Client ID:</comment> '.$client->id);
        $this->line('<comment>Client secret:</comment> '.$client->secret);
    }
1301523
public function setHttpClient(Client $client = null)
    {
        if ($client === null) {
            $client = new Client(
                HttpClientDiscovery::find(),
                MessageFactoryDiscovery::find()
            );
        }
        $this->client = $client;
        return $this;
    }
1138734
public function setClient($client)
    {
        if ($client instanceof Client && $this->client != $client) {
            $this->configureDefaults($client->getMessageDefaults(), true);
        }

        $this->client = $client;

        return $this;
    }
1262632
protected function registerClientSubscribers(ClientInterface $client)
    {
        $client->on('irc.received', function ($message, $write, $connection) {
            $this->processClientEvent('irc.received', $message, $connection, $write);
        });

        $client->on('irc.sent', function ($message, $write, $connection) {
            $parsed = $this->getParser()->parse($message);
            if (!$parsed) {
                return;
            }
            $this->processClientEvent('irc.sent', $parsed, $connection, $write);
        });

        $client->on('irc.tick', function ($write, $connection) {
            $this->processOutgoingEvents($connection, $write);
        });
    }
794907
public function client($client = null)
    {
        if ($client === null) {
            return $this->getClient();
        }

        return $this->setClient($client);
    }
34884
public function createClient(Client $client, $password)
    {
        $data = $client->toArray();
        $data['password_confirm'] = $data['password'] = $password;
        $data['send_email'] = 0;
        $data['submit'] = 'Save';

        $response = $this->post('/en/client/add', $data);

        if ($response->getStatusCode() == 200) {
            $error = $this->getBetween((string)$response->getBody(), '<ul class="errors">', '</ul>');
            $error = $this->getBetween($error, '<li>', '</li>');
            throw new YouHostingException("Unable to create profile: " . $error);
        }

        $response = $this->get($response->getHeader('Location'));

        $client->id = $this->getBetweenReverse((string)$response->getBody(), '/en/client/view/id/', '">' . $client->email);
        return $client;
    }
630322
public function modalEditFormAction(Client $client)
    {
        $form = $this->get('form.factory')->create(new OauthClientType(), $client);

        return array('form' => $form->createView(), 'client' => $client);
    }
729509
public function addClient(\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Client\Client $client)
    {
        $this->clients[] = $client;

        return $this;
    }
1232996
protected function makeServicesClient(Client $client)
    {
        $parameters = $this->getDescription();

        $description = new Description($parameters);

        return new GuzzleClient($client, $description);
    }