@param string $className
@param string $domain
@param string $action
@param array $realParameters

@throws \DI\DependencyException
@throws \DI\NotFoundException
@throws \ReflectionException
349005
private function makeObjectAndRunMethod(
        string $className,
        string $domain,
        string $action,
        array $realParameters
    ): void
    {
        if (!$this->lHelper->isActionEnabled($className, $action)) {
            $action = "help";
        }

        $this->container->make($className)
            ->{$action}
            (...($this->lHelper->getReCastedParameters($className, $domain, $action, $realParameters)));
    }
525906
public static function collect(string $className, $objectAnnotation = null, string $propertyName = "", string $methodName = "", $propertyValue = null)
    {
        if ($objectAnnotation instanceof Definition) {

            $name = $objectAnnotation->getName();
            self::$definitions[$className] = empty($name) ? $className : $name;
        }
    }
1175244
public static function executeClass($classString, $forcedParams = null)
    {
        list($className, $methodName) = explode('::', $classString);
        preg_match('/\(.*?\)/', $methodName, $parameters);

        if (count($parameters) > 0) {
            $methodName = str_replace($parameters[0], '', $methodName);
            $parameters = explode(',', str_replace(['(', ')'], '', $parameters[0]));
        }

        $class = resolve($className);

        return $class->$methodName($forcedParams, ...$parameters);
    }
542475
public static function collect(string $className, $objectAnnotation = null, string $propertyName = '', string $methodName = '', $propertyValue = null)
    {
        if ($objectAnnotation instanceof Bootstrap) {

            $name = $objectAnnotation->getName();
            $order = $objectAnnotation->getOrder();

            self::$bootstraps[$className]['name'] = $name;
            self::$bootstraps[$className]['order'] = $order;
        }
    }
1213806
static function load($controller, $action = '', $params = array())
	{

		$class_name = ucfirst($controller);
		$method = $action;
		$tc = "Controller\\" . $class_name;
		if (!class_exists($tc)) return self::er("Class $tc does not exist.");
		$this_object = new $tc($params);


		if (!method_exists($this_object, $method)) {
			return self::er("Method $method in $tc does not exist.");
		}


		if (!is_callable(array($this_object, $method))) return self::er("Method $method in $tc is not callable.");
		if (is_callable(array($this_object, "__before"))) {
			call_user_func(array($this_object, "__before"));
		}


		call_user_func(array($this_object, $method));

		if (is_callable(array($this_object, "__after"))) {
			call_user_func(array($this_object, "__after"));
		}
		return $this_object;
	}
138024
public function addFilter(string $name, string $className, array $parameters = []) : void
    {
        $this->attributes['filters'][$name] = [
            'class' => $className,
            'parameters' => $parameters,
        ];
    }
794701
public static function register($className, $parameters)
    {
        /**
         * If the class is already register, we throw an exception
         * Maybe it's not the best idea, because it makes it not overridable, time will tell
         */
        if (isset(static::$registeredClasses[$className])) {
            throw new Exception("The class $className is already registered");
        }
        static::$registeredClasses[$className] = $parameters;
    }
604630
public function addClass( $className, $parameters = array() )
	{
		$object	= Alg_Object_Factory::createObject( $className, $parameters );
		$this->addObject( $object );
	}
107110
private function getControllerLogic($action)
    {
        list($class, $method) = getClassAndMethodFromString($action);
        $controllerClass = fixClassname(Router::$namespace, $class);

        //Todo: Dependency Injection
        /* @var $controller Controller */
        $controller = new $controllerClass();
        if (!$controller instanceof Controller) {
            throw new Exception("$class does not extend Controller");
        }
        $this->controllerMiddleware = $controller->getMiddlewares();
        return function ($request) use ($controller, $method) {
            //Todo: Dependency Injection
            return $controller->$method($request);
        };
    }
279032
public function bindComponentsViaSetter($instanceName, $setterName, $paramValue) {
		if ($paramValue == null) {
			unset($this->declaredInstances[$instanceName]["setterBinds"][$setterName]);
		} else {
			$this->declaredInstances[$instanceName]["setterBinds"][$setterName] = $paramValue;
		}
	}
1231561
protected function invokeClass($instance, $action, $vars = []) {
        timer('controller response');
        if (is_string($instance)) {
            $instance = new $instance;
        }
        if (method_exists($instance, 'init')) {
            $instance->init();
        }
        if (method_exists($instance, 'invokeMethod')) {
            return call_user_func(array($instance, 'invokeMethod'), $action, $vars);
        }
        throw new Exception(
            __('UNKNOWN CLASS')
        );
    }
