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 <?php
// Bencode.php // Bencode.php
// Created: 2022-01-13 // Created: 2022-01-13
// Updated: 2023-09-15 // Updated: 2024-07-31
namespace Index\Serialisation; namespace Index\Bencode;
use InvalidArgumentException; use InvalidArgumentException;
use RuntimeException; use RuntimeException;

View file

@ -1,9 +1,9 @@
<?php <?php
// IBencodeSerialisable.php // IBencodeSerialisable.php
// Created: 2022-01-13 // 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. * Provides an interface for serialising objects for bencoding in a controlled manner.

View file

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

View file

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

View file

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