You are here

public function ProxyDumper::isProxyCandidate in Service Container 7

Same name and namespace in other branches
  1. 7.2 lib/Drupal/Component/ProxyBuilder/ProxyDumper.php \Drupal\Component\ProxyBuilder\ProxyDumper::isProxyCandidate()

Inspects whether the given definitions should produce proxy instantiation logic in the dumped container.

Parameters

Definition $definition:

Return value

bool

Overrides DumperInterface::isProxyCandidate

File

lib/Drupal/Component/ProxyBuilder/ProxyDumper.php, line 39
Contains \Drupal\Component\ProxyBuilder\ProxyDumper.

Class

ProxyDumper
Dumps the proxy service into the dumped PHP container file.

Namespace

Drupal\Component\ProxyBuilder

Code

public function isProxyCandidate(Definition $definition) {
  return $definition
    ->isLazy() && ($class = $definition
    ->getClass()) && class_exists($class);
}