mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
phpdoc fixes and additions
This commit is contained in:
@ -601,6 +601,7 @@ EOD;
|
||||
/**
|
||||
* Creates template of configuration file for [[actionCompress]].
|
||||
* @param string $configFile output file name.
|
||||
* @return int CLI exit code
|
||||
* @throws \yii\console\Exception on failure.
|
||||
*/
|
||||
public function actionTemplate($configFile)
|
||||
|
@ -302,6 +302,7 @@ abstract class BaseMigrateController extends Controller
|
||||
*
|
||||
* @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.
|
||||
* @return int CLI exit code
|
||||
* @throws Exception if the version argument is invalid or the version cannot be found.
|
||||
*/
|
||||
public function actionMark($version)
|
||||
@ -561,6 +562,7 @@ abstract class BaseMigrateController extends Controller
|
||||
/**
|
||||
* Migrates to the certain version.
|
||||
* @param string $version name in the full format.
|
||||
* @return int CLI exit code
|
||||
* @throws Exception if the provided version cannot be found.
|
||||
*/
|
||||
protected function migrateToVersion($version)
|
||||
|
@ -234,6 +234,8 @@ class FixtureController extends Controller
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
@ -254,6 +256,8 @@ class FixtureController extends Controller
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
@ -437,11 +441,11 @@ class FixtureController extends Controller
|
||||
* ~~~
|
||||
* [
|
||||
* 'apply' => [
|
||||
* User,
|
||||
* 'User',
|
||||
* ...
|
||||
* ],
|
||||
* 'except' => [
|
||||
* Custom,
|
||||
* 'Custom',
|
||||
* ...
|
||||
* ],
|
||||
* ]
|
||||
|
@ -50,6 +50,7 @@ class MessageController extends Controller
|
||||
* you may use this configuration file with the "extract" command.
|
||||
*
|
||||
* @param string $filePath output file name or alias.
|
||||
* @return int CLI exit code
|
||||
* @throws Exception on failure.
|
||||
*/
|
||||
public function actionConfig($filePath)
|
||||
|
@ -391,6 +391,15 @@ trait ActiveRelationTrait
|
||||
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)
|
||||
{
|
||||
$result = [];
|
||||
|
@ -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
|
||||
*/
|
||||
protected function matchController($controller)
|
||||
|
@ -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)
|
||||
{
|
||||
if (is_string($value) && is_numeric($value)) {
|
||||
|
@ -113,6 +113,12 @@ class DateValidator extends Validator
|
||||
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)
|
||||
{
|
||||
if (is_array($value)) {
|
||||
|
@ -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)
|
||||
{
|
||||
if (!isset($config['class'])) {
|
||||
@ -214,6 +223,12 @@ class AssetManager extends Component
|
||||
return $bundle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads dummy bundle by name
|
||||
*
|
||||
* @param string $name
|
||||
* @return AssetBundle
|
||||
*/
|
||||
protected function loadDummyBundle($name)
|
||||
{
|
||||
if (!isset($this->_dummyBundles[$name])) {
|
||||
|
Reference in New Issue
Block a user