获取下一行并作为一个对象返回。
@param string $class_name
@param array $ctor_args
@return mixed
555324
public function fetchObject(string $className = "stdClass", array $ctorArgs = null)
    {
        return $this->statement->fetchObject($className, $ctorArgs);
    }
866067
static function load($class_name)
    {
        if (stream_resolve_include_path(
            "modules/archi/includes/".$class_name.".class.php"
        )) {
            include_once "modules/archi/includes/".$class_name.".class.php";
        } else if (stream_resolve_include_path(
            __DIR__."/frameworkClasses/".$class_name.".class.php"
        )) {
            include_once __DIR__."/frameworkClasses/".$class_name.".class.php";
        }
    }
1012924
public function run($class_name){
		$this->_class_name = $class_name;
		$this->_global_config = Factory::load('Config');
		$this->_rel_path = Factory::load('Page')->get('path.relative');

		/* get modules config array: '$modules'
		********************************************************************************************/
		$modules_path = $this->_global_config->get('modules._config_path');
		if(is_file($modules_path)){
			$modules_config_array = include($modules_path);
		}

		/* transform module config array structure into the module queue array
		 * insert main module between 'pre' and 'post' modules
		********************************************************************************************/
		$temp = [];
		foreach($modules_config_array as $regex => $page_modules){
			if(isset($page_modules['pre'])){
				foreach($page_modules['pre'] as $page_module){
					$temp[] = array_merge($page_module, ['controller_regex' => $regex]);
				}
			}
		}
		$temp[] = [
			'action'           => 'replace',
			'class'            => $class_name,
			'controller_regex' => '=.*=',
			'selector'         => 'html'
		];
		foreach($modules_config_array as $regex => $page_modules){
			if(isset($page_modules['post'])){
				foreach($page_modules['post'] as $page_module){
					$temp[] = array_merge($page_module, ['controller_regex' => $regex]);
				}
			}
		}
		$this->_module_queue = $temp;


		/* remove modules from the module queue array that wont be executed
		********************************************************************************************/
		foreach($this->_module_queue as $key => $module){
			if(!preg_match($module['controller_regex'], $this->_rel_path)){
				unset($this->_module_queue[$key]);
			}
		}


		/* execute module queue
		********************************************************************************************/
		$nonHtmlReturner = null;
		while($this->_module_queue){
			// remove this item from queue
			$module = array_shift($this->_module_queue);

			// check if module controller exists
			try{
				class_exists($module['class']);
			}catch(\Exception $e){
				throw new \Exception('Namespace "' . $module['class'] . '" could not be resolved.');
			}

			// put module configs into global config
			$this->_insertModuleConfig($module['class'], isset($module['config']) ? $module['config'] : []);

			// execute module
			$returner = $this->_runModuleController($module);

			// if the module view returns no HTML, put returned content into a respective variable
			// this way, we can decide to put it into the dom or not
			if($returner['type'] === 'string' || $returner['type'] === 'stream'){
				// if non html or html has already been returned by another module, throw exception
				if(!is_null($nonHtmlReturner)){
					throw new \Exception(__CLASS__.': Multiple modules have returned a String or Stream when only one is allowed.');
				}
				if(!is_null($this->_dom)){
					throw new \Exception(__CLASS__.': A module has returned a String or Stream when already HTML has been returned.');
				}
				rewind($returner['handle']);
				$nonHtmlReturner = $returner['handle'];
			}

			// if the module view returns html, put it into dom
			if($returner['type'] === 'html'){
				// if non html has already been returned by another module, throw exception
				if(!is_null($nonHtmlReturner)){
					throw new \Exception(__CLASS__.': A module has returned HTML when already a String or Stream has been returned.');
				}

				// if no dom has been created yet, create it and add doctype and html tag
				// this way, the dom class will be able to prepend/append/replace content
				if(is_null($this->_dom)){
					$this->_dom = new \Morrow\DOM;
					$this->_dom->set('<!doctype html><html></html>');
				}

				// if an action is defined in the controller array, execute it (i.e. prepend/append/replace)
				if(isset($module['action'])){
					rewind($returner['handle']);
					$this->_dom->{$module['action']}($module['selector'], stream_get_contents($returner['handle']));
				}
			}
		}

		$handle_full_content = fopen('php://memory', 'r+');

		// write dom
		if(!is_null($this->_dom)){
			fwrite($handle_full_content, $this->_dom->get());
		}

		// write string
		if(!is_null($nonHtmlReturner)){
			fwrite($handle_full_content, stream_get_contents($nonHtmlReturner));
		}

		/* trigger an event so others are able to modify the generated content at the end
		********************************************************************************************/
		$handle_full_content = Factory::load('Event')->trigger('core.after_view_creation', $handle_full_content);

		// return handle
		rewind($handle_full_content);
		return $handle_full_content;
	}
