Update the given client.

@param  Client  $client
@param  string  $name
@param  string  $redirect
@return \Laravel\Passport\Client
960647
public function update(Client $client, $name, $redirect)
    {
        $client->forceFill([
            'name' => $name, 'redirect' => $redirect,
        ])->save();

        return $client;
    }
303264
public function createHttpClient($name = '', $client = null)
    {
        if (empty($name)) {
            return $this->createBestClient();
        }

        if (!isset($this->classes[$name])) {
            throw new \InvalidArgumentException(sprintf('The client "%s" is not registered.', $name));
        }

        $class = $this->classes[$name]['class'];
        $client = new $class($this->dispatcher, $this->options, $client);

        if ($client instanceof AbstractHttpClient) {
            return $client;
        }

        throw new \InvalidArgumentException('The client must be an implementation of ClientInterface.');
    }
212111
public function deleteClientAction(Client $client)
    {
        $oldid = $client->getId();
        $this->oauthManager->deleteClient($client);

        return new JsonResponse(['id' => $oldid]);
    }
382483
public function setRedirectUrl($redirect = null, $key = null) {
		if (empty($redirect)) {
			$redirect = $this->_controller->request->referer(true);
		} elseif ($redirect === true) {
			$redirect = $this->_controller->request->here(true);
		}
		if (empty($redirect) || $this->_controller->request->is('popup') ||
			$this->_controller->request->is('print')) {
			return false;
		}
		$cacheKey = $this->_getSessionKeyRedirect($key);
		$data = CakeSession::read($cacheKey);
		if (!empty($data) && (md5((string)$data) === md5((string)$redirect))) {
			return false;
		}

		return CakeSession::write($cacheKey, $redirect);
	}
1041040
public function getOAuthClient($client_id, $client_secret, $redirect_uri)
    {
        $options = [
            'clientId' => $client_id,
            'clientSecret' => $client_secret,
            'redirectUri' => $redirect_uri
        ];
        $OAuthClient = new OAuth($options);

        return $OAuthClient;
    }
1103118
public function createPersonalAccessClient($userId, $name, $redirect)
    {
        return $this->create($userId, $name, $redirect, true);
    }
367365
function createClient(redisClientOptions) {
  const client = redis.createClient(redisClientOptions);
  if (!client._options) {
    client._options = redisClientOptions;
  }
  return client;
}
621126
public function removeAction($name)
    {
        /* @var \Google_Client $client */
        $clientProvider = $this->get('happyr.google_site_authenticator.client_provider');
        $clientProvider->setAccessToken(null, $name);

        $this->get('session')->getFlashbag()->add('msg', 'Token was removed.');

        return $this->redirect($this->generateUrl('happyr.google_site_authenticator.index'));
    }
1140360
public function updateClient($client_id, $input)
    {
        $response = $this->put('v2/clients/'.$client_id, $input);

        return new NorthstarClient($response['data']);
    }
1333416
static function loadProvider($key, $redirect) {
    if (!$redirect) {
      throw new \InvalidArgumentException("No redirect provided.");
    }

    switch ($key) {
      case "google":
        return new GoogleWithOpenID(array(
          'clientId' =>\Openclerk\Config::get("oauth2_google_client_id"),
          'clientSecret' => \Openclerk\Config::get("oauth2_google_client_secret"),
          'redirectUri' => $redirect,
          'scopes' => array('email', 'openid'),
          'openid.realm' => \Openclerk\Config::get('openid_host'),
        ));

      case "facebook":
        return new \League\OAuth2\Client\Provider\Facebook(array(
          'clientId' =>\Openclerk\Config::get("oauth2_facebook_app_id"),
          'clientSecret' => \Openclerk\Config::get("oauth2_facebook_app_secret"),
          'redirectUri' => $redirect,
          'scopes' => array('email'),
        ));

      case "github":
        return new \League\OAuth2\Client\Provider\Github(array(
          'clientId' =>\Openclerk\Config::get("oauth2_github_client_id"),
          'clientSecret' => \Openclerk\Config::get("oauth2_github_client_secret"),
          'redirectUri' => $redirect,
          'scopes' => array('email'),
        ));

      default:
        throw new UserAuthenticationException("No such known OAuth2 provider '$key'");
    }
  }
840245
public function update(Request $request, $clientId)
    {
        $client = $this->clients->findForUser($clientId, $request->user()->getKey());

        if (! $client) {
            return new Response('', 404);
        }

        $this->validation->make($request->all(), [
            'name' => 'required|max:255',
            'redirect' => 'required|url',
        ])->validate();

        return $this->clients->update(
            $client, $request->name, $request->redirect
        );
    }
382342
public function updateAction(Request $request, string $alias): Response
    {
        $this->permissionAccess('uicron', 'update');

        $cron = $this->cronService->getCron($alias);
        if (!$cron) {
            return new RedirectResponse($this->generateUrl('edgar.ezuicron.list', []));
        }

        $form = $this->formFactory->updateCron($cron);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $result = $this->submitHandler->handle($form, $cron, function (EdgarEzCron $data, EdgarEzCron $cron, FormInterface $form) {
                if (!$this->cronService->updateCron($data)) {
                    $this->notificationHandler->error(
                        $this->translator->trans(
                            'edgar.ezuicron.cron.update.error',
                            [],
                            'edgarezuicron'
                        )
                    );

                    return $this->render('EdgarEzUICronBundle:cron:update.html.twig', [
                        'cron' => $cron,
                        'form_cron_update' => $form->createView(),
                    ]);
                }

                $this->notificationHandler->success(
                    $this->translator->trans(
                        'edgar.ezuicron.cron.updated',
                        [],
                        'edgarezuicron'
                    )
                );

                return new RedirectResponse($this->generateUrl('edgar.ezuicron.list', []));
            });

            if ($result instanceof Response) {
                return $result;
            }
        }

        return $this->render('EdgarEzUICronBundle:cron:update.html.twig', [
            'cron' => $cron,
            'form_cron_update' => $form->createView(),
        ]);
    }
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);
    }
560033
public function _($name = null)
    {
        if (isset($name)) {
            $this->path[] = $name;
        }
        $client = new static($this->host, $this->headers);
        $client->setPath($this->path);
        $client->setCurlOptions($this->curlOptions);
        $client->setRetryOnLimit($this->retryOnLimit);
        $this->path = [];

        return $client;
    }
1225194
public function update(Redirect $redirect, UpdateRedirectRequest $request)
    {
        $this->authorize(RedirectsPolicy::PERMISSION_UPDATE);

        $redirect->update($request->getValidatedData());

        $this->transNotification('updated', [], $redirect->toArray());

        return redirect()->route('admin::seo.redirects.show', [$redirect]);
    }
1071845
public function setClient(\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Client\Client $client = null)
    {
        $this->client = $client;

        return $this;
    }
832246
public function createPersonalAccessClient($userId, $name, $redirect)
    {
        return tap($this->create($userId, $name, $redirect, true), function ($client) {
            $accessClient = Passport::personalAccessClient();
            $accessClient->client_id = $client->id;
            $accessClient->save();
        });
    }