From 552593ca3bcd9b4c9b19913e9e56de9548db59e3 Mon Sep 17 00:00:00 2001 From: Alexey Rogachev Date: Thu, 18 Nov 2021 13:10:09 +0600 Subject: [PATCH] Prepare for new apidoc (part 2) (#19010) * Fix broken links for events with different namespace * Fix broken links in see tag * Fix broken links in see tag (loadData()) * Fix broken link for var_export() * Fix broken link for CVE * Remove redundant markdown link wrap in see tags * Remove see tags that refer to private properties * Remove more see tags that refer to private properties * Remove see tags that refer to private methods * Remove one more redundant markdown link wrap in see tag [skip ci] * Fix typo in see tag (causes broken link) * Remove more see tags that refer to private methods --- framework/base/DynamicModel.php | 2 -- framework/base/View.php | 1 - framework/db/ActiveRecord.php | 6 +++--- framework/db/ArrayExpression.php | 3 --- framework/db/BatchQueryResult.php | 2 +- framework/db/Connection.php | 8 ++++---- framework/db/Query.php | 2 +- framework/db/QueryBuilder.php | 2 +- framework/di/Instance.php | 2 +- framework/filters/PageCache.php | 2 -- framework/helpers/BaseHtml.php | 1 - framework/helpers/ReplaceArrayValue.php | 2 +- framework/helpers/UnsetArrayValue.php | 2 +- framework/test/BaseActiveFixture.php | 2 +- framework/web/ErrorAction.php | 2 +- framework/web/Request.php | 6 +++--- framework/web/UrlNormalizerRedirectException.php | 4 ++-- 17 files changed, 20 insertions(+), 29 deletions(-) diff --git a/framework/base/DynamicModel.php b/framework/base/DynamicModel.php index 6b2295a987..4510596d95 100644 --- a/framework/base/DynamicModel.php +++ b/framework/base/DynamicModel.php @@ -252,7 +252,6 @@ class DynamicModel extends Model * Sets the attribute labels in a massive way. * * @see attributeLabels() - * @see _attributeLabels * @since 2.0.35 * * @param array $labels Array of attribute labels @@ -269,7 +268,6 @@ class DynamicModel extends Model * Sets a label for an attribute. * * @see attributeLabels() - * @see _attributeLabels * @since 2.0.35 * * @param string $attribute Attribute name diff --git a/framework/base/View.php b/framework/base/View.php index e6cb093e64..1cb79cfcf9 100644 --- a/framework/base/View.php +++ b/framework/base/View.php @@ -336,7 +336,6 @@ class View extends Component implements DynamicContentAwareInterface * @param array $_params_ the parameters (name-value pairs) that will be extracted and made available in the view file. * @return string the rendering result * @throws \Exception - * @throws \Throwable */ public function renderPhpFile($_file_, $_params_ = []) { diff --git a/framework/db/ActiveRecord.php b/framework/db/ActiveRecord.php index bfd33b16d2..face7132b7 100644 --- a/framework/db/ActiveRecord.php +++ b/framework/db/ActiveRecord.php @@ -557,7 +557,7 @@ class ActiveRecord extends BaseActiveRecord * @param array $attributes list of attributes that need to be saved. Defaults to `null`, * meaning all attributes that are loaded from DB will be saved. * @return bool whether the attributes are valid and the record is inserted successfully. - * @throws \Exception|\Throwable in case insert failed. + * @throws \Exception in case insert failed. */ public function insert($runValidation = true, $attributes = null) { @@ -667,7 +667,7 @@ class ActiveRecord extends BaseActiveRecord * or [[beforeSave()]] stops the updating process. * @throws StaleObjectException if [[optimisticLock|optimistic locking]] is enabled and the data * being updated is outdated. - * @throws \Exception|\Throwable in case update failed. + * @throws \Exception in case update failed. */ public function update($runValidation = true, $attributeNames = null) { @@ -716,7 +716,7 @@ class ActiveRecord extends BaseActiveRecord * Note that it is possible the number of rows deleted is 0, even though the deletion execution is successful. * @throws StaleObjectException if [[optimisticLock|optimistic locking]] is enabled and the data * being deleted is outdated. - * @throws \Exception|\Throwable in case delete failed. + * @throws \Exception in case delete failed. */ public function delete() { diff --git a/framework/db/ArrayExpression.php b/framework/db/ArrayExpression.php index b5bfd719a2..e473eb10ec 100644 --- a/framework/db/ArrayExpression.php +++ b/framework/db/ArrayExpression.php @@ -69,7 +69,6 @@ class ArrayExpression implements ExpressionInterface, \ArrayAccess, \Countable, /** * @return null|string - * @see type */ public function getType() { @@ -78,7 +77,6 @@ class ArrayExpression implements ExpressionInterface, \ArrayAccess, \Countable, /** * @return array|mixed|QueryInterface - * @see value */ public function getValue() { @@ -87,7 +85,6 @@ class ArrayExpression implements ExpressionInterface, \ArrayAccess, \Countable, /** * @return int the number of indices needed to select an element - * @see dimensions */ public function getDimension() { diff --git a/framework/db/BatchQueryResult.php b/framework/db/BatchQueryResult.php index 5158e4b281..c473d0ecd2 100644 --- a/framework/db/BatchQueryResult.php +++ b/framework/db/BatchQueryResult.php @@ -246,7 +246,7 @@ class BatchQueryResult extends Component implements \Iterator /** * Unserialization is disabled to prevent remote code execution in case application * calls unserialize() on user input containing specially crafted string. - * @see CVE-2020-15148 + * @see https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15148 * @since 2.0.38 */ public function __wakeup() diff --git a/framework/db/Connection.php b/framework/db/Connection.php index cc972f49d2..74b954ffa4 100644 --- a/framework/db/Connection.php +++ b/framework/db/Connection.php @@ -499,7 +499,7 @@ class Connection extends Component * Use 0 to indicate that the cached data will never expire. * @param \yii\caching\Dependency $dependency the cache dependency associated with the cached query results. * @return mixed the return result of the callable - * @throws \Exception|\Throwable if there is any exception during query + * @throws \Exception if there is any exception during query * @see enableQueryCache * @see queryCache * @see noCache() @@ -540,7 +540,7 @@ class Connection extends Component * @param callable $callable a PHP callable that contains DB queries which should not use query cache. * The signature of the callable is `function (Connection $db)`. * @return mixed the return result of the callable - * @throws \Exception|\Throwable if there is any exception during query + * @throws \Exception if there is any exception during query * @see enableQueryCache * @see queryCache * @see cache() @@ -802,7 +802,7 @@ class Connection extends Component * @param callable $callback a valid PHP callback that performs the job. Accepts connection instance as parameter. * @param string|null $isolationLevel The isolation level to use for this transaction. * See [[Transaction::begin()]] for details. - * @throws \Exception|\Throwable if there is any exception during query. In this case the transaction will be rolled back. + * @throws \Exception if there is any exception during query. In this case the transaction will be rolled back. * @return mixed result of callback function */ public function transaction(callable $callback, $isolationLevel = null) @@ -1116,7 +1116,7 @@ class Connection extends Component * @param callable $callback a PHP callable to be executed by this method. Its signature is * `function (Connection $db)`. Its return value will be returned by this method. * @return mixed the return value of the callback - * @throws \Exception|\Throwable if there is any exception thrown from the callback + * @throws \Exception if there is any exception thrown from the callback */ public function useMaster(callable $callback) { diff --git a/framework/db/Query.php b/framework/db/Query.php index 1892c8a272..d23893b3bc 100644 --- a/framework/db/Query.php +++ b/framework/db/Query.php @@ -452,7 +452,7 @@ class Query extends Component implements QueryInterface, ExpressionInterface * @param string|ExpressionInterface $selectExpression * @param Connection|null $db the database connection used to execute the query. * @return bool|string|null - * @throws \Throwable if can't create command + * @throws \Exception if can't create command */ protected function queryScalar($selectExpression, $db) { diff --git a/framework/db/QueryBuilder.php b/framework/db/QueryBuilder.php index 63458c59c9..bb032d7883 100644 --- a/framework/db/QueryBuilder.php +++ b/framework/db/QueryBuilder.php @@ -73,7 +73,7 @@ class QueryBuilder extends \yii\base\BaseObject * * In case you want to add custom conditions support, use the [[setConditionClasses()]] method. * - * @see setConditonClasses() + * @see setConditionClasses() * @see defaultConditionClasses() * @since 2.0.14 */ diff --git a/framework/di/Instance.php b/framework/di/Instance.php index bea4fe8cdd..62fb50e1d2 100644 --- a/framework/di/Instance.php +++ b/framework/di/Instance.php @@ -188,7 +188,7 @@ class Instance * @param array $state * @return Instance * @throws InvalidConfigException when $state property does not contain `id` parameter - * @see var_export() + * @see https://www.php.net/manual/en/function.var-export.php * @since 2.0.12 */ public static function __set_state($state) diff --git a/framework/filters/PageCache.php b/framework/filters/PageCache.php index 774e8dbd47..1930aa0873 100644 --- a/framework/filters/PageCache.php +++ b/framework/filters/PageCache.php @@ -124,7 +124,6 @@ class PageCache extends ActionFilter implements DynamicContentAwareInterface * @var bool|array a boolean value indicating whether to cache all cookies, or an array of * cookie names indicating which cookies can be cached. Be very careful with caching cookies, because * it may leak sensitive or private data stored in cookies to unwanted users. - * @see insertResponseCollectionIntoData() * @since 2.0.4 */ public $cacheCookies = false; @@ -132,7 +131,6 @@ class PageCache extends ActionFilter implements DynamicContentAwareInterface * @var bool|array a boolean value indicating whether to cache all HTTP headers, or an array of * HTTP header names (case-insensitive) indicating which HTTP headers can be cached. * Note if your HTTP headers contain sensitive information, you should white-list which headers can be cached. - * @see insertResponseCollectionIntoData() * @since 2.0.4 */ public $cacheHeaders = true; diff --git a/framework/helpers/BaseHtml.php b/framework/helpers/BaseHtml.php index 8264fa2cda..5d89314971 100644 --- a/framework/helpers/BaseHtml.php +++ b/framework/helpers/BaseHtml.php @@ -2013,7 +2013,6 @@ class BaseHtml * * @param array $options the options to be modified. * @param string|array $class the CSS class(es) to be added - * @see mergeCssClasses() * @see removeCssClass() */ public static function addCssClass(&$options, $class) diff --git a/framework/helpers/ReplaceArrayValue.php b/framework/helpers/ReplaceArrayValue.php index a408af264d..3ce281cd2e 100644 --- a/framework/helpers/ReplaceArrayValue.php +++ b/framework/helpers/ReplaceArrayValue.php @@ -79,7 +79,7 @@ class ReplaceArrayValue * @param array $state * @return ReplaceArrayValue * @throws InvalidConfigException when $state property does not contain `value` parameter - * @see var_export() + * @see https://www.php.net/manual/en/function.var-export.php * @since 2.0.16 */ public static function __set_state($state) diff --git a/framework/helpers/UnsetArrayValue.php b/framework/helpers/UnsetArrayValue.php index e350c86e81..331b0619a4 100644 --- a/framework/helpers/UnsetArrayValue.php +++ b/framework/helpers/UnsetArrayValue.php @@ -54,7 +54,7 @@ class UnsetArrayValue * * @param array $state * @return UnsetArrayValue - * @see var_export() + * @see https://www.php.net/manual/en/function.var-export.php * @since 2.0.16 */ public static function __set_state($state) diff --git a/framework/test/BaseActiveFixture.php b/framework/test/BaseActiveFixture.php index 317d0fa85f..54c30c9938 100644 --- a/framework/test/BaseActiveFixture.php +++ b/framework/test/BaseActiveFixture.php @@ -84,7 +84,7 @@ abstract class BaseActiveFixture extends DbFixture implements \IteratorAggregate * * @return array the data to be put into the database * @throws InvalidConfigException if the specified data file does not exist. - * @see [[loadData]] + * @see loadData() */ protected function getData() { diff --git a/framework/web/ErrorAction.php b/framework/web/ErrorAction.php index 81f06b643f..67bd8a6d41 100644 --- a/framework/web/ErrorAction.php +++ b/framework/web/ErrorAction.php @@ -76,7 +76,7 @@ class ErrorAction extends Action /** * @var \Exception the exception object, normally is filled on [[init()]] method call. - * @see [[findException()]] to know default way of obtaining exception. + * @see findException() to know default way of obtaining exception. * @since 2.0.11 */ protected $exception; diff --git a/framework/web/Request.php b/framework/web/Request.php index 3abc9b9d8c..bcaeb03af5 100644 --- a/framework/web/Request.php +++ b/framework/web/Request.php @@ -1216,9 +1216,9 @@ class Request extends \yii\base\Request * * @param string $ips comma separated IP list * @return string|null IP as string. Null is returned if IP can not be determined from header. - * @see getUserHost - * @see ipHeader - * @see trustedHeaders + * @see getUserHost() + * @see ipHeaders + * @see getTrustedHeaders() * @since 2.0.28 */ protected function getUserIpFromIpHeader($ips) diff --git a/framework/web/UrlNormalizerRedirectException.php b/framework/web/UrlNormalizerRedirectException.php index 195d45b8fd..88147cf3a4 100644 --- a/framework/web/UrlNormalizerRedirectException.php +++ b/framework/web/UrlNormalizerRedirectException.php @@ -18,12 +18,12 @@ class UrlNormalizerRedirectException extends \yii\base\Exception { /** * @var array|string the parameter to be used to generate a valid URL for redirection - * @see [[\yii\helpers\Url::to()]] + * @see \yii\helpers\Url::to() */ public $url; /** * @var bool|string the URI scheme to use in the generated URL for redirection - * @see [[\yii\helpers\Url::to()]] + * @see \yii\helpers\Url::to() */ public $scheme; /**