536046
public static function callMethod(
        string $name,
        ?object $object,
        array $arguments = [],
        ?string $classOverride = null
    ) {
        $method = self::getReflectionMethod($name, $object, $classOverride);
        $method->setAccessible(true);
        if (count($arguments) > 0) {
            return $method->invokeArgs($object, $arguments);
        }
        return $method->invoke($object);
    }
1262392
protected function getParamsClosure(\ReflectionMethod $constructor, array $class_rule): callable
    {
        $param_details = []; // Initialize parameter details.

        foreach ($constructor->getParameters() as $_parameter) {
            $_name = $_parameter->getName();

            $_class      = $_parameter->getClass();
            $_class_name = $_class->name ?? '';

            $_is_variadic       = $_parameter->isVariadic();
            $_has_default_value = $_parameter->isDefaultValueAvailable();
            $_default_value     = $_has_default_value ? $_parameter->getDefaultValue() : null;

            $param_details[] = [$_name, $_class_name, $_is_variadic, $_has_default_value, $_default_value];
        } // unset($_parameter, $_name, $_class, $_class_name, $_is_variadic, $_has_default_value, $_default_value);

        return function (array $args) use ($constructor, $param_details, $class_rule) {
            $parameters = []; // Initialize parameters.

            if ($class_rule['constructor_args']) { // Note: `$args` take precedence here.
                $args = array_merge($this->resolveJitClosures($class_rule['constructor_args']), $args);
            }
            foreach ($param_details as list($_name, $_class_name, $_is_variadic, $_has_default_value, $_default_value)) {
                if ($args && array_key_exists($_name, $args)) {
                    if ($_is_variadic && is_array($args[$_name])) {
                        $parameters = array_merge($parameters, $args[$_name]);
                    } else {
                        $parameters[] = $args[$_name];
                    }
                } elseif ($_class_name && !$_has_default_value) {
                    $parameters[] = $this->get($_class_name);
                } elseif ($_has_default_value) {
                    $parameters[] = $_default_value;
                } else {
                    throw new \Exception(sprintf('Missing `$%1$s` to `%2$s` constructor.', $_name, $constructor->class));
                }
            } // unset($_name, $_class_name, $_is_variadic, $_has_default_value, $_default_value);

            return $parameters; // With deep dependency injection.
        };
    }
120724
public static function GetClassVar ($name, $default_value = null) {
		if (is_array($name)) {
			return Arrays::GetLowest(static::$_ClassVariableTrait_Data, $name) ?: $default_value;
		}
		return isset(static::$_ClassVariableTrait_Data[$name]) ? static::$_ClassVariableTrait_Data[$name] : $default_value;
	}
884882
public static function extendsClass($class_name, $mother_name)
    {
        if (is_object($class_name)) {
            $class_name = get_class($class_name);
        }
        if (class_exists($class_name)) {
            return (bool) is_subclass_of($class_name, $mother_name);
        }
        return false;
    }
