Skip to content

Commit 3807b62

Browse files
committed
add Exceptions
1 parent 8bd47ac commit 3807b62

File tree

6 files changed

+77
-0
lines changed

6 files changed

+77
-0
lines changed

src/Exceptions/Exception.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace Php\Support\Exceptions;
4+
/**
5+
* Class Exception
6+
*
7+
* @package Php\Support\Exceptions
8+
*/
9+
class Exception extends \Exception
10+
{
11+
public function getName()
12+
{
13+
return 'Exception';
14+
}
15+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace Php\Support\Exceptions;
4+
5+
class InvalidArgumentException extends \BadMethodCallException
6+
{
7+
8+
public function getName()
9+
{
10+
return 'Invalid Argument';
11+
}
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Php\Support\Exceptions;
4+
5+
class InvalidCallException extends \BadMethodCallException
6+
{
7+
public function getName()
8+
{
9+
return 'Invalid Call';
10+
}
11+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Php\Support\Exceptions;
4+
5+
/**
6+
* Class InvalidConfigException
7+
*
8+
* @package Php\Support\Exceptions
9+
*/
10+
class InvalidConfigException extends Exception
11+
{
12+
public function getName()
13+
{
14+
return 'Invalid Configuration';
15+
}
16+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace Php\Support\Exceptions;
4+
5+
class InvalidParamException extends \BadMethodCallException
6+
{
7+
8+
public function getName()
9+
{
10+
return 'Invalid Parameter';
11+
}
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Php\Support\Exceptions;
4+
5+
class InvalidValueException extends \UnexpectedValueException
6+
{
7+
public function getName()
8+
{
9+
return 'Invalid Return Value';
10+
}
11+
}

0 commit comments

Comments
 (0)