Common exceptions in my library
- Exception
- InvalidClassMemberException
- InvalidMethodException
- InvalidPropertyException
- InvalidIndexException
- InvalidKeyException
- InvalidTypeException
- InvalidParameterTypeException
- IOException
- FileNotFoundException
- DirectoryNotFoundException
- NameException
- InvalidClassMemberException
- InvalidArgumentException
- LogicException
- RuntimeException
- ValidationException
- Utils: Utility functions
- Finder: Lookup/resolve class name
use b2r\Component\Exception\InvalidTypeException;
$e = new InvalidTypeException('$key', 'string|int', []); // Variable name, Valid type, Invalid type value
echo $e->message; #=>"$key must be of the type `string|int`, but `array` given"
Finder lookup/resolve class name easily.
use b2r\Component\Exception\Finder as E;
$e = E::Type(); #=>'b2r\Component\Exception\InvalidTypeException'
throw new $e('name', 'string|int', null);