class-bytetransformer.php
2 weeks ago
class-checksumtransformer.php
2 weeks ago
class-deflatetransformer.php
2 weeks ago
class-inflatetransformer.php
2 weeks ago
class-bytetransformer.php
29 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WordPress\ByteStream\ByteTransformer; |
| 4 | |
| 5 | /** |
| 6 | * Interface for transforming byte streams. |
| 7 | * |
| 8 | * Implementations of this interface can be used to transform byte streams |
| 9 | * in various ways, such as computing a checksum, decrypting, etc. |
| 10 | */ |
| 11 | interface ByteTransformer { |
| 12 | |
| 13 | /** |
| 14 | * Appends bytes to the filter and transforms them. |
| 15 | * |
| 16 | * @param string $bytes The bytes to append. |
| 17 | * |
| 18 | * @return string|false The filtered bytes, or false if no bytes were filtered. |
| 19 | */ |
| 20 | public function filter_bytes( string $bytes ); |
| 21 | |
| 22 | /** |
| 23 | * Flushes the filter and returns the last chunk of data. |
| 24 | * |
| 25 | * @return string The last chunk of data. |
| 26 | */ |
| 27 | public function flush(): string; |
| 28 | } |
| 29 |