Skip to content

Commit

Permalink
revert a87c02c
Browse files Browse the repository at this point in the history
  • Loading branch information
charescape committed Aug 23, 2022
1 parent 67c5da0 commit e6c7850
Show file tree
Hide file tree
Showing 97 changed files with 206 additions and 214 deletions.
2 changes: 1 addition & 1 deletion framework/BaseYii.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public static function getLogger()

/**
* Sets the logger object.
* @param Logger|null $logger the logger object.
* @param Logger $logger the logger object.
*/
public static function setLogger($logger)
{
Expand Down
2 changes: 1 addition & 1 deletion framework/base/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ abstract class Application extends Module
*/
public $requestedParams;
/**
* @var array|null list of installed Yii extensions. Each array element represents a single extension
* @var array list of installed Yii extensions. Each array element represents a single extension
* with the following structure:
*
* ```php
Expand Down
2 changes: 1 addition & 1 deletion framework/base/ErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ErrorException extends \ErrorException
* @param int $severity [optional]
* @param string $filename [optional]
* @param int $lineno [optional]
* @param \Throwable|null $previous [optional]
* @param \Throwable|\Exception|null $previous [optional]
*/
public function __construct($message = '', $code = 0, $severity = 1, $filename = __FILE__, $lineno = __LINE__, $previous = null)
{
Expand Down
14 changes: 7 additions & 7 deletions framework/base/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abstract class ErrorHandler extends Component
*/
public $memoryReserveSize = 262144;
/**
* @var \Throwable|null the exception that is being handled currently.
* @var \Exception|null the exception that is being handled currently.
*/
public $exception;
/**
Expand All @@ -59,7 +59,7 @@ abstract class ErrorHandler extends Component
*/
private $_memoryReserve;
/**
* @var \Throwable from HHVM error that stores backtrace
* @var \Exception from HHVM error that stores backtrace
*/
private $_hhvmException;
/**
Expand Down Expand Up @@ -125,7 +125,7 @@ public function unregister()
*
* This method is implemented as a PHP exception handler.
*
* @param \Throwable $exception the exception that is not caught
* @param \Exception $exception the exception that is not caught
*/
public function handleException($exception)
{
Expand Down Expand Up @@ -338,13 +338,13 @@ public function handleFatalError()

/**
* Renders the exception.
* @param \Throwable $exception the exception to be rendered.
* @param \Exception|\Error|\Throwable $exception the exception to be rendered.
*/
abstract protected function renderException($exception);

/**
* Logs the given exception.
* @param \Throwable $exception the exception to be logged
* @param \Exception $exception the exception to be logged
* @since 2.0.3 this method is now public.
*/
public function logException($exception)
Expand Down Expand Up @@ -386,7 +386,7 @@ public static function convertExceptionToError($exception)

/**
* Converts an exception into a simple string.
* @param \Throwable $exception the exception being converted
* @param \Exception|\Error|\Throwable $exception the exception being converted
* @return string the string representation of the exception.
*/
public static function convertExceptionToString($exception)
Expand All @@ -404,7 +404,7 @@ public static function convertExceptionToString($exception)

/**
* Converts an exception into a string that has verbose information about the exception and its trace.
* @param \Throwable $exception the exception being converted
* @param \Exception|\Error|\Throwable $exception the exception being converted
* @return string the string representation of the exception.
*
* @since 2.0.14
Expand Down
2 changes: 1 addition & 1 deletion framework/base/ExitException.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ExitException extends \Exception
* @param int $status the exit status code
* @param string $message error message
* @param int $code error code
* @param \Throwable|null $previous The previous exception used for the exception chaining.
* @param \Throwable|\Exception|null $previous The previous exception used for the exception chaining.
*/
public function __construct($status = 0, $message = null, $code = 0, $previous = null)
{
Expand Down
4 changes: 2 additions & 2 deletions framework/base/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class Module extends ServiceLocator
*/
private $_modules = [];
/**
* @var string|callable|null the version of this module.
* @var string|callable the version of this module.
* Version can be specified as a PHP callback, which can accept module instance as an argument and should
* return the actual version. For example:
*
Expand Down Expand Up @@ -342,7 +342,7 @@ public function getVersion()

/**
* Sets current module version.
* @param string|callable|null $version the version of this module.
* @param string|callable $version the version of this module.
* Version can be specified as a PHP callback, which can accept module instance as an argument and should
* return the actual version. For example:
*
Expand Down
2 changes: 1 addition & 1 deletion framework/base/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
class Theme extends Component
{
/**
* @var array|null the mapping between view directories and their corresponding themed versions.
* @var array the mapping between view directories and their corresponding themed versions.
* This property is used by [[applyTo()]] when a view is trying to apply the theme.
* [Path aliases](guide:concept-aliases) can be used when specifying directories.
* If this property is empty or not set, a mapping [[Application::basePath]] to [[basePath]] will be used.
Expand Down
2 changes: 1 addition & 1 deletion framework/base/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public function afterRender($viewFile, $params, &$output)
* @param string $_file_ the view file.
* @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 \Throwable
* @throws \Exception
*/
public function renderPhpFile($_file_, $_params_ = [])
{
Expand Down
8 changes: 1 addition & 7 deletions framework/base/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public static function end()
* The widget rendering result is returned by this method.
* @param array $config name-value pairs that will be used to initialize the object properties
* @return string the rendering result of the widget.
* @throws \Throwable
* @throws \Exception
*/
public static function widget($config = [])
{
Expand All @@ -152,12 +152,6 @@ public static function widget($config = [])
ob_end_clean();
}
throw $e;
} catch (\Throwable $e) {
// close the output buffer opened above if it has not been closed already
if (ob_get_level() > 0) {
ob_end_clean();
}
throw $e;
}

return ob_get_clean() . $out;
Expand Down
2 changes: 1 addition & 1 deletion framework/behaviors/AttributeTypecastBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class AttributeTypecastBehavior extends Behavior
*/
public $owner;
/**
* @var array|null attribute typecast map in format: attributeName => type.
* @var array attribute typecast map in format: attributeName => type.
* Type can be set via PHP callable, which accept raw value as an argument and should return
* typecast result.
* For example:
Expand Down
2 changes: 1 addition & 1 deletion framework/behaviors/SluggableBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class SluggableBehavior extends AttributeBehavior
*/
public $uniqueValidator = [];
/**
* @var callable|null slug unique value generator. It is used in case [[ensureUnique]] enabled and generated
* @var callable slug unique value generator. It is used in case [[ensureUnique]] enabled and generated
* slug is not unique. This should be a PHP callable with following signature:
*
* ```php
Expand Down
2 changes: 1 addition & 1 deletion framework/caching/DbQueryDependency.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DbQueryDependency extends Dependency
*/
public $query;
/**
* @var string|callable|null method which should be invoked in over the [[query]] object.
* @var string|callable method which should be invoked in over the [[query]] object.
*
* If specified as a string an own query method with such name will be invoked, passing [[db]] value as its
* first argument. For example: `exists`, `all`.
Expand Down
2 changes: 1 addition & 1 deletion framework/caching/FileCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class FileCache extends Cache
*/
public $gcProbability = 10;
/**
* @var int|null the permission to be set for newly created cache files.
* @var int the permission to be set for newly created cache files.
* This value will be used by PHP chmod() function. No umask will be applied.
* If not set, the permission will be determined by the current environment.
*/
Expand Down
4 changes: 2 additions & 2 deletions framework/captcha/CaptchaAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ class CaptchaAction extends Action
*/
public $fontFile = '@yii/captcha/SpicyRice.ttf';
/**
* @var string|null the fixed verification code. When this property is set,
* @var string the fixed verification code. When this property is set,
* [[getVerifyCode()]] will always return the value of this property.
* This is mainly used in automated tests where we want to be able to reproduce
* the same verification code each time we run the tests.
* If not set, it means the verification code will be randomly generated.
*/
public $fixedVerifyCode;
/**
* @var string|null the rendering library to use. Currently supported only 'gd' and 'imagick'.
* @var string the rendering library to use. Currently supported only 'gd' and 'imagick'.
* If not set, library will be determined automatically.
* @since 2.0.7
*/
Expand Down
2 changes: 1 addition & 1 deletion framework/console/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ErrorHandler extends \yii\base\ErrorHandler
{
/**
* Renders an exception using ansi format for console output.
* @param \Throwable $exception the exception to be rendered.
* @param \Exception $exception the exception to be rendered.
*/
protected function renderException($exception)
{
Expand Down
4 changes: 2 additions & 2 deletions framework/console/UnknownCommandException.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class UnknownCommandException extends Exception
* @param string $route the route of the command that could not be found.
* @param Application $application the console application instance involved.
* @param int $code the Exception code.
* @param \Throwable|null $previous the previous exception used for the exception chaining.
* @param \Exception|null $previous the previous exception used for the exception chaining.
*/
public function __construct($route, $application, $code = 0, $previous = null)
public function __construct($route, $application, $code = 0, \Exception $previous = null)
{
$this->command = $route;
$this->application = $application;
Expand Down
4 changes: 2 additions & 2 deletions framework/console/controllers/BaseMigrateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ abstract class BaseMigrateController extends Controller
*/
public $templateFile;
/**
* @var int|null the permission to be set for newly generated migration files.
* @var int the permission to be set for newly generated migration files.
* This value will be used by PHP chmod() function. No umask will be applied.
* If not set, the permission will be determined by the current environment.
* @since 2.0.43
*/
public $newFileMode;
/**
* @var string|int|null the user and/or group ownership to be set for newly generated migration files.
* @var string|int the user and/or group ownership to be set for newly generated migration files.
* If not set, the ownership will be determined by the current environment.
* @since 2.0.43
* @see FileHelper::changeOwnership()
Expand Down
4 changes: 2 additions & 2 deletions framework/console/controllers/MessageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class MessageController extends \yii\console\Controller
*/
public $markUnused = true;
/**
* @var array|null list of patterns that specify which files/directories should NOT be processed.
* @var array list of patterns that specify which files/directories should NOT be processed.
* If empty or not set, all files/directories will be processed.
* See helpers/FileHelper::findFiles() description for pattern matching rules.
* If a file/directory matches both a pattern in "only" and "except", it will NOT be processed.
Expand All @@ -99,7 +99,7 @@ class MessageController extends \yii\console\Controller
'/BaseYii.php', // contains examples about Yii::t()
];
/**
* @var array|null list of patterns that specify which files (not directories) should be processed.
* @var array list of patterns that specify which files (not directories) should be processed.
* If empty or not set, all files will be processed.
* See helpers/FileHelper::findFiles() description for pattern matching rules.
* If a file/directory matches both a pattern in "only" and "except", it will NOT be processed.
Expand Down
2 changes: 1 addition & 1 deletion framework/data/ArrayDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
class ArrayDataProvider extends BaseDataProvider
{
/**
* @var string|callable|null the column that is used as the key of the data models.
* @var string|callable the column that is used as the key of the data models.
* This can be either a column name, or a callable that returns the key value of a given data model.
* If this is not set, the index of the [[models]] array will be used.
* @see getKeys()
Expand Down
2 changes: 1 addition & 1 deletion framework/data/BaseDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ abstract class BaseDataProvider extends Component implements DataProviderInterfa
*/
private static $counter = 0;
/**
* @var string|null an ID that uniquely identifies the data provider among all data providers.
* @var string an ID that uniquely identifies the data provider among all data providers.
* Generated automatically the following way in case it is not set:
*
* - First data provider ID is empty.
Expand Down
6 changes: 3 additions & 3 deletions framework/data/Pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ class Pagination extends BaseObject implements Linkable
*/
public $forcePageParam = true;
/**
* @var string|null the route of the controller action for displaying the paged contents.
* @var string the route of the controller action for displaying the paged contents.
* If not set, it means using the currently requested route.
*/
public $route;
/**
* @var array|null parameters (name => value) that should be used to obtain the current page number
* @var array parameters (name => value) that should be used to obtain the current page number
* and to create new pagination URLs. If not set, all parameters from $_GET will be used instead.
*
* In order to add hash to all links use `array_merge($_GET, ['#' => 'my-hash'])`.
Expand All @@ -111,7 +111,7 @@ class Pagination extends BaseObject implements Linkable
*/
public $params;
/**
* @var \yii\web\UrlManager|null the URL manager used for creating pagination URLs. If not set,
* @var \yii\web\UrlManager the URL manager used for creating pagination URLs. If not set,
* the "urlManager" application component will be used.
*/
public $urlManager;
Expand Down
6 changes: 3 additions & 3 deletions framework/data/Sort.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class Sort extends BaseObject
*/
public $defaultOrder;
/**
* @var string|null the route of the controller action for displaying the sorted contents.
* @var string the route of the controller action for displaying the sorted contents.
* If not set, it means using the currently requested route.
*/
public $route;
Expand All @@ -168,7 +168,7 @@ class Sort extends BaseObject
*/
public $separator = ',';
/**
* @var array|null parameters (name => value) that should be used to obtain the current sort directions
* @var array parameters (name => value) that should be used to obtain the current sort directions
* and to create new sort URLs. If not set, `$_GET` will be used instead.
*
* In order to add hash to all links use `array_merge($_GET, ['#' => 'my-hash'])`.
Expand All @@ -181,7 +181,7 @@ class Sort extends BaseObject
*/
public $params;
/**
* @var \yii\web\UrlManager|null the URL manager used for creating sort URLs. If not set,
* @var \yii\web\UrlManager the URL manager used for creating sort URLs. If not set,
* the `urlManager` application component will be used.
*/
public $urlManager;
Expand Down
2 changes: 1 addition & 1 deletion framework/data/SqlDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class SqlDataProvider extends BaseDataProvider
*/
public $params = [];
/**
* @var string|callable|null the column that is used as the key of the data models.
* @var string|callable the column that is used as the key of the data models.
* This can be either a column name, or a callable that returns the key value of a given data model.
*
* If this is not set, the keys of the [[models]] array will be used.
Expand Down
6 changes: 3 additions & 3 deletions framework/db/ActiveRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ public static function populateRecord($record, $row)
* @param array|null $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 \Throwable in case insert failed.
* @throws \Exception in case insert failed.
*/
public function insert($runValidation = true, $attributes = null)
{
Expand Down Expand Up @@ -667,7 +667,7 @@ protected function insertInternal($attributes = null)
* or [[beforeSave()]] stops the updating process.
* @throws StaleObjectException if [[optimisticLock|optimistic locking]] is enabled and the data
* being updated is outdated.
* @throws \Throwable in case update failed.
* @throws \Exception in case update failed.
*/
public function update($runValidation = true, $attributeNames = null)
{
Expand Down Expand Up @@ -716,7 +716,7 @@ public function update($runValidation = true, $attributeNames = null)
* 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 \Throwable in case delete failed.
* @throws \Exception in case delete failed.
*/
public function delete()
{
Expand Down
Loading

0 comments on commit e6c7850

Please sign in to comment.