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

Method propsToStat

src/FileRise/Storage/WebDavAdapter.php:458–476  ·  view source on GitHub ↗
(array $props)

Source from the content-addressed store, hash-verified

456 }
457
458 private function propsToStat(array $props): array
459 {
460 $type = 'file';
461 $resType = $props['{DAV:}resourcetype'] ?? null;
462 if ($this->isCollection($resType)) {
463 $type = 'dir';
464 }
465
466 $size = isset($props['{DAV:}getcontentlength']) ? (int)$props['{DAV:}getcontentlength'] : 0;
467 $mtimeRaw = (string)($props['{DAV:}getlastmodified'] ?? '');
468 $mtime = $mtimeRaw !== '' ? (int)(strtotime($mtimeRaw) ?: 0) : 0;
469
470 return [
471 'type' => $type,
472 'size' => $size,
473 'mtime' => $mtime,
474 'mode' => 0,
475 ];
476 }
477
478 private function request(string $method, string $url, $body = null, array $headers = []): int
479 {

Callers 2

listMethod · 0.95
statMethod · 0.95

Calls 1

isCollectionMethod · 0.95

Tested by

no test coverage detected