Skip to content
Snippets Groups Projects
Commit d6186e05 authored by Maks3w's avatar Maks3w Committed by Rob DiMarco
Browse files

Fix exceptions classes (#81)

* Use InvalidArgumentException when $allowed_algs is not array

> Exception thrown if an argument is not of the expected type.
http://php.net/manual/en/class.invalidargumentexception.php

* Use RuntimeExceptions for exceptions related with unencoded data.

RuntimeExceptions is the correct exception error source is the decoded data.

Note LogicExceptions as defined in PHP documentation implies a modification in the code by the developer.

> Exception that represents error in the program logic. This kind of exception should lead directly to a fix in your code.
http://php.net/manual/en/class.logicexception.php

But the token is a data provided by an external source which is out side of the control of the developer so there is no way of prevent malformed tokens.
parent 19860fa0
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