MCPcopy Create free account
hub / github.com/error311/FileRise / seedFileContents

Method seedFileContents

src/FileRise/Domain/FileModel.php:3955–3967  ·  view source on GitHub ↗
(string $filename)

Source from the content-addressed store, hash-verified

3953 }
3954
3955 private static function seedFileContents(string $filename): ?string
3956 {
3957 $ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
3958 if ($ext === 'docx') {
3959 $data = base64_decode(self::EMPTY_DOCX_BASE64, true);
3960 return ($data === false) ? null : $data;
3961 }
3962 if ($ext === 'xlsx') {
3963 $data = base64_decode(self::EMPTY_XLSX_BASE64, true);
3964 return ($data === false) ? null : $data;
3965 }
3966 return null;
3967 }
3968
3969 /**
3970 * Create an empty file plus metadata entry.

Callers 1

createFileMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected