Skip to content

Commit a1beea8

Browse files
committed
Move exceptions
Change namespace Add SerializationInterface
1 parent 5fb5f24 commit a1beea8

File tree

7 files changed

+30
-10
lines changed

7 files changed

+30
-10
lines changed

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "wol-soft/php-json-schema-model-generator-exception",
3-
"homepage": "https://github.com/wol-soft/php-json-schema-model-generator-exception",
4-
"description": "Provides exceptions to use php-json-schema-model-generator as dev dependency\n\n",
2+
"name": "wol-soft/php-json-schema-model-generator-production",
3+
"homepage": "https://github.com/wol-soft/php-json-schema-model-generator-production",
4+
"description": "Provides the production code required to use php-json-schema-model-generator as dev dependency",
55
"type": "library",
66
"license": "MIT",
77
"authors": [
@@ -18,12 +18,12 @@
1818
},
1919
"autoload": {
2020
"psr-4": {
21-
"PHPModelGeneratorException\\": "src"
21+
"PHPModelGenerator\\": "src"
2222
}
2323
},
2424
"autoload-dev": {
2525
"psr-4": {
26-
"PHPModelGeneratorException\\Tests\\": "tests"
26+
"PHPModelGenerator\\Tests\\": "tests"
2727
}
2828
}
2929
}

src/ErrorRegistryException.php renamed to src/Exception/ErrorRegistryException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types = 1);
44

5-
namespace PHPModelGeneratorException;
5+
namespace PHPModelGenerator\Exception;
66

77
use Exception;
88

src/ErrorRegistryExceptionInterface.php renamed to src/Exception/ErrorRegistryExceptionInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types = 1);
44

5-
namespace PHPModelGeneratorException;
5+
namespace PHPModelGenerator\Exception;
66

77
use Throwable;
88

src/ValidationException.php renamed to src/Exception/ValidationException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types = 1);
44

5-
namespace PHPModelGeneratorException;
5+
namespace PHPModelGenerator\Exception;
66

77
use Exception;
88

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace PHPModelGenerator\Interfaces;
4+
5+
interface SerializationInterface
6+
{
7+
/**
8+
* Converts the object into an array
9+
*
10+
* @return array
11+
*/
12+
public function toArray(): array;
13+
14+
/**
15+
* Converts the object into a JSON serialized string
16+
*
17+
* @return string
18+
*/
19+
public function toJSON(): string;
20+
}

tests/ErrorRegistryExceptionTest.php renamed to tests/Exception/ErrorRegistryExceptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace PHPModelGeneratorException\Tests;
44

5-
use PHPModelGeneratorException\ErrorRegistryException;
5+
use PHPModelGenerator\Exception\ErrorRegistryException;
66
use PHPUnit\Framework\TestCase;
77

88
/**

tests/ValidationExceptionTest.php renamed to tests/Exception/ValidationExceptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace PHPModelGeneratorException\Tests;
44

5-
use PHPModelGeneratorException\ValidationException;
5+
use PHPModelGenerator\Exception\ValidationException;
66
use PHPUnit\Framework\TestCase;
77

88
/**

0 commit comments

Comments
 (0)