-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
179 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Sparors\Ussd\Exceptions; | ||
|
||
class ActiveStateNotFoundException extends UssdException | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct('Active state not found. This may indicate session has ended'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Sparors\Ussd\Exceptions; | ||
|
||
class GlobaldentifierEmptyException extends UssdException | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct("Global identifier (gid) can not be empty"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Sparors\Ussd\Exceptions; | ||
|
||
use Sparors\Ussd\Contracts\Configurator; | ||
|
||
class InvalidConfiguratorException extends UssdException | ||
{ | ||
public function __construct(string $configurator) | ||
{ | ||
parent::__construct("Invalid configurator, {$configurator} should implement ". Configurator::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Sparors\Ussd\Exceptions; | ||
|
||
use Sparors\Ussd\Contracts\ContinueState; | ||
|
||
class InvalidContinueStateException extends UssdException | ||
{ | ||
public function __construct(?string $state) | ||
{ | ||
$message = $state | ||
? "Invalid continue state, {$state} should implement ". ContinueState::class | ||
: "Invalid continue state, should not be null and must implement ". ContinueState::class; | ||
|
||
parent::__construct($message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Sparors\Ussd\Exceptions; | ||
|
||
use Sparors\Ussd\ContinuingMode; | ||
|
||
class InvalidContinuingModeException extends UssdException | ||
{ | ||
public function __construct(int $continuingMode) | ||
{ | ||
$start = ContinuingMode::START; | ||
$continue = ContinuingMode::CONTINUE; | ||
$confirm = ContinuingMode::CONFIRM; | ||
|
||
parent::__construct("Invalid continuingMode, {$continuingMode} should be one of {$start}, {$continue} or {$confirm}. use constants from ".ContinuingMode::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Sparors\Ussd\Exceptions; | ||
|
||
use Sparors\Ussd\Contracts\ExceptionHandler; | ||
|
||
class InvalidExceptionHandlerException extends UssdException | ||
{ | ||
public function __construct(string $exceptionHandler) | ||
{ | ||
parent::__construct("Invalid exception handler, {$exceptionHandler} should implement ".ExceptionHandler::class." or be a closure"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Sparors\Ussd\Exceptions; | ||
|
||
use Sparors\Ussd\Contracts\InitialAction; | ||
use Sparors\Ussd\Contracts\InitialState; | ||
|
||
class InvalidInitialStateException extends UssdException | ||
{ | ||
public function __construct(string $state) | ||
{ | ||
parent::__construct("Invalid initial state, {$state} should implement ".InitialState::class." or ".InitialAction::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Sparors\Ussd\Exceptions; | ||
|
||
use Sparors\Ussd\Contracts\Response; | ||
|
||
class InvalidResponseException extends UssdException | ||
{ | ||
public function __construct(string $response) | ||
{ | ||
parent::__construct("Invalid response, {$response} should implement ".Response::class." or be a closure"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Sparors\Ussd\Exceptions; | ||
|
||
use Sparors\Ussd\Contracts\State; | ||
|
||
class InvalidStateException extends UssdException | ||
{ | ||
public function __construct(string $state) | ||
{ | ||
parent::__construct("Invalid state, {$state} should implement ".State::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Sparors\Ussd\Exceptions; | ||
|
||
class NoInitialStateProvided extends UssdException | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct('No initial state provided'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Sparors\Ussd\Exceptions; | ||
|
||
class UniqueIdentifierEmptyException extends UssdException | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct("Unique identifier (uid) can not be empty"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters