Cosmetic changes 2 (#12409) [skip ci]

This commit is contained in:
Roman Grinyov
2016-08-31 14:53:17 +03:00
committed by Alexander Makarov
parent 90b9ed87bd
commit f0c44bca91

View File

@ -22,15 +22,15 @@ use yii\di\ServiceLocator;
* accessible within the module. * accessible within the module.
* *
* @property array $aliases List of path aliases to be defined. The array keys are alias names (must start * @property array $aliases List of path aliases to be defined. The array keys are alias names (must start
* with '@') and the array values are the corresponding paths or aliases. See [[setAliases()]] for an example. * with `@`) and the array values are the corresponding paths or aliases. See [[setAliases()]] for an example.
* This property is write-only. * This property is write-only.
* @property string $basePath The root directory of the module. * @property string $basePath The root directory of the module.
* @property string $controllerPath The directory that contains the controller classes. This property is * @property string $controllerPath The directory that contains the controller classes. This property is
* read-only. * read-only.
* @property string $layoutPath The root directory of layout files. Defaults to "[[viewPath]]/layouts". * @property string $layoutPath The root directory of layout files. Defaults to `[[viewPath]]/layouts`.
* @property array $modules The modules (indexed by their IDs). * @property array $modules The modules (indexed by their IDs).
* @property string $uniqueId The unique ID of the module. This property is read-only. * @property string $uniqueId The unique ID of the module. This property is read-only.
* @property string $viewPath The root directory of view files. Defaults to "[[basePath]]/views". * @property string $viewPath The root directory of view files. Defaults to `[[basePath]]/views`.
* *
* @author Qiang Xue <qiang.xue@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0 * @since 2.0
@ -56,7 +56,7 @@ class Module extends ServiceLocator
*/ */
public $id; public $id;
/** /**
* @var Module the parent module of this module. Null if this module does not have a parent. * @var Module the parent module of this module. `null` if this module does not have a parent.
*/ */
public $module; public $module;
/** /**
@ -70,7 +70,7 @@ class Module extends ServiceLocator
* Each name-value pair specifies the configuration of a single controller. * Each name-value pair specifies the configuration of a single controller.
* A controller configuration can be either a string or an array. * A controller configuration can be either a string or an array.
* If the former, the string should be the fully qualified class name of the controller. * If the former, the string should be the fully qualified class name of the controller.
* If the latter, the array must contain a 'class' element which specifies * If the latter, the array must contain a `class` element which specifies
* the controller's fully qualified class name, and the rest of the name-value pairs * the controller's fully qualified class name, and the rest of the name-value pairs
* in the array are used to initialize the corresponding controller properties. For example, * in the array are used to initialize the corresponding controller properties. For example,
* *
@ -91,15 +91,15 @@ class Module extends ServiceLocator
* class name. * class name.
* *
* If not set, it will use the `controllers` sub-namespace under the namespace of this module. * If not set, it will use the `controllers` sub-namespace under the namespace of this module.
* For example, if the namespace of this module is "foo\bar", then the default * For example, if the namespace of this module is `foo\bar`, then the default
* controller namespace would be "foo\bar\controllers". * controller namespace would be `foo\bar\controllers`.
* *
* See also the [guide section on autoloading](guide:concept-autoloading) to learn more about * See also the [guide section on autoloading](guide:concept-autoloading) to learn more about
* defining namespaces and how classes are loaded. * defining namespaces and how classes are loaded.
*/ */
public $controllerNamespace; public $controllerNamespace;
/** /**
* @var string the default route of this module. Defaults to 'default'. * @var string the default route of this module. Defaults to `default`.
* The route may consist of child module ID, controller ID, and/or action ID. * The route may consist of child module ID, controller ID, and/or action ID.
* For example, `help`, `post/create`, `admin/post/create`. * For example, `help`, `post/create`, `admin/post/create`.
* If action ID is not given, it will take the default value as specified in * If action ID is not given, it will take the default value as specified in
@ -127,9 +127,9 @@ class Module extends ServiceLocator
/** /**
* Constructor. * Constructor.
* @param string $id the ID of this module * @param string $id the ID of this module.
* @param Module $parent the parent module (if any) * @param Module $parent the parent module (if any).
* @param array $config name-value pairs that will be used to initialize the object properties * @param array $config name-value pairs that will be used to initialize the object properties.
*/ */
public function __construct($id, $parent = null, $config = []) public function __construct($id, $parent = null, $config = [])
{ {
@ -142,7 +142,7 @@ class Module extends ServiceLocator
* Returns the currently requested instance of this module class. * Returns the currently requested instance of this module class.
* If the module class is not currently requested, `null` will be returned. * If the module class is not currently requested, `null` will be returned.
* This method is provided so that you access the module instance from anywhere within the module. * This method is provided so that you access the module instance from anywhere within the module.
* @return static|null the currently requested instance of this module class, or null if the module class is not requested. * @return static|null the currently requested instance of this module class, or `null` if the module class is not requested.
*/ */
public static function getInstance() public static function getInstance()
{ {
@ -239,7 +239,7 @@ class Module extends ServiceLocator
/** /**
* Returns the directory that contains the view files for this module. * Returns the directory that contains the view files for this module.
* @return string the root directory of view files. Defaults to "[[basePath]]/views". * @return string the root directory of view files. Defaults to `[[basePath]]/views`.
*/ */
public function getViewPath() public function getViewPath()
{ {
@ -252,7 +252,7 @@ class Module extends ServiceLocator
/** /**
* Sets the directory that contains the view files. * Sets the directory that contains the view files.
* @param string $path the root directory of view files. * @param string $path the root directory of view files.
* @throws InvalidParamException if the directory is invalid * @throws InvalidParamException if the directory is invalid.
*/ */
public function setViewPath($path) public function setViewPath($path)
{ {
@ -261,7 +261,7 @@ class Module extends ServiceLocator
/** /**
* Returns the directory that contains layout view files for this module. * Returns the directory that contains layout view files for this module.
* @return string the root directory of layout files. Defaults to "[[viewPath]]/layouts". * @return string the root directory of layout files. Defaults to `[[viewPath]]/layouts`.
*/ */
public function getLayoutPath() public function getLayoutPath()
{ {
@ -287,10 +287,10 @@ class Module extends ServiceLocator
* This method calls [[Yii::setAlias()]] to register the path aliases. * This method calls [[Yii::setAlias()]] to register the path aliases.
* This method is provided so that you can define path aliases when configuring a module. * This method is provided so that you can define path aliases when configuring a module.
* @property array list of path aliases to be defined. The array keys are alias names * @property array list of path aliases to be defined. The array keys are alias names
* (must start with '@') and the array values are the corresponding paths or aliases. * (must start with `@`) and the array values are the corresponding paths or aliases.
* See [[setAliases()]] for an example. * See [[setAliases()]] for an example.
* @param array $aliases list of path aliases to be defined. The array keys are alias names * @param array $aliases list of path aliases to be defined. The array keys are alias names
* (must start with '@') and the array values are the corresponding paths or aliases. * (must start with `@`) and the array values are the corresponding paths or aliases.
* For example, * For example,
* *
* ```php * ```php
@ -361,7 +361,7 @@ class Module extends ServiceLocator
/** /**
* Adds a sub-module to this module. * Adds a sub-module to this module.
* @param string $id module ID * @param string $id module ID.
* @param Module|array|null $module the sub-module to be added to this module. This can * @param Module|array|null $module the sub-module to be added to this module. This can
* be one of the following: * be one of the following:
* *
@ -384,7 +384,7 @@ class Module extends ServiceLocator
* @param boolean $loadedOnly whether to return the loaded sub-modules only. If this is set `false`, * @param boolean $loadedOnly whether to return the loaded sub-modules only. If this is set `false`,
* then all sub-modules registered in this module will be returned, whether they are loaded or not. * then all sub-modules registered in this module will be returned, whether they are loaded or not.
* Loaded modules will be returned as objects, while unloaded modules as configuration arrays. * Loaded modules will be returned as objects, while unloaded modules as configuration arrays.
* @return array the modules (indexed by their IDs) * @return array the modules (indexed by their IDs).
*/ */
public function getModules($loadedOnly = false) public function getModules($loadedOnly = false)
{ {
@ -424,7 +424,7 @@ class Module extends ServiceLocator
* ] * ]
* ``` * ```
* *
* @param array $modules modules (id => module configuration or instances) * @param array $modules modules (id => module configuration or instances).
*/ */
public function setModules($modules) public function setModules($modules)
{ {
@ -441,7 +441,7 @@ class Module extends ServiceLocator
* @param string $route the route that specifies the action. * @param string $route the route that specifies the action.
* @param array $params the parameters to be passed to the action * @param array $params the parameters to be passed to the action
* @return mixed the result of the action. * @return mixed the result of the action.
* @throws InvalidRouteException if the requested route cannot be resolved into an action successfully * @throws InvalidRouteException if the requested route cannot be resolved into an action successfully.
*/ */
public function runAction($route, $params = []) public function runAction($route, $params = [])
{ {
@ -534,7 +534,7 @@ class Module extends ServiceLocator
* *
* Note that this method does not check [[modules]] or [[controllerMap]]. * Note that this method does not check [[modules]] or [[controllerMap]].
* *
* @param string $id the controller ID * @param string $id the controller ID.
* @return Controller the newly created controller instance, or `null` if the controller ID is invalid. * @return Controller the newly created controller instance, or `null` if the controller ID is invalid.
* @throws InvalidConfigException if the controller class and its file name do not match. * @throws InvalidConfigException if the controller class and its file name do not match.
* This exception is only thrown when in debug mode. * This exception is only thrown when in debug mode.