Close #109 provide better error classes + phpdoc fixes

This commit is contained in:
Antonio Ramirez
2017-11-12 23:13:42 +01:00
parent c418ad967c
commit 83458a13e4
26 changed files with 109 additions and 20 deletions

View File

@ -11,6 +11,8 @@
namespace Da\User\Helper;
use yii\base\InvalidParamException;
class ClassMapHelper
{
protected $map = [];
@ -37,7 +39,7 @@ class ClassMapHelper
/**
* @param $key
*
* @throws \Exception
* @throws InvalidParamException
* @return mixed
*
*/
@ -46,6 +48,6 @@ class ClassMapHelper
if (array_key_exists($key, $this->map)) {
return $this->map[$key];
}
throw new \Exception('Unknown model map key: ' . $key);
throw new InvalidParamException('Unknown model map key: ' . $key);
}
}