Sorts files and directories by extension.
This can be slow as all the matching files and directories must be retrieved for comparison.
$this
SortableIterator
public function sortByExtension() : static { $this->sort = SortableIterator::SORT_BY_EXTENSION; return $this; }