From e6916d2179813e0dc3f01a7688e0dc9cd52bfa68 Mon Sep 17 00:00:00 2001 From: Andrii Vasyliev Date: Sun, 22 Jan 2017 08:13:16 +0200 Subject: [PATCH] csfixed --- .php_cs | 2 +- src/AbstractConnection.php | 9 ++++----- src/AbstractQueryBuilder.php | 2 +- src/AbstractRequest.php | 4 ++-- src/AbstractResponse.php | 2 +- src/ActiveDataProvider.php | 2 +- src/ActiveQuery.php | 6 ++---- src/ActiveRecord.php | 2 +- src/Collection.php | 4 ++-- src/Command.php | 2 +- src/ErrorResponseException.php | 2 +- src/Exception.php | 2 +- src/ProxyRequest.php | 4 ++-- src/Query.php | 9 +++------ src/QueryBuilderInterface.php | 8 ++------ src/config/hisite.php | 2 +- src/curl/Request.php | 8 ++++++++ src/curl/Response.php | 8 ++++++++ src/debug/DebugAction.php | 3 +-- src/debug/DebugPanel.php | 4 ++-- src/debug/Timing.php | 4 ++-- src/rest/Connection.php | 8 ++++++++ src/rest/QueryBuilder.php | 9 ++++++++- src/views/debug/detail.php | 2 +- tests/Mock.php | 2 +- tests/_bootstrap.php | 2 +- tests/unit/CommandTest.php | 2 +- tests/unit/ConnectionTest.php | 2 +- 28 files changed, 68 insertions(+), 48 deletions(-) diff --git a/.php_cs b/.php_cs index da57fc2..bc8b025 100644 --- a/.php_cs +++ b/.php_cs @@ -6,7 +6,7 @@ Tools to use API as ActiveRecord for Yii2 @link https://github.com/hiqdev/yii2-hiart @package yii2-hiart @license BSD-3-Clause -@copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) +@copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) EOF; return PhpCsFixer\Config::create() diff --git a/src/AbstractConnection.php b/src/AbstractConnection.php index 41c5a7d..655049a 100644 --- a/src/AbstractConnection.php +++ b/src/AbstractConnection.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart; @@ -19,14 +19,13 @@ /** * Abstract connection class. - * */ abstract class AbstractConnection extends Component { const EVENT_AFTER_OPEN = 'afterOpen'; /** - * @var string to be specified in concrete implementation. + * @var string to be specified in concrete implementation */ public $queryBuilderClass; @@ -46,7 +45,7 @@ abstract class AbstractConnection extends Component public $config = []; /** - * @var object request handler common for all requests of this connection. + * @var object request handler common for all requests of this connection */ protected $_handler; @@ -154,7 +153,7 @@ public function createCommand(array $config = []) } /** - * @return QueryBuilder the query builder for this connection. + * @return QueryBuilder the query builder for this connection */ public function getQueryBuilder() { diff --git a/src/AbstractQueryBuilder.php b/src/AbstractQueryBuilder.php index 7f2f795..b651f9f 100644 --- a/src/AbstractQueryBuilder.php +++ b/src/AbstractQueryBuilder.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart; diff --git a/src/AbstractRequest.php b/src/AbstractRequest.php index 57cc4ae..949f658 100644 --- a/src/AbstractRequest.php +++ b/src/AbstractRequest.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart; @@ -13,7 +13,7 @@ abstract class AbstractRequest implements \Serializable { /** - * @var string response implementation to be specified in concrete implementation. + * @var string response implementation to be specified in concrete implementation */ protected $responseClass; diff --git a/src/AbstractResponse.php b/src/AbstractResponse.php index 8b824f0..29645a2 100644 --- a/src/AbstractResponse.php +++ b/src/AbstractResponse.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart; diff --git a/src/ActiveDataProvider.php b/src/ActiveDataProvider.php index 16af7ad..5b5e0af 100644 --- a/src/ActiveDataProvider.php +++ b/src/ActiveDataProvider.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart; diff --git a/src/ActiveQuery.php b/src/ActiveQuery.php index a672a29..4c1000c 100644 --- a/src/ActiveQuery.php +++ b/src/ActiveQuery.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart; @@ -13,7 +13,6 @@ use yii\db\ActiveQueryInterface; use yii\db\ActiveQueryTrait; use yii\db\ActiveRelationTrait; -use yii\helpers\ArrayHelper; class ActiveQuery extends Query implements ActiveQueryInterface { @@ -207,7 +206,7 @@ private function joinWithRelation($parent, $child) } } - public function select($columns, $option = NULL) + public function select($columns, $option = null) { $this->select = $columns; @@ -385,5 +384,4 @@ private function addInverseRelation($relatedModel) $inverseRelation = $relatedModel->getRelation($this->inverseOf); $relatedModel->populateRelation($this->inverseOf, $inverseRelation->multiple ? [$this->primaryModel] : $this->primaryModel); } - } diff --git a/src/ActiveRecord.php b/src/ActiveRecord.php index e660898..580f474 100644 --- a/src/ActiveRecord.php +++ b/src/ActiveRecord.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart; diff --git a/src/Collection.php b/src/Collection.php index c7b25d9..cde5f0a 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart; @@ -195,7 +195,7 @@ public function updateFormName() * } * 3) foreach ($selection as $id) { * $res[$id] = [reset($model->primaryKey()) => $id]; - * } + * }. * @param array|callable $data - the data to be proceeded. * If is callable - gets arguments: * - model diff --git a/src/Command.php b/src/Command.php index 51e7932..84d5394 100644 --- a/src/Command.php +++ b/src/Command.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart; diff --git a/src/ErrorResponseException.php b/src/ErrorResponseException.php index c5bcb48..2c9be99 100644 --- a/src/ErrorResponseException.php +++ b/src/ErrorResponseException.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart; diff --git a/src/Exception.php b/src/Exception.php index 47ed54c..a78f839 100644 --- a/src/Exception.php +++ b/src/Exception.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart; diff --git a/src/ProxyRequest.php b/src/ProxyRequest.php index 5e38880..c577995 100644 --- a/src/ProxyRequest.php +++ b/src/ProxyRequest.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart; @@ -18,7 +18,7 @@ abstract class ProxyRequest extends AbstractRequest protected $worker; /** - * @var string transport implementation to be specified in concrete implementation. + * @var string transport implementation to be specified in concrete implementation */ public $handlerClass; diff --git a/src/Query.php b/src/Query.php index 4a03f02..bb1b2ba 100644 --- a/src/Query.php +++ b/src/Query.php @@ -5,15 +5,12 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart; -use Yii; -use yii\base\Component; use yii\db\QueryInterface; -use yii\helpers\ArrayHelper; /** * Query represents API query in a way that is independent from a concrete API. @@ -32,7 +29,7 @@ * - from: entity being queried, e.g. user * - join: data how to join with other entities * - other standard query options provided with QueryTrait: - * - where, limit, offset, orderBy, indexBy + * - where, limit, offset, orderBy, indexBy. */ class Query extends \yii\db\Query implements QueryInterface { @@ -52,7 +49,7 @@ class Query extends \yii\db\Query implements QueryInterface public static function instantiate($action, $from, array $options = []) { - $query = new static; + $query = new static(); return $query->action($action)->from($from)->options($options); } diff --git a/src/QueryBuilderInterface.php b/src/QueryBuilderInterface.php index f51fe10..47b5ba2 100644 --- a/src/QueryBuilderInterface.php +++ b/src/QueryBuilderInterface.php @@ -5,15 +5,11 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart; -use yii\base\InvalidParamException; -use yii\base\NotSupportedException; -use yii\helpers\ArrayHelper; - /** * QueryBuilder interface. * @@ -31,7 +27,7 @@ public function buildHeaders(Query $query); /** * Builds transport protocol version. - * @param Query $query + * @param Query $query * @return string */ public function buildProtocolVersion(Query $query); diff --git a/src/config/hisite.php b/src/config/hisite.php index d088ab9..8749be5 100644 --- a/src/config/hisite.php +++ b/src/config/hisite.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ return [ diff --git a/src/curl/Request.php b/src/curl/Request.php index ea58e20..404ea6c 100644 --- a/src/curl/Request.php +++ b/src/curl/Request.php @@ -1,4 +1,12 @@ getBaseUri() . '/'. $this->request->getUri(); + return $this->getBaseUri() . '/' . $this->request->getUri(); } public function getBaseUri() diff --git a/src/rest/Connection.php b/src/rest/Connection.php index 90f9816..fb86529 100644 --- a/src/rest/Connection.php +++ b/src/rest/Connection.php @@ -1,4 +1,12 @@ registerCss(<<registerCss(<<<'CSS' .string { color: green; } .number { color: darkorange; } .boolean { color: blue; } diff --git a/tests/Mock.php b/tests/Mock.php index 5b31c86..be03def 100644 --- a/tests/Mock.php +++ b/tests/Mock.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart\tests; diff --git a/tests/_bootstrap.php b/tests/_bootstrap.php index 25e8a29..9ec37f2 100644 --- a/tests/_bootstrap.php +++ b/tests/_bootstrap.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ error_reporting(E_ALL & ~E_NOTICE); diff --git a/tests/unit/CommandTest.php b/tests/unit/CommandTest.php index c612716..c4807c3 100644 --- a/tests/unit/CommandTest.php +++ b/tests/unit/CommandTest.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart\tests\unit; diff --git a/tests/unit/ConnectionTest.php b/tests/unit/ConnectionTest.php index 1208546..36e23f9 100644 --- a/tests/unit/ConnectionTest.php +++ b/tests/unit/ConnectionTest.php @@ -5,7 +5,7 @@ * @link https://github.com/hiqdev/yii2-hiart * @package yii2-hiart * @license BSD-3-Clause - * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) + * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ namespace hiqdev\hiart\tests\unit;