Skip to content

Commit

Permalink
Fix Exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ufozone committed Aug 25, 2024
1 parent 944412c commit e6913dc
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 13 deletions.
4 changes: 2 additions & 2 deletions vendor/lib/Sepa/Payment/Exception.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// $Id: Exception.php 7657 2019-04-12 21:26:58Z markus $
// $Id: Exception.php 8833 2024-08-25 14:48:13Z markus $
declare(strict_types=1);

namespace MG\Sepa\Payment;
Expand All @@ -11,7 +11,7 @@
* @since 2017-06-13
* @uses \Exception
*/
class Exception extends \MG\Exception
class Exception extends \Exception
{
const PAYMENT_INFORMATION_ID_EMPTY = 2101;
const PAYMENT_INFORMATION_ID_INVALID = 2102;
Expand Down
4 changes: 2 additions & 2 deletions vendor/lib/Sepa/Transaction/Exception.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// $Id: Exception.php 7657 2019-04-12 21:26:58Z markus $
// $Id: Exception.php 8833 2024-08-25 14:48:13Z markus $
declare(strict_types=1);

namespace MG\Sepa\Transaction;
Expand All @@ -11,7 +11,7 @@
* @since 2017-06-13
* @uses \Exception
*/
class Exception extends \MG\Exception
class Exception extends \Exception
{
const INSTRUCTION_ID_EMPTY = 3101;
const INSTRUCTION_ID_INVALID = 3102;
Expand Down
17 changes: 17 additions & 0 deletions vendor/lib/Sepa/Validator/Exception.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
// $Id: Exception.php 8834 2024-08-25 14:52:29Z markus $
declare(strict_types=1);

namespace MG\Sepa\Validator;

/**
* Extension of base exception to define validator related errors
*
* @author Markus
* @since 2024-08-25
* @uses \Exception
*/
class Exception extends \Exception
{
const NO_VALID_VALIDATOR = 4000;
}
4 changes: 2 additions & 2 deletions vendor/lib/Sepa/Validator/Factory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// $Id: Factory.php 7657 2019-04-12 21:26:58Z markus $
// $Id: Factory.php 8834 2024-08-25 14:52:29Z markus $
declare(strict_types=1);

namespace MG\Sepa\Validator;
Expand All @@ -23,7 +23,7 @@ public function getValidator(string $type) : Validator
$validatorName = '\\MG\\Sepa\\Validator\\' . $type;
if (!class_exists($validatorName))
{
throw new \MG\Exception('Unknown type: ' . $type);
throw new Exception('Unknown type: ' . $type, Exception::NO_VALID_VALIDATOR);
}
if (!isSet($validators[$type]))
{
Expand Down
3 changes: 1 addition & 2 deletions vendor/lib/Sepa/Xml.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?php
// $Id: Xml.php 8745 2024-03-28 17:08:31Z markus $
// $Id: Xml.php 8833 2024-08-25 14:48:13Z markus $
declare(strict_types=1);

namespace MG\Sepa;

use \MG\Exception;
use \MG\Sepa;
use \MG\Sepa\Xml\Exception as XmlException;

Expand Down
10 changes: 5 additions & 5 deletions vendor/lib/Sepa/Xml/Exception.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// $Id: Exception.php 7657 2019-04-12 21:26:58Z markus $
// $Id: Exception.php 8835 2024-08-25 14:54:15Z markus $
declare(strict_types=1);

namespace MG\Sepa\Xml;
Expand All @@ -11,9 +11,9 @@
* @since 2017-06-13
* @uses \Exception
*/
class Exception extends \MG\Exception
class Exception extends \Exception
{
const CANNOT_OPEN_TMP_FILE = 4100;
const CANNOT_CREATE_XML = 4200;
const SCHEMA_FILE_NOT_FOUND = 4300;
const CANNOT_OPEN_TMP_FILE = 5100;
const CANNOT_CREATE_XML = 5200;
const SCHEMA_FILE_NOT_FOUND = 5300;
}

0 comments on commit e6913dc

Please sign in to comment.