From 006e24a1179a9c1095d4d4c0f93d65ca349e47b8 Mon Sep 17 00:00:00 2001 From: Jaeger Date: Mon, 25 Sep 2017 14:15:26 +0800 Subject: [PATCH] fix bug --- src/Dom/Query.php | 4 ++-- src/Providers/SystemServiceProvider.php | 3 --- src/QueryList.php | 11 +++++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Dom/Query.php b/src/Dom/Query.php index dbe914c..2a75110 100644 --- a/src/Dom/Query.php +++ b/src/Dom/Query.php @@ -48,7 +48,7 @@ class Query return is_null($callback) ? $this->data : $this->data->map($callback); } - protected function setData(Collection $data) + public function setData(Collection $data) { $this->data = $data; } @@ -83,7 +83,7 @@ class Query { $this->data = $this->getList(); $callback && $this->data = $this->data->map($callback); - return $this; + return $this->ql; } protected function getList() diff --git a/src/Providers/SystemServiceProvider.php b/src/Providers/SystemServiceProvider.php index 6f3e32d..dab8e7d 100644 --- a/src/Providers/SystemServiceProvider.php +++ b/src/Providers/SystemServiceProvider.php @@ -19,8 +19,5 @@ class SystemServiceProvider implements ServiceProviderContract return $this; }); - $kernel->bind('global',function (){ - - }); } } \ No newline at end of file diff --git a/src/QueryList.php b/src/QueryList.php index 2504d83..cc24529 100644 --- a/src/QueryList.php +++ b/src/QueryList.php @@ -15,20 +15,22 @@ namespace QL; use phpQuery; use QL\Dom\Query; use Illuminate\Support\Collection; +use Closure; /** * Class QueryList * @package QL * - * @method QueryList getHtml() + * @method string getHtml() * @method QueryList setHtml($html) * @method QueryList html($html) * @method Dom\Elements find($selector) * @method QueryList rules(array $rules) * @method QueryList range($range) * @method QueryList removeHead() - * @method QueryList query($callback = null) - * @method Collection getData($callback = null) + * @method QueryList query(Closure $callback = null) + * @method Collection getData(Closure $callback = null) + * @method QueryList setData(Collection $data) * @method QueryList encoding(string $outputEncoding,string $inputEncoding = null) * @method QueryList get($url,$args = null,$otherArgs = []) * @method QueryList post($url,$args = null,$otherArgs = []) @@ -87,9 +89,10 @@ class QueryList phpQuery::$documents = []; } - public function bind(string $name,\Closure $provide) + public function bind(string $name,Closure $provide) { $this->kernel->bind($name,$provide); + return $this; } } \ No newline at end of file