1 | <?php |
||
22 | abstract class AbstractFileBlob |
||
23 | { |
||
24 | /** |
||
25 | * @var ContentTypeAttribute |
||
26 | */ |
||
27 | protected $contentType; |
||
28 | |||
29 | /** |
||
30 | * @var ExtensionAttribute |
||
31 | */ |
||
32 | protected $extension; |
||
33 | |||
34 | /** |
||
35 | * @param ContentTypeAttribute|null $contentType |
||
36 | * @param ExtensionAttribute|null $extension |
||
37 | */ |
||
38 | public function __construct(ContentTypeAttribute $contentType = null, ExtensionAttribute $extension = null) |
||
43 | |||
44 | /** |
||
45 | * @return string |
||
46 | */ |
||
47 | public function __toString(): string |
||
51 | |||
52 | public function getContentType(): ContentTypeAttribute |
||
56 | |||
57 | public function hasContentType(): bool |
||
61 | |||
62 | public function getExtension(): ExtensionAttribute |
||
66 | |||
67 | public function hasExtension(): bool |
||
71 | |||
72 | public function getContents(): ?string |
||
76 | |||
77 | public function hasContents(): bool |
||
81 | |||
82 | /** |
||
83 | * @param string $contents |
||
84 | * @param bool $append |
||
85 | * |
||
86 | * @return FileInterface |
||
87 | */ |
||
88 | public function setContents(string $contents = '', bool $append = false): FileInterface |
||
94 | |||
95 | /** |
||
96 | * @return int |
||
97 | */ |
||
98 | public function getContentsLength(): int |
||
102 | |||
103 | public function hasFile(): bool |
||
107 | |||
108 | /** |
||
109 | * @return null|string |
||
110 | */ |
||
111 | abstract protected function doGetContents(): ?string; |
||
112 | |||
113 | /** |
||
114 | * @param string $contents |
||
115 | * @param bool $append |
||
116 | */ |
||
117 | abstract protected function doSetContents(string $contents, bool $append): void; |
||
118 | } |
||
119 |