From f0a9798925618871e7d91cd7512d18c25bfcfb79 Mon Sep 17 00:00:00 2001
From: Jaeger <JaegerCode@gmail.com>
Date: Fri, 3 Apr 2020 17:33:32 +0800
Subject: [PATCH] replace collect()

---
 src/Config.php       | 5 +++--
 src/Dom/Elements.php | 3 ++-
 src/Dom/Query.php    | 4 ++--
 src/Kernel.php       | 3 ++-
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/Config.php b/src/Config.php
index 5a59ad1..c3b59ed 100644
--- a/src/Config.php
+++ b/src/Config.php
@@ -7,6 +7,7 @@
 
 namespace QL;
 use Closure;
+use Tightenco\Collect\Support\Collection;
 
 class Config
 {
@@ -20,8 +21,8 @@ class Config
      */
     public function __construct()
     {
-        $this->plugins = collect();
-        $this->binds = collect();
+        $this->plugins = new Collection();
+        $this->binds = new Collection();
     }
 
 
diff --git a/src/Dom/Elements.php b/src/Dom/Elements.php
index 245121f..b207b56 100644
--- a/src/Dom/Elements.php
+++ b/src/Dom/Elements.php
@@ -9,6 +9,7 @@ namespace QL\Dom;
 
 use phpDocumentor\Reflection\Types\Null_;
 use phpQueryObject;
+use Tightenco\Collect\Support\Collection;
 
 /**
  * Class Elements
@@ -191,7 +192,7 @@ class Elements
      */
     public function map($callback)
     {
-        $collection = collect();
+        $collection = new Collection();
         $this->elements->each(function ($dom) use (& $collection, $callback) {
             $collection->push($callback(new self(pq($dom))));
         });
diff --git a/src/Dom/Query.php b/src/Dom/Query.php
index 16635ad..1d346b8 100644
--- a/src/Dom/Query.php
+++ b/src/Dom/Query.php
@@ -147,7 +147,7 @@ class Query
     {
         if (is_callable($callback)) {
             if (empty($this->range)) {
-                $data = collect($callback($data->all(), null));
+                $data = new Collection($callback($data->all(), null));
             } else {
                 $data = $data->map($callback);
             }
@@ -178,7 +178,7 @@ class Query
             }
         }
 
-        return collect($data);
+        return new Collection($data);
     }
 
     protected function extractContent(phpQueryObject $pqObj, $ruleName, $rule)
diff --git a/src/Kernel.php b/src/Kernel.php
index a7e1c38..d8a3a8c 100644
--- a/src/Kernel.php
+++ b/src/Kernel.php
@@ -14,6 +14,7 @@ use Closure;
 use QL\Providers\HttpServiceProvider;
 use QL\Providers\PluginServiceProvider;
 use QL\Providers\SystemServiceProvider;
+use Tightenco\Collect\Support\Collection;
 
 class Kernel
 {
@@ -34,7 +35,7 @@ class Kernel
     public function __construct(QueryList $ql)
     {
         $this->ql = $ql;
-        $this->binds = collect();
+        $this->binds = new Collection();
     }
 
     public function bootstrap()