@@ -46,24 +46,16 @@ public function getImages()
46
46
47
47
switch ($ this ->options ->sort ) {
48
48
case Options::SORT_FILE :
49
- usort ($ images , function ($ a , $ b ) {
50
- return Sort::strcmp ($ a ->getFilename (), $ b ->getFilename ());
51
- });
49
+ usort ($ images , static fn ($ a , $ b ) => Sort::strcmp ($ a ->getFilename (), $ b ->getFilename ()));
52
50
break ;
53
51
case Options::SORT_CTIME :
54
- usort ($ images , function ($ a , $ b ) {
55
- return $ a ->getCreated () - $ b ->getCreated ();
56
- });
52
+ usort ($ images , static fn ($ a , $ b ) => $ a ->getCreated () - $ b ->getCreated ());
57
53
break ;
58
54
case Options::SORT_MTIME :
59
- usort ($ images , function ($ a , $ b ) {
60
- return $ a ->getModified () - $ b ->getModified ();
61
- });
55
+ usort ($ images , static fn ($ a , $ b ) => $ a ->getModified () - $ b ->getModified ());
62
56
break ;
63
57
case Options::SORT_TITLE :
64
- usort ($ images , function ($ a , $ b ) {
65
- return Sort::strcmp ($ a ->getTitle (), $ b ->getTitle ());
66
- });
58
+ usort ($ images , static fn ($ a , $ b ) => Sort::strcmp ($ a ->getTitle (), $ b ->getTitle ()));
67
59
break ;
68
60
case Options::SORT_RANDOM :
69
61
shuffle ($ images );
0 commit comments