Skip to content

Commit 2a4184f

Browse files
committed
Add JSONModelInterface
Add abstract JSONModelValidationException to implement modules working independent of the configuration
1 parent 8a6a38d commit 2a4184f

File tree

5 files changed

+45
-6
lines changed

5 files changed

+45
-6
lines changed

src/Exception/ErrorRegistryException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44

55
namespace PHPModelGenerator\Exception;
66

7-
use Exception;
8-
97
/**
108
* Class ErrorRegistryException
119
*
1210
* @package PHPModelGeneratorException
1311
*/
14-
class ErrorRegistryException extends Exception implements ErrorRegistryExceptionInterface
12+
class ErrorRegistryException extends JSONModelValidationException implements ErrorRegistryExceptionInterface
1513
{
1614
protected $errors = [];
1715

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types = 1);
4+
5+
namespace PHPModelGenerator\Exception;
6+
7+
use Exception;
8+
9+
/**
10+
* Class JSONModelValidationException
11+
*
12+
* @package PHPModelGenerator\Exception
13+
*/
14+
abstract class JSONModelValidationException extends Exception
15+
{
16+
}

src/Exception/ValidationException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44

55
namespace PHPModelGenerator\Exception;
66

7-
use Exception;
8-
97
/**
108
* Class ValidationException
119
*
1210
* @package PHPModelGeneratorException
1311
*/
14-
class ValidationException extends Exception
12+
class ValidationException extends JSONModelValidationException
1513
{
1614
}

src/Interfaces/JSONModelInterface.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types = 1);
4+
5+
namespace PHPModelGenerator\Interfaces;
6+
7+
/**
8+
* Interface JSONModelInterface
9+
*
10+
* @package PHPModelGenerator\Interfaces
11+
*/
12+
interface JSONModelInterface
13+
{
14+
/**
15+
* Get the raw input used to set up the model
16+
*
17+
* @return array
18+
*/
19+
public function getRawModelDataInput(): array;
20+
}

src/Interfaces/SerializationInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
<?php
22

3+
declare(strict_types = 1);
4+
35
namespace PHPModelGenerator\Interfaces;
46

7+
/**
8+
* Interface SerializationInterface
9+
*
10+
* @package PHPModelGenerator\Interfaces
11+
*/
512
interface SerializationInterface
613
{
714
/**

0 commit comments

Comments
 (0)