Remove invalid @property annotations and fix property descriptions (#20510)

This commit is contained in:
Maksim Spirkov
2025-09-05 02:33:39 +05:00
committed by GitHub
parent f39a2ec1f9
commit f914cda51e
7 changed files with 93 additions and 31 deletions

View File

@ -37,13 +37,25 @@ use yii\validators\Validator;
*
* For more details and usage information on Model, see the [guide article on models](guide:structure-models).
*
* @property-read array $errors Errors for all attributes. This is a two-dimensional
* array of errors for all attributes, similar to the following:
*
* ```php
* [
* 'username' => [
* 'Username is required.',
* 'Username must contain only word characters.',
* ],
* 'email' => [
* 'Email address is invalid.',
* ]
* ]
* ```
*
* Empty array if no errors.
* @property-read \yii\validators\Validator[] $activeValidators The validators applicable to the current
* [[scenario]].
* @property array $attributes Attribute values (name => value).
* @property-read array $errors Errors for all attributes or the specified attribute. Empty array is returned
* if no error. See [[getErrors()]] for detailed description. Note that when returning errors for all attributes,
* the result is a two-dimensional array, like the following: ```php [ 'username' => [ 'Username is required.',
* 'Username must contain only word characters.', ], 'email' => [ 'Email address is invalid.', ] ] ```.
* @property-read array $firstErrors The first errors. The array keys are the attribute names, and the array
* values are the corresponding error messages. An empty array will be returned if there is no error.
* @property-read ArrayIterator $iterator An iterator for traversing the items in the list.
@ -585,7 +597,6 @@ class Model extends Component implements StaticInstanceInterface, IteratorAggreg
* Returns the errors for all attributes or a single attribute.
* @param string|null $attribute attribute name. Use null to retrieve errors for all attributes.
* @return array errors for all attributes or the specified attribute. Empty array is returned if no error.
* See [[getErrors()]] for detailed description.
* Note that when returning errors for all attributes, the result is a two-dimensional array, like the following:
*
* ```php

View File

@ -381,9 +381,6 @@ class Module extends ServiceLocator
* Defines 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.
* @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.
* See [[setAliases()]] for an example.
* @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.
* For example,

View File

@ -23,7 +23,10 @@ use yii\helpers\StringHelper;
* For more details and usage information on QueryBuilder, see the [guide article on query builders](guide:db-query-builder).
*
* @property-write string[] $conditionClasses Map of condition aliases to condition classes. For example:
* ```php ['LIKE' => yii\db\condition\LikeCondition::class] ```.
*
* ```php
* ['LIKE' => yii\db\condition\LikeCondition::class]
* ```
* @property-write string[] $expressionBuilders Array of builders that should be merged with the pre-defined
* ones in [[expressionBuilders]] property.
*

View File

@ -50,8 +50,8 @@ use yii\base\ErrorHandler;
* Yii::$app->log->targets['file']->enabled = false;
* ```
*
* @property int $flushInterval How many messages should be logged before they are sent to targets. This
* method returns the value of [[Logger::flushInterval]].
* @property int $flushInterval How many messages should be logged before they are sent to targets. See
* [[getFlushInterval()]] and [[setFlushInterval()]] for details.
* @property Logger $logger The logger. If not set, [[Yii::getLogger()]] will be used. Note that the type of
* this property differs in getter and setter. See [[getLogger()]] and [[setLogger()]] for details.
* @property int $traceLevel How many application call stacks should be logged together with each message.
@ -107,7 +107,6 @@ class Dispatcher extends Component
/**
* Gets the connected logger.
* If not set, [[Yii::getLogger()]] will be used.
* @property Logger the logger. If not set, [[Yii::getLogger()]] will be used.
* @return Logger the logger.
*/
public function getLogger()

View File

@ -381,7 +381,6 @@ abstract class Target extends Component
/**
* Check whether the log target is enabled.
* @property bool Indicates whether this log target is enabled. Defaults to true.
* @return bool A value indicating whether this log target is enabled.
*/
public function getEnabled()

View File

@ -23,6 +23,9 @@ use yii\validators\IpValidator;
*
* For more details and usage information on Request, see the [guide article on requests](guide:runtime-requests).
*
* @property string|null $hostInfo Schema and hostname part (with port number if needed) of the request URL
* (e.g. `https://www.yiiframework.com`), null if can't be obtained from `$_SERVER` and wasn't set. See
* [[getHostInfo()]] for security related notes on this property.
* @property-read string $absoluteUrl The currently requested absolute URL.
* @property array $acceptableContentTypes The content types ordered by the quality score. Types with the
* highest scores will be returned first. The array keys are the content types, while the array values are the
@ -47,9 +50,6 @@ use yii\validators\IpValidator;
* returned if no such header is sent.
* @property-read array $eTags The entity tags.
* @property-read HeaderCollection $headers The header collection.
* @property string|null $hostInfo Schema and hostname part (with port number if needed) of the request URL
* (e.g. `https://www.yiiframework.com`), null if can't be obtained from `$_SERVER` and wasn't set. See
* [[getHostInfo()]] for security related notes on this property.
* @property-read string|null $hostName Hostname part of the request URL (e.g. `www.yiiframework.com`).
* @property-read bool $isAjax Whether this is an AJAX (XMLHttpRequest) request.
* @property-read bool $isDelete Whether this is a DELETE request.
@ -776,9 +776,6 @@ class Request extends \yii\base\Request
* > If you don't have access to the server configuration, you can setup [[\yii\filters\HostControl]] filter at
* > application level in order to protect against such kind of attack.
*
* @property string|null schema and hostname part (with port number if needed) of the request URL
* (e.g. `https://www.yiiframework.com`), null if can't be obtained from `$_SERVER` and wasn't set.
* See [[getHostInfo()]] for security related notes on this property.
* @return string|null schema and hostname part (with port number if needed) of the request URL
* (e.g. `https://www.yiiframework.com`), null if can't be obtained from `$_SERVER` and wasn't set.
* @see setHostInfo()