elseif (self::SORT_BY_TYPE ===
$sort) { $this->sort =
static function D\SplFileInfo
$a, \SplFileInfo
$b) use ($order) { if ($a->
isDir() &&
$b->
isFile()) { return -
$order;
} elseif ($a->
isFile() &&
$b->
isDir()) { return $order;
} return $order *
strcmp($a->
getRealPath() ?:
$a->
getPathname(),
$b->
getRealPath() ?:
$b->
getPathname());
};
} elseif (self::SORT_BY_ACCESSED_TIME ===
$sort) { $this->sort =
static fn (\SplFileInfo
$a, \SplFileInfo
$b) =>
$order *
($a->
getATime() -
$b->
getATime());
} elseif (self::SORT_BY_CHANGED_TIME ===
$sort) { $this->sort =
static fn (\SplFileInfo
$a, \SplFileInfo
$b) =>
$order *
($a->
getCTime() -
$b->
getCTime());
} elseif (self::SORT_BY_MODIFIED_TIME ===
$sort) { $this->sort =
static fn (\SplFileInfo
$a, \SplFileInfo
$b) =>
$order *
($a->
getMTime() -
$b->
getMTime());
} elseif (self::SORT_BY_EXTENSION ===
$sort) { $this->sort =
static fn (\SplFileInfo
$a, \SplFileInfo
$b) =>
$order *
strnatcmp($a->
getExtension(),
$b->
getExtension());
} elseif (self::SORT_BY_SIZE ===
$sort) { $this->sort =
static fn (\SplFileInfo
$a, \SplFileInfo
$b) =>
$order *
($a->
getSize() -
$b->
getSize());
} elseif (self::SORT_BY_NONE ===
$sort) { $this->sort =
$order;
} elseif (\
is_callable($sort)) {