File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 44
55namespace PetrKnap \Binary ;
66
7+ use Stringable ;
8+
79/**
810 * @internal shared logic
911 */
10- abstract class Coder
12+ abstract class Coder implements Stringable
1113{
14+ /**
15+ * @param string $data may contain binary data
16+ */
1217 final public function __construct (
1318 public readonly string $ data = '' ,
1419 ) {
@@ -20,7 +25,7 @@ final public function withData(string $data): static
2025 }
2126
2227 /**
23- * @deprecated use readonly property $data
28+ * @deprecated use readonly property {@see self:: $data}
2429 */
2530 final public function getData (): string
2631 {
@@ -61,4 +66,12 @@ abstract public function xz(): static;
6166 * @throws Coder\Exception\CoderException
6267 */
6368 abstract public function zlib (): static ;
69+
70+ /**
71+ * @note this is just a helper, this class is not supposed to implement {@see BinariableInterface}
72+ */
73+ public function __toString (): string
74+ {
75+ return $ this ->data ;
76+ }
6477}
You can’t perform that action at this time.
0 commit comments