Skip to content

Commit

Permalink
improved PHPdoc and @since annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
cebe committed Jul 11, 2016
1 parent 7076b38 commit 217d50e
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions framework/behaviors/AttributeBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
* }
* ```
*
* Because attribute values will be set automatically, it's a good idea to make sure attribute names aren't
* in `rules()` method of the model.
* Because attribute values will be set automatically by this behavior, they are usually not user input and should therefore
* not be validated, i.e. they should not appear in the [[\yii\base\Model::rules()|rules()]] method of the model.
*
* @author Luciano Baraglia <[email protected]>
* @author Qiang Xue <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions framework/behaviors/BlameableBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
* when the associated AR object is being inserted; it will fill the `updated_by` attribute
* with the current user ID when the AR object is being updated.
*
* Because attribute values will be set automatically, it's a good idea to make sure `created_by` and `updated_by` aren't
* in `rules()` method of the model.
* Because attribute values will be set automatically by this behavior, they are usually not user input and should therefore
* not be validated, i.e. `created_by` and `updated_by` should not appear in the [[\yii\base\Model::rules()|rules()]] method of the model.
*
* If your attribute names are different, you may configure the [[createdByAttribute]] and [[updatedByAttribute]]
* properties like the following:
Expand Down
4 changes: 2 additions & 2 deletions framework/behaviors/SluggableBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
* By default, SluggableBehavior will fill the `slug` attribute with a value that can be used a slug in a URL
* when the associated AR object is being validated.
*
* Because attribute value will be set automatically, it's a good idea to make sure `slug` isn't
* in `rules()` method of the model.
* Because attribute values will be set automatically by this behavior, they are usually not user input and should therefore
* not be validated, i.e. the `slug` attribute should not appear in the [[\yii\base\Model::rules()|rules()]] method of the model.
*
* If your attribute name is different, you may configure the [[slugAttribute]] property like the following:
*
Expand Down
4 changes: 2 additions & 2 deletions framework/behaviors/TimestampBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
* when the associated AR object is being inserted; it will fill the `updated_at` attribute
* with the timestamp when the AR object is being updated. The timestamp value is obtained by `time()`.
*
* Because attribute values will be set automatically, it's a good idea to make sure `created_at` and `updated_at` aren't
* in `rules()` method of the model.
* Because attribute values will be set automatically by this behavior, they are usually not user input and should therefore
* not be validated, i.e. `created_at` and `updated_at` should not appear in the [[\yii\base\Model::rules()|rules()]] method of the model.
*
* For the above implementation to work with MySQL database, please declare the columns(`created_at`, `updated_at`) as int(11) for being UNIX timestamp.
*
Expand Down
1 change: 1 addition & 0 deletions framework/data/ArrayDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class ArrayDataProvider extends BaseDataProvider
*/
public $modelClass;


/**
* @inheritdoc
*/
Expand Down
1 change: 1 addition & 0 deletions framework/db/ActiveRelationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public function findFor($name, $model)
/**
* If applicable, populate the query's primary model into the related records' inverse relationship
* @param array $result the array of related records as generated by [[populate()]]
* @since 2.0.9
*/
private function addInverseRelations(&$result)
{
Expand Down
1 change: 1 addition & 0 deletions framework/grid/CheckboxColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class CheckboxColumn extends Column
public $multiple = true;
/**
* @var string the css class that will be used to find the checkboxes.
* @since 2.0.9
*/
public $cssClass;

Expand Down
5 changes: 5 additions & 0 deletions framework/log/Target.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,17 @@ abstract class Target extends Component
/**
* @var array list of the PHP predefined variables that should be logged in a message.
* Note that a variable must be accessible via `$GLOBALS`. Otherwise it won't be logged.
*
* Defaults to `['_GET', '_POST', '_FILES', '_COOKIE', '_SESSION', '_SERVER']`.
*
* Since version 2.0.9 additional syntax can be used:
* Each element could be specified as one of the following:
*
* - `var` - `var` will be logged.
* - `var.key` - only `var[key]` key will be logged.
* - `!var.key` - `var[key]` key will be excluded.
*
* @see \yii\helpers\ArrayHelper::filter()
*/
public $logVars = ['_GET', '_POST', '_FILES', '_COOKIE', '_SESSION', '_SERVER'];
/**
Expand Down
2 changes: 1 addition & 1 deletion framework/web/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ public function init()
parent::init();
register_shutdown_function([$this, 'close']);
if ($this->getIsActive()) {
$this->updateFlashCounters();
Yii::warning("Session is already started", __METHOD__);
$this->updateFlashCounters();
}
}

Expand Down

0 comments on commit 217d50e

Please sign in to comment.