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

Method depthOf

src/FileRise/Domain/DiskUsageModel.php:976–982  ·  view source on GitHub ↗

* Helper: approximate depth of a folder key (root->0, "foo"->1, "foo/bar"->2, etc.) */

(string $key)

Source from the content-addressed store, hash-verified

974 * Helper: approximate depth of a folder key (root->0, "foo"->1, "foo/bar"->2, etc.)
975 */
976 private static function depthOf(string $key): int
977 {
978 if ($key === '' || $key === 'root') {
979 return 0;
980 }
981 return substr_count(trim($key, '/'), '/') + 1;
982 }
983}

Callers 1

buildSnapshotMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected