Commit 3079f373 authored by m4olivei's avatar m4olivei
Browse files

Issue #3066644 by anabpv, m4olivei: Fix PHPCS again

parent da16f63e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -304,7 +304,7 @@ abstract class HttpApiPluginBase extends PluginBase implements ContainerFactoryP
  public function forward(Request $request, string $uri): Response {
    $parsed_uri = UrlHelper::parse($uri);
    $api_uri = rtrim($this->getBaseUrl(), '/') . '/' . ltrim($parsed_uri['path'], '/');
    list($api_method, $api_uri, $headers, $query_params) = $this->preprocessIncoming(
    [$api_method, $api_uri, $headers, $query_params] = $this->preprocessIncoming(
      $request->getMethod(),
      $api_uri,
      $request->headers,
@@ -441,7 +441,7 @@ abstract class HttpApiPluginBase extends PluginBase implements ContainerFactoryP
    return array_filter(array_reduce(
      array_filter(explode("\n", $input)),
      function ($carry, $header) {
        list($name, $val) = array_map('trim', explode(':', $header, 2));
        [$name, $val] = array_map('trim', explode(':', $header, 2));
        return array_merge($carry, [$name => $val]);
      },
      []
+3 −11
Original line number Diff line number Diff line
@@ -13,18 +13,10 @@ trait HttpApiCommonConfigs {
  protected function authTokenConfigForm(array $configuration): array {
    return [
      '#type' => 'item',
      '#title' => $this->t('Authentication token (%status)', [
        '%status' => empty($configuration['auth_token']) ? $this->t('Not set') : $this->t('Successfully set'),
      ]),
      '#description' => $this->t("The authentication token to access the %label proxy. %important do not export configuration to the repository with sensitive data, instead set #code %config #token #endcode in your #code settings.local.php #endcode (or similar) to store your secret.", [
      '#title' => $this->t('Authentication token (%status)', ['%status' => empty($configuration['auth_token']) ? $this->t('Not set') : $this->t('Successfully set')]),
      '#description' => $this->t("The authentication token to access the %label proxy. <strong>IMPORTANT:</strong> do not export configuration to the repository with sensitive data, instead set <code>\$config['api_proxy.settings']['api_proxies']['@id']['auth_token'] = 'YOUR-TOKEN';</code> in your <code>settings.local.php</code> (or similar) to store your secret.", [
        '%label' => $this->getPluginDefinition()['label'],
        '%important' => $this->t("<strong>IMPORTANT:</strong>"),
        '#code' => "<code>",
        '#endcode' => "</code>",
        '%config' => $config,
        '#token' => "[\'api_proxy.settings\'][\'api_proxies\'][\'@id\'][\'auth_token\'] = \'YOUR-TOKEN\';", [
        '@id' => $this->getPluginId(),
        ],
      ]),
    ];
  }