Skip to content

Commit 6398fc8

Browse files
committed
Revert "refactor: removed interfaces for abstract classes"
This reverts commit 5ba2dd7.
1 parent 4e0a7ea commit 6398fc8

File tree

4 files changed

+36
-12
lines changed

4 files changed

+36
-12
lines changed

src/Coder/Coder.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88

99
abstract class Coder implements CoderInterface
1010
{
11-
/**
12-
* @throws Exception\CoderCouldNotEncodeData
13-
*/
1411
public function encode(string $decoded): string
1512
{
1613
try {
@@ -23,9 +20,6 @@ public function encode(string $decoded): string
2320
}
2421
}
2522

26-
/**
27-
* @throws Exception\CoderCouldNotDecodeData
28-
*/
2923
public function decode(string $encoded): string
3024
{
3125
try {

src/Coder/CoderInterface.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PetrKnap\Binary\Coder;
6+
7+
interface CoderInterface
8+
{
9+
/**
10+
* @throws Exception\CoderCouldNotEncodeData
11+
*/
12+
public function encode(string $decoded): string;
13+
14+
/**
15+
* @throws Exception\CoderCouldNotDecodeData
16+
*/
17+
public function decode(string $encoded): string;
18+
}

src/Serializer/Serializer.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88

99
abstract class Serializer implements SerializerInterface
1010
{
11-
/**
12-
* @throws Exception\SerializerCouldNotSerializeData
13-
*/
1411
public function serialize(mixed $serializable): string
1512
{
1613
try {
@@ -23,9 +20,6 @@ public function serialize(mixed $serializable): string
2320
}
2421
}
2522

26-
/**
27-
* @throws Exception\SerializerCouldNotUnserializeData
28-
*/
2923
public function unserialize(string $serialized): mixed
3024
{
3125
try {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PetrKnap\Binary\Serializer;
6+
7+
interface SerializerInterface
8+
{
9+
/**
10+
* @throws Exception\SerializerCouldNotSerializeData
11+
*/
12+
public function serialize(mixed $serializable): string;
13+
14+
/**
15+
* @throws Exception\SerializerCouldNotUnserializeData
16+
*/
17+
public function unserialize(string $serialized): mixed;
18+
}

0 commit comments

Comments
 (0)