ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
BySize.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 
31 class BySize extends AbstractBaseSorter implements CollectionSorter
32 {
33  protected function sortResourceIdentification(array $identifications): array
34  {
35  usort($identifications, function (ResourceIdentification $a, ResourceIdentification $b): int {
36  $a_size = $this->resource_builder->get($a)->getCurrentRevision()->getInformation()->getSize();
37  $b_size = $this->resource_builder->get($b)->getCurrentRevision()->getInformation()->getSize();
38  return $a_size - $b_size;
39  });
40  return $identifications;
41  }
42 }
sortResourceIdentification(array $identifications)
Definition: BySize.php:33
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples