-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
082a76b
commit 4230868
Showing
11 changed files
with
126 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Dependencies | ||
composer.lock | ||
vendor/* | ||
|
||
# Dev | ||
.DS_Store | ||
.nova/* |
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 |
---|---|---|
@@ -1,2 +1,19 @@ | ||
# error | ||
Error | ||
# Error | ||
|
||
## Requirments | ||
|
||
PHP >= 8.0 | ||
|
||
|
||
## Install | ||
|
||
`composer require phant/error` | ||
|
||
## List | ||
|
||
- AlreadyDone | ||
- AlreadyExists | ||
- NotAuthorized | ||
- NotCompliant | ||
- NotExist | ||
- NotFound |
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 | ||
declare(strict_types=1); | ||
|
||
namespace Phant\Error\Abstract; | ||
|
||
abstract class Error extends \Exception | ||
{ | ||
function __construct(?string $detail = null) | ||
{ | ||
if ($detail) { | ||
$this->message .= ' (' . $detail . ')'; | ||
} | ||
} | ||
} |
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,8 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Phant\Error; | ||
|
||
class AlreadyDone extends \Phant\Error\Abstract\Error | ||
{ | ||
} |
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,8 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Phant\Error; | ||
|
||
class AlreadyExists extends \Phant\Error\Abstract\Error | ||
{ | ||
} |
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,8 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Phant\Error; | ||
|
||
class NotAuthorized extends \Phant\Error\Abstract\Error | ||
{ | ||
} |
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,8 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Phant\Error; | ||
|
||
class NotCompliant extends \Phant\Error\Abstract\Error | ||
{ | ||
} |
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,8 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Phant\Error; | ||
|
||
class NotExist extends \Phant\Error\Abstract\Error | ||
{ | ||
} |
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,8 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Phant\Error; | ||
|
||
class NotFound extends \Phant\Error\Abstract\Error | ||
{ | ||
} |
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,26 @@ | ||
{ | ||
"name": "phant/error", | ||
"description": "Manage error easily", | ||
"license": "MIT", | ||
"keywords": ["error manager", "error component", "error exception"], | ||
"authors": [ | ||
{ | ||
"name": "Lenny ROUANET", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": "^8.0" | ||
}, | ||
"require-dev": { | ||
"phpstan/phpstan": "^1.4" | ||
}, | ||
"scripts": { | ||
"analyse": "vendor/bin/phpstan analyse component --memory-limit=4G" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Phant\\Error\\": "component/" | ||
} | ||
} | ||
} |
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,12 @@ | ||
<phpunit bootstrap="vendor/autoload.php"> | ||
<testsuites> | ||
<testsuite name="component"> | ||
<directory>test</directory> | ||
</testsuite> | ||
</testsuites> | ||
<coverage processUncoveredFiles="true"> | ||
<include> | ||
<directory suffix=".php">component</directory> | ||
</include> | ||
</coverage> | ||
</phpunit> |