Commit f1edafff by Alexander Mohorev Committed by Carsten Brandt

PHPDoc comment doesn't contain all necessary @throws tag

close #5762
parent 6dfa7610
...@@ -292,7 +292,7 @@ class Security extends Component ...@@ -292,7 +292,7 @@ class Security extends Component
* [RFC 5869](https://tools.ietf.org/html/rfc5869) * [RFC 5869](https://tools.ietf.org/html/rfc5869)
* @param int $length length of the output key in bytes. If 0, the output key is * @param int $length length of the output key in bytes. If 0, the output key is
* the length of the hash algorithm output. * the length of the hash algorithm output.
* @throws InvalidParamException * @throws InvalidParamException when HMAC generation fails.
* @return string the derived key * @return string the derived key
*/ */
public function hkdf($algo, $inputKey, $salt = null, $info = null, $length = 0) public function hkdf($algo, $inputKey, $salt = null, $info = null, $length = 0)
...@@ -339,8 +339,8 @@ class Security extends Component ...@@ -339,8 +339,8 @@ class Security extends Component
* possible to hinder dictionary password attacks. * possible to hinder dictionary password attacks.
* @param int $length length of the output key in bytes. If 0, the output key is * @param int $length length of the output key in bytes. If 0, the output key is
* the length of the hash algorithm output. * the length of the hash algorithm output.
* @throws InvalidParamException
* @return string the derived key * @return string the derived key
* @throws InvalidParamException when hash generation fails due to invalid params given.
*/ */
public function pbkdf2($algo, $password, $salt, $iterations, $length = 0) public function pbkdf2($algo, $password, $salt, $iterations, $length = 0)
{ {
...@@ -398,8 +398,8 @@ class Security extends Component ...@@ -398,8 +398,8 @@ class Security extends Component
* cryptographic key. * cryptographic key.
* @param boolean $rawHash whether the generated hash value is in raw binary format. If false, lowercase * @param boolean $rawHash whether the generated hash value is in raw binary format. If false, lowercase
* hex digits will be generated. * hex digits will be generated.
* @throws InvalidConfigException
* @return string the data prefixed with the keyed hash * @return string the data prefixed with the keyed hash
* @throws InvalidConfigException when HMAC generation fails.
* @see validateData() * @see validateData()
* @see generateRandomKey() * @see generateRandomKey()
* @see hkdf() * @see hkdf()
...@@ -425,8 +425,8 @@ class Security extends Component ...@@ -425,8 +425,8 @@ class Security extends Component
* It indicates whether the hash value in the data is in binary format. If false, it means the hash value consists * It indicates whether the hash value in the data is in binary format. If false, it means the hash value consists
* of lowercase hex digits only. * of lowercase hex digits only.
* hex digits will be generated. * hex digits will be generated.
* @throws InvalidConfigException
* @return string the real data with the hash stripped off. False if the data is tampered. * @return string the real data with the hash stripped off. False if the data is tampered.
* @throws InvalidConfigException when HMAC generation fails.
* @see hashData() * @see hashData()
*/ */
public function validateData($data, $key, $rawHash = false) public function validateData($data, $key, $rawHash = false)
...@@ -455,8 +455,9 @@ class Security extends Component ...@@ -455,8 +455,9 @@ class Security extends Component
* @see generateRandomString() if you need a string. * @see generateRandomString() if you need a string.
* *
* @param integer $length the number of bytes to generate * @param integer $length the number of bytes to generate
* @throws Exception on failure.
* @return string the generated random bytes * @return string the generated random bytes
* @throws InvalidConfigException if mcrypt extension is not installed.
* @throws Exception on failure.
*/ */
public function generateRandomKey($length = 32) public function generateRandomKey($length = 32)
{ {
...@@ -475,8 +476,9 @@ class Security extends Component ...@@ -475,8 +476,9 @@ class Security extends Component
* The string generated matches [A-Za-z0-9_-]+ and is transparent to URL-encoding. * The string generated matches [A-Za-z0-9_-]+ and is transparent to URL-encoding.
* *
* @param integer $length the length of the key in characters * @param integer $length the length of the key in characters
* @throws Exception Exception on failure.
* @return string the generated random key * @return string the generated random key
* @throws InvalidConfigException if mcrypt extension is not installed.
* @throws Exception on failure.
*/ */
public function generateRandomString($length = 32) public function generateRandomString($length = 32)
{ {
...@@ -513,11 +515,11 @@ class Security extends Component ...@@ -513,11 +515,11 @@ class Security extends Component
* therefore slows down a brute-force attack. For best protection against brute for attacks, * therefore slows down a brute-force attack. For best protection against brute for attacks,
* set it to the highest value that is tolerable on production servers. The time taken to * set it to the highest value that is tolerable on production servers. The time taken to
* compute the hash doubles for every increment by one of $cost. * compute the hash doubles for every increment by one of $cost.
* @throws Exception on bad password parameter or cost parameter
* @throws InvalidConfigException
* @return string The password hash string. When [[passwordHashStrategy]] is set to 'crypt', * @return string The password hash string. When [[passwordHashStrategy]] is set to 'crypt',
* the output is always 60 ASCII characters, when set to 'password_hash' the output length * the output is always 60 ASCII characters, when set to 'password_hash' the output length
* might increase in future versions of PHP (http://php.net/manual/en/function.password-hash.php) * might increase in future versions of PHP (http://php.net/manual/en/function.password-hash.php)
* @throws Exception on bad password parameter or cost parameter.
* @throws InvalidConfigException when an unsupported password hash strategy is configured.
* @see validatePassword() * @see validatePassword()
*/ */
public function generatePasswordHash($password, $cost = 13) public function generatePasswordHash($password, $cost = 13)
...@@ -548,7 +550,7 @@ class Security extends Component ...@@ -548,7 +550,7 @@ class Security extends Component
* @param string $hash The hash to verify the password against. * @param string $hash The hash to verify the password against.
* @return boolean whether the password is correct. * @return boolean whether the password is correct.
* @throws InvalidParamException on bad password or hash parameters or if crypt() with Blowfish hash is not available. * @throws InvalidParamException on bad password or hash parameters or if crypt() with Blowfish hash is not available.
* @throws InvalidConfigException on unsupported password hash strategy is configured. * @throws InvalidConfigException when an unsupported password hash strategy is configured.
* @see generatePasswordHash() * @see generatePasswordHash()
*/ */
public function validatePassword($password, $hash) public function validatePassword($password, $hash)
...@@ -589,7 +591,7 @@ class Security extends Component ...@@ -589,7 +591,7 @@ class Security extends Component
* *
* @param integer $cost the cost parameter * @param integer $cost the cost parameter
* @return string the random salt value. * @return string the random salt value.
* @throws InvalidParamException if the cost parameter is not between 4 and 31 * @throws InvalidParamException if the cost parameter is out of the range of 4 to 31.
*/ */
protected function generateSalt($cost = 13) protected function generateSalt($cost = 13)
{ {
......
...@@ -1031,6 +1031,7 @@ class Formatter extends Component ...@@ -1031,6 +1031,7 @@ class Formatter extends Component
* @param array $options optional configuration for the number formatter. This parameter will be merged with [[numberFormatterOptions]]. * @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]]. * @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] * @return array [parameters for Yii::t containing formatted number, internal position of size unit]
* @throws InvalidParamException if the input value is not numeric.
*/ */
private function formatSizeNumber($value, $decimals, $options, $textOptions) private function formatSizeNumber($value, $decimals, $options, $textOptions)
{ {
......
...@@ -33,7 +33,7 @@ class CreateAction extends Action ...@@ -33,7 +33,7 @@ class CreateAction extends Action
/** /**
* Creates a new model. * Creates a new model.
* @return \yii\db\ActiveRecordInterface the model newly created * @return \yii\db\ActiveRecordInterface the model newly created
* @throws \Exception if there is any error when creating the model * @throws ServerErrorHttpException if there is any error when creating the model
*/ */
public function run() public function run()
{ {
......
...@@ -30,7 +30,7 @@ class UpdateAction extends Action ...@@ -30,7 +30,7 @@ class UpdateAction extends Action
* Updates an existing model. * Updates an existing model.
* @param string $id the primary key of the model. * @param string $id the primary key of the model.
* @return \yii\db\ActiveRecordInterface the model being updated * @return \yii\db\ActiveRecordInterface the model being updated
* @throws \Exception if there is any error when updating the model * @throws ServerErrorHttpException if there is any error when updating the model
*/ */
public function run($id) public function run($id)
{ {
......
...@@ -56,7 +56,7 @@ class Controller extends \yii\base\Controller ...@@ -56,7 +56,7 @@ class Controller extends \yii\base\Controller
* @param \yii\base\Action $action the action to be bound with parameters * @param \yii\base\Action $action the action to be bound with parameters
* @param array $params the parameters to be bound to the action * @param array $params the parameters to be bound to the action
* @return array the valid parameters that the action can run with. * @return array the valid parameters that the action can run with.
* @throws HttpException if there are missing or invalid parameters. * @throws BadRequestHttpException if there are missing or invalid parameters.
*/ */
public function bindActionParams($action, $params) public function bindActionParams($action, $params)
{ {
......
...@@ -173,7 +173,7 @@ class Request extends \yii\base\Request ...@@ -173,7 +173,7 @@ class Request extends \yii\base\Request
/** /**
* Resolves the current request into a route and the associated parameters. * Resolves the current request into a route and the associated parameters.
* @return array the first element is the route, and the second is the associated parameters. * @return array the first element is the route, and the second is the associated parameters.
* @throws HttpException if the request cannot be resolved. * @throws NotFoundHttpException if the request cannot be resolved.
*/ */
public function resolve() public function resolve()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment