Skip to content

Commit

Permalink
php-cs-fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Oct 25, 2015
1 parent 3f7b55a commit 1445eb0
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -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, HiQDev (https://hiqdev.com/)
@copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
EOF;

Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header);
Expand Down
2 changes: 1 addition & 1 deletion src/ActiveDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @link https://github.com/hiqdev/yii2-hiart
* @package yii2-hiart
* @license BSD-3-Clause
* @copyright Copyright (c) 2015, HiQDev (https://hiqdev.com/)
* @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
*/

namespace hiqdev\hiart;
Expand Down
8 changes: 4 additions & 4 deletions src/ActiveQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @link https://github.com/hiqdev/yii2-hiart
* @package yii2-hiart
* @license BSD-3-Clause
* @copyright Copyright (c) 2015, HiQDev (https://hiqdev.com/)
* @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
*/

namespace hiqdev\hiart;
Expand Down Expand Up @@ -103,10 +103,10 @@ public function createCommand($db = null)
/**
* Executes query and returns all results as an array.
*
* @param Connection $db the DB connection used to create the DB command.
* If null, the DB connection returned by [[modelClass]] will be used.
* @param Connection $db the DB connection used to create the DB command.
* If null, the DB connection returned by [[modelClass]] will be used.
* @param array $options Options that will be passed to search command
*
* @param array $options Options that will be passed to search command
* @return array the query results. If the query results in nothing, an empty array will be returned.
*/
public function all($db = null, $options = [])
Expand Down
2 changes: 1 addition & 1 deletion src/ActiveRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @link https://github.com/hiqdev/yii2-hiart
* @package yii2-hiart
* @license BSD-3-Clause
* @copyright Copyright (c) 2015, HiQDev (https://hiqdev.com/)
* @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
*/

namespace hiqdev\hiart;
Expand Down
2 changes: 1 addition & 1 deletion src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @link https://github.com/hiqdev/yii2-hiart
* @package yii2-hiart
* @license BSD-3-Clause
* @copyright Copyright (c) 2015, HiQDev (https://hiqdev.com/)
* @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
*/

namespace hiqdev\hiart;
Expand Down
2 changes: 1 addition & 1 deletion src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @link https://github.com/hiqdev/yii2-hiart
* @package yii2-hiart
* @license BSD-3-Clause
* @copyright Copyright (c) 2015, HiQDev (https://hiqdev.com/)
* @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
*/

namespace hiqdev\hiart;
Expand Down
2 changes: 1 addition & 1 deletion src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @link https://github.com/hiqdev/yii2-hiart
* @package yii2-hiart
* @license BSD-3-Clause
* @copyright Copyright (c) 2015, HiQDev (https://hiqdev.com/)
* @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
*/

namespace hiqdev\hiart;
Expand Down
2 changes: 1 addition & 1 deletion src/DebugAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @link https://github.com/hiqdev/yii2-hiart
* @package yii2-hiart
* @license BSD-3-Clause
* @copyright Copyright (c) 2015, HiQDev (https://hiqdev.com/)
* @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
*/

namespace hiqdev\hiart;
Expand Down
2 changes: 1 addition & 1 deletion src/DebugPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @link https://github.com/hiqdev/yii2-hiart
* @package yii2-hiart
* @license BSD-3-Clause
* @copyright Copyright (c) 2015, HiQDev (https://hiqdev.com/)
* @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
*/

namespace hiqdev\hiart;
Expand Down
2 changes: 1 addition & 1 deletion src/ErrorResponseException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @link https://github.com/hiqdev/yii2-hiart
* @package yii2-hiart
* @license BSD-3-Clause
* @copyright Copyright (c) 2015, HiQDev (https://hiqdev.com/)
* @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
*/

namespace hiqdev\hiart;
Expand Down
2 changes: 1 addition & 1 deletion src/HiArtException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @link https://github.com/hiqdev/yii2-hiart
* @package yii2-hiart
* @license BSD-3-Clause
* @copyright Copyright (c) 2015, HiQDev (https://hiqdev.com/)
* @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
*/

namespace hiqdev\hiart;
Expand Down
2 changes: 1 addition & 1 deletion src/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @link https://github.com/hiqdev/yii2-hiart
* @package yii2-hiart
* @license BSD-3-Clause
* @copyright Copyright (c) 2015, HiQDev (https://hiqdev.com/)
* @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
*/

namespace hiqdev\hiart;
Expand Down
27 changes: 13 additions & 14 deletions src/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @link https://github.com/hiqdev/yii2-hiart
* @package yii2-hiart
* @license BSD-3-Clause
* @copyright Copyright (c) 2015, HiQDev (https://hiqdev.com/)
* @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
*/

namespace hiqdev\hiart;
Expand All @@ -20,7 +20,7 @@
class QueryBuilder extends \yii\base\Object
{
private $_sort = [
SORT_ASC => '_asc',
SORT_ASC => '_asc',
SORT_DESC => '_desc',
];

Expand Down Expand Up @@ -57,22 +57,22 @@ public function build($query)

return [
'queryParts' => $parts,
'index' => $query->index,
'type' => $query->type,
'options' => $options,
'index' => $query->index,
'type' => $query->type,
'options' => $options,
];
}

public function buildCondition($condition)
{
static $builders = [
'and' => 'buildAndCondition',
'and' => 'buildAndCondition',
'between' => 'buildBetweenCondition',
'eq' => 'buildEqCondition',
'in' => 'buildInCondition',
'like' => 'buildLikeCondition',
'gt' => 'buildGreaterThenCondition',
'lt' => 'buildLessThanCondition',
'eq' => 'buildEqCondition',
'in' => 'buildInCondition',
'like' => 'buildLikeCondition',
'gt' => 'buildGreaterThenCondition',
'lt' => 'buildLessThanCondition',
];
if (empty($condition)) {
return [];
Expand Down Expand Up @@ -134,7 +134,6 @@ private function buildLessThanCondition($operator, $operands)
return [$operands[0] . '_lt' => $operands[1]];
}


private function buildAndCondition($operator, $operands)
{
$parts = [];
Expand All @@ -157,10 +156,10 @@ private function buildBetweenCondition($operator, $operands)

private function buildInCondition($operator, $operands)
{
$key = array_shift($operands);
$key = array_shift($operands);
$value = array_shift($operands);

return [$key . '_in' => (array)$value];
return [$key . '_in' => (array) $value];
}

private function buildEqCondition($operator, $operands)
Expand Down

0 comments on commit 1445eb0

Please sign in to comment.