From 221ba657585ef0e8ae667dff9da854923c50b06b Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Mon, 22 Mar 2021 17:06:44 +0000
Subject: [PATCH] Issue #3186626 by klausi, longwave: Second parameter of
 ProxyBuilder::build() is never used and broken

---
 .../Component/ProxyBuilder/ProxyBuilder.php      | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/core/lib/Drupal/Component/ProxyBuilder/ProxyBuilder.php b/core/lib/Drupal/Component/ProxyBuilder/ProxyBuilder.php
index 334d76b551db..65d7926e6d56 100644
--- a/core/lib/Drupal/Component/ProxyBuilder/ProxyBuilder.php
+++ b/core/lib/Drupal/Component/ProxyBuilder/ProxyBuilder.php
@@ -48,24 +48,16 @@ public static function buildProxyNamespace($class_name) {
    *
    * @param string $class_name
    *   The class name of the actual service.
-   * @param string $proxy_class_name
-   *   (optional) The class name of the proxy service.
    *
    * @return string
    *   The full string with namespace class and methods.
    */
-  public function build($class_name, $proxy_class_name = '') {
+  public function build($class_name) {
     $reflection = new \ReflectionClass($class_name);
 
-    if ($proxy_class_name) {
-      $proxy_class_reflection = new \ReflectionClass($proxy_class_name);
-      $proxy_namespace = $proxy_class_reflection->getNamespaceName();
-    }
-    else {
-      $proxy_class_name = $this->buildProxyClassName($class_name);
-      $proxy_namespace = $this->buildProxyNamespace($class_name);
-      $proxy_class_shortname = str_replace($proxy_namespace . '\\', '', $proxy_class_name);
-    }
+    $proxy_class_name = $this->buildProxyClassName($class_name);
+    $proxy_namespace = $this->buildProxyNamespace($class_name);
+    $proxy_class_shortname = str_replace($proxy_namespace . '\\', '', $proxy_class_name);
 
     $output = '';
     $class_documentation = <<<'EOS'
-- 
GitLab