712220
public function fetchAll($fetch_style = null, $fetch_argument = 0, array $ctor_args = array()) {
		if (is_null($fetch_style)) {
			$fetch_style = $this->getAttribute(PDO::ATTR_DEFAULT_FETCH_MODE);
		}

		$result = array();
		switch($fetch_style) {
			case PDO::FETCH_ASSOC:
				$res = @oci_fetch_all($this->stmt, $result, 0, -1, OCI_FETCHSTATEMENT_BY_ROW + OCI_ASSOC + OCI_RETURN_NULLS);
				if ((($res > 0) || ($res !== false)) && !empty($this->_lobColumnsName)) {
					foreach ($result as &$row) {
						foreach ($this->_lobColumnsName as $key) {
							$row[$key] = $this->lobToStream($row[$key]);
						}
					}
				}
				break;
			case PDO::FETCH_NUM:
				$res = @oci_fetch_all($this->stmt, $result, 0, -1, OCI_FETCHSTATEMENT_BY_ROW + OCI_NUM + OCI_RETURN_NULLS);
				if ((($res > 0) || ($res !== false)) && !empty($this->_lobColumnsName)) {
					foreach ($result as &$row) {
						foreach ($this->_lobColumnsNum as $key) {
							$row[$key] = $this->lobToStream($row[$key]);
						}
					}
				}
				break;
			case PDO::FETCH_COLUMN:
				$arr = array();
				$res = @oci_fetch_all($this->stmt, $arr, 0, -1, OCI_FETCHSTATEMENT_BY_COLUMN + OCI_NUM + OCI_RETURN_NULLS);
				if ((($res > 0) || ($res !== false)) && !empty($this->_lobColumnsName)) {
					if (in_array($fetch_argument, $this->_lobColumnsNum)) {
						foreach ($arr as &$row) {
							$row[$fetch_argument] = $this->lobToStream($row[$fetch_argument]);
						}
					}
				}
				$result = $arr[$fetch_argument];
				break;
			case PDO::FETCH_OBJ:
				$res = true;
				while(false !== ($obj = $this->fetch($fetch_style))) {
					$result[] = $obj;
				}
				break;
			case PDO::FETCH_FUNC:
				$fetch_style = PDO::FETCH_NUM;
				if (is_callable($fetch_argument)) {
					$res = true;
					while(false !== ($row = $this->fetch($fetch_style))) {
						$result[] = call_user_func_array($fetch_argument, $row);
					}
				}
				else {
					throw new Exception(sprintf('$fetch_argument %s is not callable', $fetch_argument));
				}
				break;
			case PDO::FETCH_CLASS:
				$fetch_style = PDO::FETCH_OBJ;
				$res = true;
				while(false !== ($obj = $this->fetch($fetch_style))) {
					$result[] = $this->populateObject($obj, $fetch_argument, $ctor_args);
				}
				break;
			default:
				throw new Exception(sprintf('Fetch style %s is not implemented in fetchAll', $fetch_style));
		}

		// Check for error
		$this->checkError($res);

		$this->closeCursor();

		return $result;
	}
100086
public function getFirstDescendant($class_name)
    {
        if (!class_exists($class_name) && !interface_exists($class_name)) {
            return null;
        }

        $out = null;

        foreach ($this->action_items as $action_item) {
            if ($action_item instanceof $class_name) {
                $out = $action_item;
                break;
            }

            if ($action_item instanceof SwatUIParent) {
                $out = $action_item->getFirstDescendant($class_name);
                if ($out !== null) {
                    break;
                }
            }
        }

        return $out;
    }
842613
public function removeClass($class_name='')
    {
        $remove_names = \is_array($class_name) ? $class_name : explode(' ', $class_name);

        foreach ($this->nodes as $node) {
            if ($node instanceof \DOMElement && $node->hasAttribute('class')) {
                $node_classes = preg_split('#\s+#s', $node->getAttribute('class'));
                $class_removed = false;

                if ($class_name === '') { // remove all
                    $node_classes = array();
                    $class_removed = true;
                } else {
                    foreach ($remove_names as $remove_name) {
                        $key = array_search($remove_name, $node_classes, true);
                        if ($key !== false) {
                            unset($node_classes[$key]);
                            $class_removed = true;
                        }
                    }
                }
                if ($class_removed) {
                    $node->setAttribute('class', implode(' ', $node_classes));
                }
            }
        }

        return $this;
    }
