Important: #110540 - File collector sorting uses an enum 

See forge#110540

Description 

The sorting order passed to \TYPO3\CMS\Frontend\Resource\FileCollector->sort() is no longer a plain string but the new enum \TYPO3\CMS\Frontend\Resource\FileCollectionSorting with the cases Ascending , Descending and Random .

FileCollector is marked as @internal , so this is not treated as a breaking change. Extensions calling sort() directly must nevertheless adapt their code:

// before
$fileCollector->sort('title', 'descending');

// after
$fileCollector->sort('title', FileCollectionSorting::Descending);

// when the value comes from configuration or user input
$fileCollector->sort(
    'title',
    FileCollectionSorting::fromKeyword($direction),
);
Copied!

FileCollectionSorting::fromKeyword() resolves both the short and the long keywords ( asc , ascending , desc , descending , rand , random ) case-insensitively, and throws a \ValueError for anything else.

The TypoScript option sorting.direction of the FILES content object and of the files data processor keeps accepting the same keywords as before. An unknown keyword is no longer silently treated as "ascending" though, but now results in a \ValueError .