(array $props)
| 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 | { |
no test coverage detected