957905
public function loadObjectList($class_name = "stdClass")
    {
        if ($this->stmt === null) {
            return null;
        }

        $objectList = array();
        while ($object = $this->stmt->fetchObject($class_name)) {
            $objectList[] = $object;
        }
        return $objectList;
    }
13650
protected static function _GetInstance ($class_name) {
		return (isset(static::$_instanceList[$class_name])) ? static::$_instanceList[$class_name] : static::$_instanceList[$class_name] = new static($class_name);
	}
1153809
public function getFirstDescendant($class_name)
    {
        if (!class_exists($class_name) && !interface_exists($class_name)) {
            return null;
        }

        $out = null;

        foreach ($this->pages as $page) {
            if ($page instanceof $class_name) {
                $out = $page;
                break;
            }

            if ($page instanceof SwatUIParent) {
                $out = $page->getFirstDescendant($class_name);
                if ($out !== null) {
                    break;
                }
            }
        }

        return $out;
    }
931679
public function getFirstDescendant($class_name)
    {
        if (!class_exists($class_name) && !interface_exists($class_name)) {
            return null;
        }

        $out = null;

        if ($this->widget instanceof $class_name) {
            $out = $this->widget;
        }

        if ($out === null && $this->widget instanceof SwatUIParent) {
            $out = $this->widget->getFirstDescendant($class_name);
        }

        return $out;
    }
258258
public function getMethodMutations(
        $method_name,
        Context $context
    ) {
        $project_analyzer = $this->getFileAnalyzer()->project_analyzer;
        $codebase = $project_analyzer->getCodebase();

        foreach ($this->class->stmts as $stmt) {
            if ($stmt instanceof PhpParser\Node\Stmt\ClassMethod &&
                strtolower($stmt->name->name) === strtolower($method_name)
            ) {
                $method_analyzer = new MethodAnalyzer($stmt, $this);

                $method_analyzer->analyze($context, null, true);
            } elseif ($stmt instanceof PhpParser\Node\Stmt\TraitUse) {
                foreach ($stmt->traits as $trait) {
                    $fq_trait_name = self::getFQCLNFromNameObject(
                        $trait,
                        $this->source->getAliases()
                    );

                    $trait_file_analyzer = $project_analyzer->getFileAnalyzerForClassLike($fq_trait_name);
                    $trait_node = $codebase->classlikes->getTraitNode($fq_trait_name);
                    $trait_aliases = $codebase->classlikes->getTraitAliases($fq_trait_name);
                    $trait_analyzer = new TraitAnalyzer(
                        $trait_node,
                        $trait_file_analyzer,
                        $fq_trait_name,
                        $trait_aliases
                    );

                    foreach ($trait_node->stmts as $trait_stmt) {
                        if ($trait_stmt instanceof PhpParser\Node\Stmt\ClassMethod &&
                            strtolower($trait_stmt->name->name) === strtolower($method_name)
                        ) {
                            $method_analyzer = new MethodAnalyzer($trait_stmt, $trait_analyzer);

                            $actual_method_id = (string)$method_analyzer->getMethodId();

                            if ($context->self && $context->self !== $this->fq_class_name) {
                                $analyzed_method_id = (string)$method_analyzer->getMethodId($context->self);
                                $declaring_method_id = $codebase->methods->getDeclaringMethodId($analyzed_method_id);

                                if ($actual_method_id !== $declaring_method_id) {
                                    break;
                                }
                            }

                            $method_analyzer->analyze($context, null, true);
                        }
                    }
                }
            }
        }
    }
932009
public function importsClass($class_name = NULL) {
    if ($this->useFunction || $this->useConst) {
      return FALSE;
    }
    if ($class_name) {
      foreach ($this->getDeclarations() as $declaration) {
        if ($declaration->getName()->getPath() === $class_name) {
          return TRUE;
        }
      }
      return FALSE;
    }
    else {
      return TRUE;
    }
  }
946483
protected function childrenByInstance($class_name) {
    $matches = [];
    $child = $this->head;
    while ($child) {
      if ($child instanceof $class_name) {
        $matches[] = $child;
      }
      $child = $child->next;
    }
    return $matches;
  }