From c98628d42eb1a4edc507847068d235ee5496e5a6 Mon Sep 17 00:00:00 2001 From: resurtm Date: Sat, 11 May 2013 16:09:40 +0600 Subject: [PATCH] CS fixes. --- yii/base/Controller.php | 2 +- yii/base/Dictionary.php | 2 +- yii/base/Model.php | 16 ++++++++-------- yii/base/Vector.php | 2 +- yii/base/View.php | 2 +- yii/caching/DbDependency.php | 4 ++-- yii/caching/MemCache.php | 20 ++++++++++---------- yii/console/controllers/AppController.php | 4 ++-- yii/db/ActiveRecord.php | 10 +++++----- yii/db/Command.php | 14 +++++++------- yii/db/Connection.php | 2 +- yii/db/Migration.php | 11 ++++++----- yii/db/Query.php | 26 +++++++++++++------------- yii/db/QueryBuilder.php | 10 +++++----- yii/rbac/Manager.php | 12 ++++++------ yii/web/Pagination.php | 2 +- yii/web/UrlRule.php | 2 +- yii/widgets/ContentDecorator.php | 2 +- 18 files changed, 72 insertions(+), 71 deletions(-) diff --git a/yii/base/Controller.php b/yii/base/Controller.php index 1a92a46..6b6c926 100644 --- a/yii/base/Controller.php +++ b/yii/base/Controller.php @@ -278,7 +278,7 @@ class Controller extends Component * Child classes may override this method to throw exceptions when there are missing and/or unknown parameters. * @param Action $action the currently requested action * @param array $missingParams the names of the missing parameters - * @param array $unknownParams the unknown parameters (name=>value) + * @param array $unknownParams the unknown parameters (name => value) */ public function validateActionParams($action, $missingParams, $unknownParams) { diff --git a/yii/base/Dictionary.php b/yii/base/Dictionary.php index 5807d93..0a4741e 100644 --- a/yii/base/Dictionary.php +++ b/yii/base/Dictionary.php @@ -24,7 +24,7 @@ use yii\helpers\ArrayHelper; * $dictionary[$key] = $value; // add a key-value pair * unset($dictionary[$key]); // remove the value with the specified key * if (isset($dictionary[$key])) // if the dictionary contains the key - * foreach ($dictionary as $key=>$value) // traverse the items in the dictionary + * foreach ($dictionary as $key => $value) // traverse the items in the dictionary * $n = count($dictionary); // returns the number of items in the dictionary * ~~~ * diff --git a/yii/base/Model.php b/yii/base/Model.php index 7f55239..8348d97 100644 --- a/yii/base/Model.php +++ b/yii/base/Model.php @@ -33,7 +33,7 @@ use yii\validators\Validator; * @property Vector $validators All the validators declared in the model. * @property array $activeValidators The validators applicable to the current [[scenario]]. * @property array $errors Errors for all attributes or the specified attribute. Empty array is returned if no error. - * @property array $attributes Attribute values (name=>value). + * @property array $attributes Attribute values (name => value). * @property string $scenario The scenario that this model is in. * * @author Qiang Xue @@ -76,7 +76,7 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess * array( * 'attribute list', * 'validator type', - * 'on'=>'scenario name', + * 'on' => 'scenario name', * ...other parameters... * ) * ~~~ @@ -109,11 +109,11 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess * // built-in "required" validator * array('username', 'required'), * // built-in "length" validator customized with "min" and "max" properties - * array('username', 'length', 'min'=>3, 'max'=>12), + * array('username', 'length', 'min' => 3, 'max' => 12), * // built-in "compare" validator that is used in "register" scenario only - * array('password', 'compare', 'compareAttribute'=>'password2', 'on'=>'register'), + * array('password', 'compare', 'compareAttribute' => 'password2', 'on' => 'register'), * // an inline validator defined via the "authenticate()" method in the model class - * array('password', 'authenticate', 'on'=>'login'), + * array('password', 'authenticate', 'on' => 'login'), * // a validator of class "CaptchaValidator" * array('captcha', 'CaptchaValidator'), * ); @@ -220,7 +220,7 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess * Note, in order to inherit labels defined in the parent class, a child class needs to * merge the parent labels with child labels using functions such as `array_merge()`. * - * @return array attribute labels (name=>label) + * @return array attribute labels (name => label) * @see generateAttributeLabel */ public function attributeLabels() @@ -511,7 +511,7 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess * Defaults to null, meaning all attributes listed in [[attributes()]] will be returned. * If it is an array, only the attributes in the array will be returned. * @param array $except list of attributes whose value should NOT be returned. - * @return array attribute values (name=>value). + * @return array attribute values (name => value). */ public function getAttributes($names = null, $except = array()) { @@ -531,7 +531,7 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess /** * Sets the attribute values in a massive way. - * @param array $values attribute values (name=>value) to be assigned to the model. + * @param array $values attribute values (name => value) to be assigned to the model. * @param boolean $safeOnly whether the assignments should only be done to the safe attributes. * A safe attribute is one that is associated with a validation rule in the current [[scenario]]. * @see safeAttributes() diff --git a/yii/base/Vector.php b/yii/base/Vector.php index 6418077..ae35cca 100644 --- a/yii/base/Vector.php +++ b/yii/base/Vector.php @@ -24,7 +24,7 @@ namespace yii\base; * $vector[$index] = $item; // set new item at $index * unset($vector[$index]); // remove the item at $index * if (isset($vector[$index])) // if the vector has an item at $index - * foreach ($vector as $index=>$item) // traverse each item in the vector + * foreach ($vector as $index => $item) // traverse each item in the vector * $n = count($vector); // count the number of items * ~~~ * diff --git a/yii/base/View.php b/yii/base/View.php index b71e605..f1a9a0f 100644 --- a/yii/base/View.php +++ b/yii/base/View.php @@ -475,7 +475,7 @@ class View extends Component * * @param string $viewFile the view file that will be used to decorate the content enclosed by this widget. * This can be specified as either the view file path or path alias. - * @param array $params the variables (name=>value) to be extracted and made available in the decorative view. + * @param array $params the variables (name => value) to be extracted and made available in the decorative view. * @return \yii\widgets\ContentDecorator the ContentDecorator widget instance * @see \yii\widgets\ContentDecorator */ diff --git a/yii/caching/DbDependency.php b/yii/caching/DbDependency.php index 7d45223..fd92aea 100644 --- a/yii/caching/DbDependency.php +++ b/yii/caching/DbDependency.php @@ -32,14 +32,14 @@ class DbDependency extends Dependency */ public $sql; /** - * @var array the parameters (name=>value) to be bound to the SQL statement specified by [[sql]]. + * @var array the parameters (name => value) to be bound to the SQL statement specified by [[sql]]. */ public $params; /** * Constructor. * @param string $sql the SQL query whose result is used to determine if the dependency has been changed. - * @param array $params the parameters (name=>value) to be bound to the SQL statement specified by [[sql]]. + * @param array $params the parameters (name => value) to be bound to the SQL statement specified by [[sql]]. * @param array $config name-value pairs that will be used to initialize the object properties */ public function __construct($sql, $params = array(), $config = array()) diff --git a/yii/caching/MemCache.php b/yii/caching/MemCache.php index 20aff21..e6b9b53 100644 --- a/yii/caching/MemCache.php +++ b/yii/caching/MemCache.php @@ -30,19 +30,19 @@ use yii\base\InvalidConfigException; * * ~~~ * array( - * 'components'=>array( - * 'cache'=>array( - * 'class'=>'MemCache', - * 'servers'=>array( + * 'components' => array( + * 'cache' => array( + * 'class' => 'MemCache', + * 'servers' => array( * array( - * 'host'=>'server1', - * 'port'=>11211, - * 'weight'=>60, + * 'host' => 'server1', + * 'port' => 11211, + * 'weight' => 60, * ), * array( - * 'host'=>'server2', - * 'port'=>11211, - * 'weight'=>40, + * 'host' => 'server2', + * 'port' => 11211, + * 'weight' => 40, * ), * ), * ), diff --git a/yii/console/controllers/AppController.php b/yii/console/controllers/AppController.php index 95e6e5b..6baf019 100644 --- a/yii/console/controllers/AppController.php +++ b/yii/console/controllers/AppController.php @@ -204,7 +204,7 @@ class AppController extends Controller /** * Copies a list of files from one place to another. - * @param array $fileList the list of files to be copied (name=>spec). + * @param array $fileList the list of files to be copied (name => spec). * The array keys are names displayed during the copy process, and array values are specifications * for files to be copied. Each array value must be an array of the following structure: *