-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #170 from Kharhamel/fix/exception
fixed incorrect excecption creation
- Loading branch information
Showing
84 changed files
with
259 additions
and
166 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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class ApacheException extends \Exception implements SafeExceptionInterface | ||
class ApacheException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class ApcException extends \Exception implements SafeExceptionInterface | ||
class ApcException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class ApcuException extends \Exception implements SafeExceptionInterface | ||
class ApcuException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class ArrayException extends \Exception implements SafeExceptionInterface | ||
class ArrayException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class Bzip2Exception extends \Exception implements SafeExceptionInterface | ||
class Bzip2Exception extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class ClassobjException extends \Exception implements SafeExceptionInterface | ||
class ClassobjException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class ComException extends \Exception implements SafeExceptionInterface | ||
class ComException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class CubridException extends \Exception implements SafeExceptionInterface | ||
class CubridException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class DatetimeException extends \Exception implements SafeExceptionInterface | ||
class DatetimeException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class DirException extends \Exception implements SafeExceptionInterface | ||
class DirException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class EioException extends \Exception implements SafeExceptionInterface | ||
class EioException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class ErrorfuncException extends \Exception implements SafeExceptionInterface | ||
class ErrorfuncException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class ExecException extends \Exception implements SafeExceptionInterface | ||
class ExecException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class FileinfoException extends \Exception implements SafeExceptionInterface | ||
class FileinfoException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class FilesystemException extends \Exception implements SafeExceptionInterface | ||
class FilesystemException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class FilterException extends \Exception implements SafeExceptionInterface | ||
class FilterException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class FpmException extends \Exception implements SafeExceptionInterface | ||
class FpmException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class FtpException extends \Exception implements SafeExceptionInterface | ||
class FtpException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class FunchandException extends \Exception implements SafeExceptionInterface | ||
class FunchandException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class GmpException extends \Exception implements SafeExceptionInterface | ||
class GmpException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class GnupgException extends \Exception implements SafeExceptionInterface | ||
class GnupgException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class HashException extends \Exception implements SafeExceptionInterface | ||
class HashException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class IbaseException extends \Exception implements SafeExceptionInterface | ||
class IbaseException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class IbmDb2Exception extends \Exception implements SafeExceptionInterface | ||
class IbmDb2Exception extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class IconvException extends \Exception implements SafeExceptionInterface | ||
class IconvException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class ImageException extends \Exception implements SafeExceptionInterface | ||
class ImageException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class ImapException extends \Exception implements SafeExceptionInterface | ||
class ImapException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
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,10 +1,11 @@ | ||
<?php | ||
namespace Safe\Exceptions; | ||
|
||
class InfoException extends \Exception implements SafeExceptionInterface | ||
class InfoException extends \ErrorException implements SafeExceptionInterface | ||
{ | ||
public static function createFromPhpError(): self | ||
{ | ||
return new self(\json_last_error_msg(), \json_last_error()); | ||
$error = error_get_last(); | ||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); | ||
} | ||
} |
Oops, something went wrong.