Moved Bencode implementation into its own namespace.

This commit is contained in:
flash 2024-07-31 19:10:26 +00:00
parent 4a40868f58
commit 4d41d3218e
6 changed files with 11 additions and 11 deletions

View file

@ -1 +1 @@
0.2407.311904
0.2407.311910

View file

@ -1,9 +1,9 @@
<?php
// Bencode.php
// Created: 2022-01-13
// Updated: 2023-09-15
// Updated: 2024-07-31
namespace Index\Serialisation;
namespace Index\Bencode;
use InvalidArgumentException;
use RuntimeException;

View file

@ -1,9 +1,9 @@
<?php
// IBencodeSerialisable.php
// Created: 2022-01-13
// Updated: 2022-02-02
// Updated: 2024-07-31
namespace Index\Serialisation;
namespace Index\Bencode;
/**
* Provides an interface for serialising objects for bencoding in a controlled manner.

View file

@ -1,15 +1,15 @@
<?php
// BencodedContent.php
// Created: 2022-02-10
// Updated: 2023-07-21
// Updated: 2024-07-31
namespace Index\Http\Content;
use Stringable;
use Index\Bencode\Bencode;
use Index\Bencode\IBencodeSerialisable;
use Index\IO\Stream;
use Index\IO\FileStream;
use Index\Serialisation\Bencode;
use Index\Serialisation\IBencodeSerialisable;
class BencodedContent implements Stringable, IHttpContent, IBencodeSerialisable {
private mixed $content;

View file

@ -1,13 +1,13 @@
<?php
// BencodeContentHandler.php
// Created: 2024-03-28
// Updated: 2024-03-28
// Updated: 2024-07-31
namespace Index\Http\ContentHandling;
use Index\Bencode\IBencodeSerialisable;
use Index\Http\HttpResponseBuilder;
use Index\Http\Content\BencodedContent;
use Index\Serialisation\IBencodeSerialisable;
class BencodeContentHandler implements IContentHandler {
public function match(mixed $content): bool {

View file

@ -7,7 +7,7 @@ declare(strict_types=1);
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Attributes\CoversClass;
use Index\Serialisation\Bencode;
use Index\Bencode\Bencode;
#[CoversClass(Bencode::class)]
final class BencodeTest extends TestCase {