original_string: protected function generate(string $abstract, ReflectionParameter $dependency) : Closure
      {
          if ($class = $dependency->getClass()) {
              return $this->build($class->name, "{$abstract}{$class->name}");
          }
  
          try {
              $value = $dependency->getDefaultValue();
  
              return function () use ($value) {
                  return $value;
              };
          } catch (ReflectionException $e) {
              throw new ContainerException("Cannot resolve '$dependency->name' of '$abstract'", 0, $e);
          }
      }
code: protected function generate(string $abstract, ReflectionParameter $dependency) : Closure
      {
          if ($class = $dependency->getClass()) {
              return $this->build($class->name, "{$abstract}{$class->name}");
          }
  
          try {
              $value = $dependency->getDefaultValue();
  
              return function () use ($value) {
                  return $value;
              };
          } catch (ReflectionException $e) {
              throw new ContainerException("Cannot resolve '$dependency->name' of '$abstract'", 0, $e);
          }
      }
code_tokens: protected function generate ( string $ abstract , ReflectionParameter $ dependency ) : Closure { if ( $ class = $ dependency -> getClass ( ) ) { return $ this -> build ( $ class -> name , "{$abstract}{$class->name}" ) ; } try { $ value = $ dependency -> getDefaultValue ( ) ; return function ( ) use ( $ value ) { return $ value ; } ; } catch ( ReflectionException $ e ) { throw new ContainerException ( "Cannot resolve '$dependency->name' of '$abstract'" , 0 , $ e ) ; } }
docstring: Generate the dependencies callbacks to jump some conditions in every dependency creation.
  
  @param string               $abstract   The class name or container element name to resolve dependencies.
  @param ReflectionParameter  $dependency The class dependency to be resolved.
  
  @throws ContainerException When a dependency cannot be solved.
  @return Closure
docstring_tokens: Generate the dependencies callbacks to jump some conditions in every dependency creation .