Commit 02622b6f by Alexander Makarov

phpdoc fixes and additions

parent 715b4475
...@@ -601,6 +601,7 @@ EOD; ...@@ -601,6 +601,7 @@ EOD;
/** /**
* Creates template of configuration file for [[actionCompress]]. * Creates template of configuration file for [[actionCompress]].
* @param string $configFile output file name. * @param string $configFile output file name.
* @return int CLI exit code
* @throws \yii\console\Exception on failure. * @throws \yii\console\Exception on failure.
*/ */
public function actionTemplate($configFile) public function actionTemplate($configFile)
......
...@@ -302,6 +302,7 @@ abstract class BaseMigrateController extends Controller ...@@ -302,6 +302,7 @@ abstract class BaseMigrateController extends Controller
* *
* @param string $version the version at which the migration history should be marked. * @param string $version the version at which the migration history should be marked.
* This can be either the timestamp or the full name of the migration. * This can be either the timestamp or the full name of the migration.
* @return int CLI exit code
* @throws Exception if the version argument is invalid or the version cannot be found. * @throws Exception if the version argument is invalid or the version cannot be found.
*/ */
public function actionMark($version) public function actionMark($version)
...@@ -561,6 +562,7 @@ abstract class BaseMigrateController extends Controller ...@@ -561,6 +562,7 @@ abstract class BaseMigrateController extends Controller
/** /**
* Migrates to the certain version. * Migrates to the certain version.
* @param string $version name in the full format. * @param string $version name in the full format.
* @return int CLI exit code
* @throws Exception if the provided version cannot be found. * @throws Exception if the provided version cannot be found.
*/ */
protected function migrateToVersion($version) protected function migrateToVersion($version)
......
...@@ -234,6 +234,8 @@ class FixtureController extends Controller ...@@ -234,6 +234,8 @@ class FixtureController extends Controller
/** /**
* Notifies user that there are no fixtures to load according input conditions * Notifies user that there are no fixtures to load according input conditions
* @param array $foundFixtures array of found fixtures
* @param array $except array of names of fixtures that should not be loaded
*/ */
public function notifyNothingToLoad($foundFixtures, $except) public function notifyNothingToLoad($foundFixtures, $except)
{ {
...@@ -254,6 +256,8 @@ class FixtureController extends Controller ...@@ -254,6 +256,8 @@ class FixtureController extends Controller
/** /**
* Notifies user that there are no fixtures to unload according input conditions * Notifies user that there are no fixtures to unload according input conditions
* @param array $foundFixtures array of found fixtures
* @param array $except array of names of fixtures that should not be loaded
*/ */
public function notifyNothingToUnload($foundFixtures, $except) public function notifyNothingToUnload($foundFixtures, $except)
{ {
...@@ -437,11 +441,11 @@ class FixtureController extends Controller ...@@ -437,11 +441,11 @@ class FixtureController extends Controller
* ~~~ * ~~~
* [ * [
* 'apply' => [ * 'apply' => [
* User, * 'User',
* ... * ...
* ], * ],
* 'except' => [ * 'except' => [
* Custom, * 'Custom',
* ... * ...
* ], * ],
* ] * ]
......
...@@ -50,6 +50,7 @@ class MessageController extends Controller ...@@ -50,6 +50,7 @@ class MessageController extends Controller
* you may use this configuration file with the "extract" command. * you may use this configuration file with the "extract" command.
* *
* @param string $filePath output file name or alias. * @param string $filePath output file name or alias.
* @return int CLI exit code
* @throws Exception on failure. * @throws Exception on failure.
*/ */
public function actionConfig($filePath) public function actionConfig($filePath)
......
...@@ -391,6 +391,15 @@ trait ActiveRelationTrait ...@@ -391,6 +391,15 @@ trait ActiveRelationTrait
return $buckets; return $buckets;
} }
/**
* Indexes buckets by column name.
*
* @param array $buckets
* @var string|callable $column the name of the column by which the query results should be indexed by.
* This can also be a callable (e.g. anonymous function) that returns the index value based on the given row data.
* @return array
*/
private function indexBuckets($buckets, $indexBy) private function indexBuckets($buckets, $indexBy)
{ {
$result = []; $result = [];
......
...@@ -123,7 +123,7 @@ class AccessRule extends Component ...@@ -123,7 +123,7 @@ class AccessRule extends Component
} }
/** /**
* @param Controller $controller the controller * @param \yii\base\Controller $controller the controller
* @return boolean whether the rule applies to the controller * @return boolean whether the rule applies to the controller
*/ */
protected function matchController($controller) protected function matchController($controller)
......
...@@ -1022,6 +1022,16 @@ class Formatter extends Component ...@@ -1022,6 +1022,16 @@ class Formatter extends Component
} }
} }
/**
* Given the value in bytes formats number part of the human readable form.
*
* @param string|integer|float $value value in bytes to be formatted.
* @param integer $decimals the number of digits after the decimal point
* @param array $options optional configuration for the number formatter. This parameter will be merged with [[numberFormatterOptions]].
* @param array $textOptions optional configuration for the number formatter. This parameter will be merged with [[numberFormatterTextOptions]].
* @return array [parameters for Yii::t containing formatted number, internal position of size unit]
*/
private function formatSizeNumber($value, $decimals, $options, $textOptions) private function formatSizeNumber($value, $decimals, $options, $textOptions)
{ {
if (is_string($value) && is_numeric($value)) { if (is_string($value) && is_numeric($value)) {
......
...@@ -113,6 +113,12 @@ class DateValidator extends Validator ...@@ -113,6 +113,12 @@ class DateValidator extends Validator
return $this->parseDateValue($value) === false ? [$this->message, []] : null; return $this->parseDateValue($value) === false ? [$this->message, []] : null;
} }
/**
* Parses date string into UNIX timestamp
*
* @param string $value string representing date
* @return boolean|integer UNIX timestamp or false on failure
*/
protected function parseDateValue($value) protected function parseDateValue($value)
{ {
if (is_array($value)) { if (is_array($value)) {
......
...@@ -201,6 +201,15 @@ class AssetManager extends Component ...@@ -201,6 +201,15 @@ class AssetManager extends Component
} }
} }
/**
* Loads asset bundle class by name
*
* @param string $name bundle name
* @param array $config bundle object configuration
* @param boolean $publish if bundle should be published
* @return AssetBundle
* @throws InvalidConfigException if configuration isn't valid
*/
protected function loadBundle($name, $config = [], $publish = true) protected function loadBundle($name, $config = [], $publish = true)
{ {
if (!isset($config['class'])) { if (!isset($config['class'])) {
...@@ -214,6 +223,12 @@ class AssetManager extends Component ...@@ -214,6 +223,12 @@ class AssetManager extends Component
return $bundle; return $bundle;
} }
/**
* Loads dummy bundle by name
*
* @param string $name
* @return AssetBundle
*/
protected function loadDummyBundle($name) protected function loadDummyBundle($name)
{ {
if (!isset($this->_dummyBundles[$name])) { if (!isset($this->_dummyBundles[$name])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment