Skip to content

Commit a9fc1b6

Browse files
committed
Add project Exception classes
1 parent d64d1c6 commit a9fc1b6

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"autoload": {
3+
"files": [
4+
"src/Exceptions.inc.php"
5+
],
36
"psr-4": {
47
"Pdsinterop\\Solid\\Auth\\": "src/"
58
}

src/Exceptions.inc.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Pdsinterop\Solid\Auth\Exception;
4+
5+
abstract class Exception extends \Exception implements \JsonSerializable
6+
{
7+
final public function jsonSerialize()
8+
{
9+
return [
10+
'code' => $this->getCode(),
11+
'message' => $this->getMessage(),
12+
'name' => static::class,
13+
// Development environment only
14+
//'file' => $this->getFile(),
15+
//'line' => $this->getLine(),
16+
//'trace' => $this->getTrace(),
17+
];
18+
}
19+
}
20+
21+
22+
class LogicException extends Exception {}

0 commit comments

Comments
 (0)