744814
public function getInstance($definition, $parameters = null, $name = null)
    {
        if (is_string($definition)) {
            $params = [];
        } elseif (isset($definition['class'])) {
            $params = $definition;
            $definition = $definition['class'];
            unset($params['class'], $params['shared']);
        } elseif (isset($definition[0])) {
            $params = $definition;
            $definition = $definition[0];
            unset($params[0], $params['shared']);
        } else {
            $params = [];
        }

        if ($parameters === null) {
            if (!$params || isset($params[0])) {
                $parameters = $params;
            } else {
                $parameters = [$params];
            }
        } elseif (count($parameters) !== 0 && !isset($parameters[0])) {
            $parameters = [$parameters];
        }

        if (is_string($definition)) {
            if ($definition[0] === '@') {
                $definition = $this->alias->resolveNS($definition);
            }

            if (!class_exists($definition)) {
                throw new InvalidValueException(['`:name` component cannot be resolved: `:class` class is not exists',
                    'name' => $name,
                    'class' => $definition]);
            }
            $count = count($parameters);

            if ($count === 0) {
                $instance = new $definition();
            } elseif ($count === 1) {
                $instance = new $definition($parameters[0]);
            } elseif ($count === 2) {
                $instance = new $definition($parameters[0], $parameters[1]);
            } elseif ($count === 3) {
                $instance = new $definition($parameters[0], $parameters[1], $parameters[2]);
            } else {
                $reflection = new \ReflectionClass($definition);
                $instance = $reflection->newInstanceArgs($parameters);
            }
        } elseif ($definition instanceof \Closure) {
            $instance = call_user_func_array($definition, $parameters);
        } elseif (is_object($definition)) {
            $instance = $definition;
        } else {
            throw new NotSupportedException(['`:name` component cannot be resolved: component implement type is not supported', 'name' => $name]);
        }

        if ($instance instanceof Component || method_exists($instance, 'setDi')) {
            $instance->setDi($this);
        }

        return $instance;
    }
1071331
protected function loadDependencyInObject($object, $property, $dependencyName, $dependencyDefinition){
        $dependency= $this->loadDependency($dependencyName, $dependencyDefinition);
        $reflection= new Reflection($object);
        $reflection->setProperty($property, $dependency, TRUE);
    }
127859
protected function doLoadMetadata(
        string $className,
        ?ClassMetadata $parent,
        ClassMetadataBuildingContext $metadataBuildingContext
    ) : ClassMetadata {
        $classMetadata = new ClassMetadata($className, $metadataBuildingContext);

        if ($parent) {
            $classMetadata->setParent($parent);

            foreach ($parent->getDeclaredPropertiesIterator() as $fieldName => $property) {
                $classMetadata->addInheritedProperty($property);
            }

            $classMetadata->setInheritanceType($parent->inheritanceType);
            $classMetadata->setIdentifier($parent->identifier);

            if ($parent->discriminatorColumn) {
                $classMetadata->setDiscriminatorColumn($parent->discriminatorColumn);
                $classMetadata->setDiscriminatorMap($parent->discriminatorMap);
            }

            $classMetadata->setLifecycleCallbacks($parent->lifecycleCallbacks);
            $classMetadata->setChangeTrackingPolicy($parent->changeTrackingPolicy);

            if ($parent->isMappedSuperclass) {
                $classMetadata->setCustomRepositoryClassName($parent->getCustomRepositoryClassName());
            }
        }

        // Invoke driver
        try {
            $this->driver->loadMetadataForClass($classMetadata->getClassName(), $classMetadata, $metadataBuildingContext);
        } catch (ReflectionException $e) {
            throw MappingException::reflectionFailure($classMetadata->getClassName(), $e);
        }

        $this->completeIdentifierGeneratorMappings($classMetadata);

        if ($parent) {
            if ($parent->getCache()) {
                $classMetadata->setCache(clone $parent->getCache());
            }

            if (! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) {
                $classMetadata->entityListeners = $parent->entityListeners;
            }
        }

        $this->completeRuntimeMetadata($classMetadata, $parent);

        if ($this->evm->hasListeners(Events::loadClassMetadata)) {
            $eventArgs = new LoadClassMetadataEventArgs($classMetadata, $this->em);

            $this->evm->dispatchEvent(Events::loadClassMetadata, $eventArgs);
        }

        $this->buildValueGenerationPlan($classMetadata);
        $this->validateRuntimeMetadata($classMetadata, $parent);

        return $classMetadata;
    }
1039776
public function createPointer($domain, $alias = false)
    {
        $parameters = [
            'domain' => $this->domainName,
            'from' => $domain,
            'action' => 'add',
        ];
        if ($alias) {
            $parameters['alias'] = 'yes';
            $list = &$this->aliases;
        } else {
            $list = &$this->pointers;
        }
        $this->getContext()->invokeApiPost('DOMAIN_POINTER', $parameters);
        $list[] = $domain;
        $list = array_unique($list);
    }
848011
public function loadMetadataForClass($className, ClassMetadata $metadata)
    {
        if (!\in_array(DatabaseEntityInterface::class, \class_implements($className))) {
            $repositoryName = $this->entityRepositoryMapping->getRepositoryByEntity($className);
            $instantiator = new Instantiator();

            /** @var RepositoryInterface $repository */
            $repository = $instantiator->instantiate($repositoryName);
            $classMetaDataBuilder = new ClassMetadataBuilder($metadata);
            $repository->loadMetadata($classMetaDataBuilder);

            return;
        }

        $classMetaDataBuilder = new ClassMetadataBuilder($metadata);
        $className::loadMetadata($classMetaDataBuilder);
    }
456130
public function bindComponents($instanceName, $paramName, $paramValue) {
		if ($paramValue == null) {
			unset($this->declaredInstances[$instanceName]["fieldBinds"][$paramName]);
		} else {
			$this->declaredInstances[$instanceName]["fieldBinds"][$paramName] = $paramValue;
		}
	}