function ProxyBuilder::buildProxyNamespace

Same name in other branches
  1. 9 core/lib/Drupal/Component/ProxyBuilder/ProxyBuilder.php \Drupal\Component\ProxyBuilder\ProxyBuilder::buildProxyNamespace()
  2. 8.9.x core/lib/Drupal/Component/ProxyBuilder/ProxyBuilder.php \Drupal\Component\ProxyBuilder\ProxyBuilder::buildProxyNamespace()
  3. 11.x core/lib/Drupal/Component/ProxyBuilder/ProxyBuilder.php \Drupal\Component\ProxyBuilder\ProxyBuilder::buildProxyNamespace()

Generates the used proxy namespace from a given class name.

Parameters

string $class_name: The class name of the actual service.

Return value

string The namespace name of the proxy.

2 calls to ProxyBuilder::buildProxyNamespace()
ProxyBuilder::build in core/lib/Drupal/Component/ProxyBuilder/ProxyBuilder.php
Builds a proxy class string.
ProxyBuilderTest::buildExpectedClass in core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyBuilderTest.php
Constructs the expected class output.

File

core/lib/Drupal/Component/ProxyBuilder/ProxyBuilder.php, line 38

Class

ProxyBuilder
Generates the string representation of the proxy service.

Namespace

Drupal\Component\ProxyBuilder

Code

public static function buildProxyNamespace($class_name) {
    $proxy_classname = static::buildProxyClassName($class_name);
    preg_match('/(.+)\\\\[a-zA-Z0-9]+/', $proxy_classname, $match);
    $proxy_namespace = $match[1];
    return $proxy_namespace;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.