Skip to content

Commit 8426ef2

Browse files
splitbraingithub-actions[bot]
authored andcommitted
🤖 Automatic code style fixes
1 parent 2fa9aca commit 8426ef2

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

action/prosemirror.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ public function writeDefaultsToJSINFO(Event $event, $param)
4949
$JSINFO['plugins'] = [];
5050
}
5151
$JSINFO['plugins']['gallery'] = [
52-
'defaults' => array_map(function ($default) {
53-
return ['default' => $default,];
54-
}, $defaults),
52+
'defaults' => array_map(static fn($default) => ['default' => $default,], $defaults),
5553
];
5654
$JSINFO['plugins']['gallery']['defaults']['namespace'] = ['default' => ''];
5755
}

classes/AbstractGallery.php

+4-12
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,16 @@ public function getImages()
4646

4747
switch ($this->options->sort) {
4848
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()));
5250
break;
5351
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());
5753
break;
5854
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());
6256
break;
6357
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()));
6759
break;
6860
case Options::SORT_RANDOM:
6961
shuffle($images);

0 commit comments

Comments
 (0)