query = new Query($this); $this->kernel = (new Kernel($this))->bootstrap(); Config::getInstance()->bootstrap($this); } public function __call($name, $arguments) { if(method_exists($this->query,$name)){ $result = $this->query->$name(...$arguments); }else{ $result = $this->kernel->getService($name)->call($this,...$arguments); } return $result; } public static function __callStatic($name, $arguments) { $instance = new self(); return $instance->$name(...$arguments); } public function __destruct() { $this->destruct(); } /** * Get the QueryList single instance * * @return QueryList */ public static function getInstance() { self::$instance || self::$instance = new self(); return self::$instance; } /** * Get the Config instance * @return null|Config */ public static function config() { return Config::getInstance(); } /** * Destruction of resources */ public function destruct() { phpQuery::$documents = []; } /** * Bind a custom method to the QueryList object * * @param string $name Invoking the name * @param Closure $provide Called method * @return $this */ public function bind(string $name,Closure $provide) { $this->kernel->bind($name,$provide); return $this; } }