Skip to content

Commit 84c584e

Browse files
authored
Merge pull request #535 from bobvandevijver/modern-callables
Use modern first class callable syntax
2 parents 601c536 + 3d6263b commit 84c584e

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/ElFinder/ElFinder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct($opts)
4646
if (defined('E_DEPRECATED')) {
4747
$errLevel |= E_DEPRECATED | E_USER_DEPRECATED;
4848
}
49-
set_error_handler('elFinder::phpErrorHandler', $errLevel);
49+
set_error_handler(elFinder::phpErrorHandler(...), $errLevel);
5050

5151
// Associative array of files to delete at the end of script: ['temp file path' => true]
5252
$GLOBALS['elFinderTempFiles'] = [];
@@ -195,7 +195,7 @@ public function __construct($opts)
195195
$doRegist = (false !== strpos($cmd, '*'));
196196

197197
if (!$doRegist) {
198-
$doRegist = ($_reqCmd && in_array($_reqCmd, array_map('elFinder::getCmdOfBind', explode(' ', $cmd))));
198+
$doRegist = ($_reqCmd && in_array($_reqCmd, array_map(elFinder::getCmdOfBind(...), explode(' ', $cmd))));
199199
}
200200

201201
if ($doRegist) {
@@ -215,7 +215,7 @@ public function __construct($opts)
215215
if (0 === strcasecmp($_domain, 'plugin')) {
216216
if ($plugin = $this->getPluginInstance($_name, $opts['plugin'][$_name] ?? []) and
217217
method_exists($plugin, $_method)) {
218-
$this->bind($cmd, [$plugin, $_method]);
218+
$this->bind($cmd, $plugin->$_method(...));
219219
}
220220
}
221221
} else {

src/Twig/Extension/FMElfinderExtension.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ public function getFunctions(): array
2828
$options = ['is_safe' => ['html']];
2929

3030
return [
31-
new TwigFunction('elfinder_tinymce_init', [$this, 'tinymce'], $options),
32-
new TwigFunction('elfinder_tinymce_init4', [$this, 'tinymce4'], $options),
33-
new TwigFunction('elfinder_tinymce_init5', [$this, 'tinymce5'], $options),
34-
new TwigFunction('elfinder_summernote_init', [$this, 'summernote'], $options),
31+
new TwigFunction('elfinder_tinymce_init', $this->tinymce(...), $options),
32+
new TwigFunction('elfinder_tinymce_init4', $this->tinymce4(...), $options),
33+
new TwigFunction('elfinder_tinymce_init5', $this->tinymce5(...), $options),
34+
new TwigFunction('elfinder_summernote_init', $this->summernote(...), $options),
3535
];
3636
}
3737

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
$loader = require $file;
1010

11-
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
11+
AnnotationRegistry::registerLoader($loader->loadClass(...));

0 commit comments

Comments
 (0)