Skip to content

Commit

Permalink
php-cs-fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Dec 30, 2015
1 parent fb9b595 commit e80518e
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 17 deletions.
14 changes: 12 additions & 2 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,24 @@ EOF;
Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header);

return Symfony\CS\Config\Config::create()
->setUsingCache(true)
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
->fixers([
'-long_array_syntax', /// Arrays should use the long syntax.
'-php4_constructor', /// Convert PHP4-style constructors to __construct. Warning! This could change code behavior.
'-phpdoc_var_to_type', /// @var should always be written as @type.
'-align_double_arrow', /// Align double arrow symbols in consecutive lines.
'-unalign_double_arrow', /// Unalign double arrow symbols in consecutive lines.
'-align_equals', /// Align equals symbols in consecutive lines.
'-unalign_equals', /// Unalign equals symbols in consecutive lines.
'-blankline_after_open_tag', /// Ensure there is no code on the same line as the PHP open tag and it is followed by a blankline.
'-phpdoc_no_empty_return', /// @return void and @return null annotations should be omitted from phpdocs.
'-empty_return', /// A return statement wishing to return nothing should be simply "return".
'-return', /// An empty line feed should precede a return statement.
'-phpdoc_params', /// All items of the @param, @throws, @return, @var, and @type phpdoc tags must be aligned vertically.
'-phpdoc_scalar', /// Scalar types should always be written in the same form. "int", not "integer"; "bool", not "boolean".
'-phpdoc_separation', /// Annotations of a different type are separated by a single blank line.
'header_comment', /// Add, replace or remove header comment.
'align_double_arrow', /// Align double arrow symbols in consecutive lines.
'align_equals', /// Align equals symbols in consecutive lines.
'concat_with_spaces', /// Concatenation should be used with at least one whitespace around.
'ereg_to_preg', /// Replace deprecated ereg regular expression functions with preg. Warning! This could change code behavior.
'multiline_spaces_before_semicolon', /// Multi-line whitespace before closing semicolon are prohibited.
Expand Down
2 changes: 1 addition & 1 deletion src/ActiveQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function prepare()

public function joinWith($with)
{
$this->joinWith[] = [(array)$with, true];
$this->joinWith[] = [(array) $with, true];

return $this;
}
Expand Down
2 changes: 0 additions & 2 deletions src/ActiveRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,4 @@ public function hasMany($class, $link)
{
return parent::hasMany($class, $link);
}


}
5 changes: 3 additions & 2 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/**
* Class Collection manages the collection of the models.
*
* @var Model[] $models the array of models in the collection
* @var Model[] the array of models in the collection
*/
class Collection extends Component
{
Expand Down Expand Up @@ -140,7 +140,8 @@ public function getIds()
/**
* @return Model[] models
*/
public function getModels() {
public function getModels()
{
return $this->models;
}

Expand Down
1 change: 0 additions & 1 deletion src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use yii\base\Component;
use yii\base\InvalidConfigException;
use yii\base\InvalidParamException;
use yii\helpers\ArrayHelper;
use yii\helpers\Json;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function build($query)
public function buildLimit($limit, &$parts)
{
if (!empty($limit)) {
if ($limit == -1) {
if ($limit === -1) {
$limit = 'ALL';
}
$parts['limit'] = $limit;
Expand Down
12 changes: 11 additions & 1 deletion tests/Mock.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
<?php

/*
* 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 (http://hiqdev.com/)
*/

namespace hiqdev\hiart\tests;

class Mock {
class Mock
{
public $name;
public $args;
public $result;
Expand Down
6 changes: 3 additions & 3 deletions tests/_bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/*
* README plugin for HiDev
* Tools to use API as ActiveRecord for Yii2
*
* @link https://github.com/hiqdev/hidev-readme
* @package hidev-readme
* @link https://github.com/hiqdev/yii2-hiart
* @package yii2-hiart
* @license BSD-3-Clause
* @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
*/
Expand Down
7 changes: 3 additions & 4 deletions tests/unit/CommandTest.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<?php

/*
* README plugin for HiDev
* Tools to use API as ActiveRecord for Yii2
*
* @link https://github.com/hiqdev/hidev-readme
* @package hidev-readme
* @link https://github.com/hiqdev/yii2-hiart
* @package yii2-hiart
* @license BSD-3-Clause
* @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
*/

namespace hiqdev\hiart\tests\unit;

use hiqdev\hiart\Command;
use hiqdev\hiart\Connection;
use hiqdev\hiart\tests\Mock;
use Yii;

Expand Down

0 comments on commit e80518e

Please sign in to comment.