Skip to content

Commit

Permalink
Merge pull request #10 from petrknap/chores
Browse files Browse the repository at this point in the history
Chores
  • Loading branch information
petrknap authored Apr 21, 2024
2 parents 307049b + b43b4ae commit 12ab4a5
Show file tree
Hide file tree
Showing 16 changed files with 51 additions and 17 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"scripts": {
"test": "phpunit --colors=always --testdox tests",
"validate": [
"phpcs --colors --standard=PSR12 --exclude=PSR12.Files.OpenTag,PSR12.Files.FileHeader,Generic.Files.LineLength src tests",
"phpcs --colors --standard=PSR12 --exclude=Generic.Files.LineLength src tests",
"phpstan analyse --level max src",
"phpstan analyse --level 5 tests",
"phpinsights analyse src --ansi --no-interaction"
Expand Down
10 changes: 8 additions & 2 deletions src/Binary.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,27 @@

final class Binary
{
public static function encode(string $data): Encoder
public static function encode(string $data): EncoderInterface
{
return new Encoder($data);
}

public static function decode(string $data): Decoder
public static function decode(string $data): DecoderInterface
{
return new Decoder($data);
}

/**
* @see Serializer::serialize()
*/
public static function serialize(mixed $data): string
{
return (new Serializer())->serialize(serializable: $data);
}

/**
* @see Serializer::unserialize()
*/
public static function unserialize(string $data): mixed
{
return (new Serializer())->unserialize(serialized: $data);
Expand Down
4 changes: 3 additions & 1 deletion tests/ByterTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace PetrKnap\Binary;

Expand Down
4 changes: 3 additions & 1 deletion tests/Coder/Base64Test.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace PetrKnap\Binary\Coder;

Expand Down
4 changes: 3 additions & 1 deletion tests/Coder/ChecksumTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace PetrKnap\Binary\Coder;

Expand Down
4 changes: 3 additions & 1 deletion tests/Coder/CoderTestCase.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace PetrKnap\Binary\Coder;

Expand Down
4 changes: 3 additions & 1 deletion tests/Coder/HexTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace PetrKnap\Binary\Coder;

Expand Down
4 changes: 3 additions & 1 deletion tests/Coder/NoCoderTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace PetrKnap\Binary\Coder;

Expand Down
4 changes: 3 additions & 1 deletion tests/Coder/ZlibTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace PetrKnap\Binary\Coder;

Expand Down
4 changes: 3 additions & 1 deletion tests/DecoderTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace PetrKnap\Binary;

Expand Down
4 changes: 3 additions & 1 deletion tests/EncoderTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace PetrKnap\Binary;

Expand Down
4 changes: 3 additions & 1 deletion tests/ReadmeTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace PetrKnap\Binary;

Expand Down
4 changes: 3 additions & 1 deletion tests/Serializer/IgbinaryTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace PetrKnap\Binary\Serializer;

Expand Down
4 changes: 3 additions & 1 deletion tests/Serializer/PhpTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace PetrKnap\Binary\Serializer;

Expand Down
4 changes: 3 additions & 1 deletion tests/Serializer/SerializerTestCase.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace PetrKnap\Binary\Serializer;

Expand Down
4 changes: 3 additions & 1 deletion tests/SerializerTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace PetrKnap\Binary;

Expand Down

0 comments on commit 12ab4a5

Please sign in to comment.