Returns the dependencies of the specified class.
@param string $class class name, interface name or alias name
@return array the dependencies of the specified class.
@throws InvalidConfigException
435486
protected function getDependencies($class): array
    {
        if (isset($this->reflections[$class])) {
            return [$this->reflections[$class], $this->dependencies[$class]];
        }

        $dependencies = [];

        try {
            $reflection = new ReflectionClass($class);
        } catch (\ReflectionException $e) {
            throw new InvalidConfigException('Failed to instantiate "' . $class . '".', 0, $e);
        }

        $constructor = $reflection->getConstructor();
        if ($constructor !== null) {
            foreach ($constructor->getParameters() as $param) {
                if ($param->isDefaultValueAvailable()) {
                    $dependencies[] = $param->getDefaultValue();
                } else {
                    $c = $param->getClass();
                    /// TODO think of disallowing `Reference(null)`
                    $dependencies[] = new Reference($c === null ? null : $c->getName());
                }
            }
        }

        $this->reflections[$class] = $reflection;
        $this->dependencies[$class] = $dependencies;

        return [$reflection, $dependencies];
    }
916214
private function getEntityTypeInfo($class)
    {
        $entityType = $this->getEntityType($class);

        if (!$entityType) {
            return [null, null];
        }

        $info = entity_get_info($entityType);

        if (!$info) {
            return [null, null];
        }

        return [$entityType, $info];
    }
584215
public function getDependencyInstances($instance)
    {
        $calls = array();

        foreach ($this->tracedCalls as $call) {
            $oid = spl_object_hash($call['instance']);

            $calls[$oid] = $call;
        }

        $dependencies = array();

        foreach ($calls as $call) {
            $dependingServices = $this->getDependingInstances($call['instance']);

            foreach ($dependingServices as $depending) {
                if ($depending['instance'] === $instance) {
                    $dependencies[] = $call;
                }
            }
        }

        return $dependencies;
    }
734528
public function instantiate(string $class, ...$args)
    {
        $refl = $this->reflection->reflectClass($class);

        $dependencyIds = $this->determineDependencies($refl, count($args));
        $dependencies = $args + $this->getDependencies($dependencyIds);

        return $refl->newInstanceArgs($dependencies);
    }
422888
public function getDescendantsOf($class)
    {
        if (is_object($class)) {
            $class = get_class($class);
        }

        $lClass = strtolower($class);
        if (array_key_exists($lClass, $this->descendants)) {
            return $this->descendants[$lClass];
        }

        return [];
    }
781640
public function getClassProperties($class)
    {
        $result = '';
        foreach($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property)
        {
            $static = $property->isStatic() ? ' static' : '';
            $name = $property->name;
            $result .= <<<CODE
    public{$static} \${$name};

CODE;
        }
        return $result;
    }
160153
private function getDependencies($class)
    {
        if (isset($this->_reflections[$class])) {
            return [$this->_reflections[$class], $this->_dependencies[$class], $this->_defaultProperties[$class]];
        }

        $dependencies = [];
        $reflection = new \ReflectionClass($class);

        //获取类的公共public属性
        $props = $reflection->getProperties(\ReflectionProperty::IS_PUBLIC);

        //获取构造器的参数
        $constructor = $reflection->getConstructor();
        if ($constructor !== null) {
            foreach ($constructor->getParameters() as $param) {
                $name = $param->getName();
                if ($param->isDefaultValueAvailable()) {
                    $dependencies[$name] = $param->getDefaultValue();
                } else {
                    $dependencies[$name] = '';
                }
            }
        }

        $this->_reflections[$class] = $reflection;
        $this->_dependencies[$class] = $dependencies;
        $this->_defaultProperties[$class] = $props;

        unset($reflection);
        unset($defaultProperties);
        unset($dependencies);
        unset($constructor);

        return [$this->_reflections[$class], $this->_dependencies[$class], $this->_defaultProperties[$class]];
    }
776405
private function getPhpFileStmt(\ReflectionClass $class) : array
    {
        $traverser = new NodeTraverser();
        $visitor = new CodeGenVisitor();
        $traverser->addVisitor($visitor);
        $fileName = $class->getFileName();
        if (is_bool($fileName)) {
            throw new InvalidSourceClassException(get_class($class));
        }
        $file = file_get_contents($fileName);
        if ($file === false) {
            throw new \RuntimeException($fileName); // @codeCoverageIgnore
        }
        $stmts = $this->parser->parse($file);
        if (is_array($stmts)) {
            $traverser->traverse($stmts);
        }

        return $visitor();
    }
1365761
public function getModule(string $class) : Module
    {
        foreach ($this->modules as $module) {
            if ($module instanceof $class) {
                return $module;
            }
        }

        throw new \InvalidArgumentException("No register module modules with class '%s'", get_class($class));
    }
174327
public function getConfig($class)
    {
        $class = ltrim($class, '\\');
        $file = $this->configFile;
        if (!isset(self::$_bootstrapConfig[$file])) {
            $this->_buildBootstrapConfig();
        }
        return isset(self::$_bootstrapConfig[$file][$class]) ? self::$_bootstrapConfig[$file][$class] : null;
    }
735180
private function getInterface($class) {
        $interfaceName = $class;
        $interfaces = class_implements($class);
        if (!empty($interfaces)) {
            if (count($interfaces) == 1) {
                $interfaceName = array_shift($interfaces);
            } elseif ($key = array_search($class . 'Interface', $interfaces)) {
                $interfaceName = $interfaces[$key];
            }
        }

        return $interfaceName;
    }
21263
public function loadClass( $class ) {

		if ( ! isset( $this->class_map[ $class ] ) )
			return FALSE;

		return $this->loader->loadFile( $this->class_map[ $class ] );
	}
1117764
public function sources($class = null) {
		$this->_checkConnection();
		$conn = $this->connection;
		return array_map(function($col) { return $col->getName(); }, $conn->listCollections());
	}
276353
public function forClass(string $class): array
    {
        $meta = [];

        foreach ($this->sources as $source) {
            $sourceMeta = $source->forClass($class);
            $meta = $this->mergeMeta($meta, $sourceMeta);
        }

        return $meta;
    }
1016923
protected function getHelper($class) {
    if (!isset($this->helpers[$class])) {
      $qualified_class = '\DrupalCodeBuilder\Task\Generate\\' . $class;

      switch ($class) {
        case 'ComponentDataInfoGatherer':
          $helper = new $qualified_class($this->getHelper('ComponentClassHandler'));
          break;
        case 'ComponentCollector':
          $helper = new $qualified_class(
            $this->environment,
            $this->getHelper('ComponentClassHandler'),
            $this->getHelper('ComponentDataInfoGatherer')
          );
          break;
        default:
          $helper = new $qualified_class();
          break;
      }

      $this->helpers[$class] = $helper;
    }

    return $this->helpers[$class];
  }
614602
private function load($class)
    {
        if ($this->isLoaded($class)) {
            throw new \InvalidArgumentException(sprintf(
                "Error loading class '%s', the class already exists",
                $class
            ));
        }

        if ($file = $this->findFile($class)) {
            return $this->loadFile($file, $class);
        }

        return false;
    }
1038970
public static function getByClass( $class )
	{
		$results = [];
		foreach ( static::$globals as $k => $v )
			if ( $v instanceof $class )
				$results[$k] = $v;
		return $results;
	}