diff options
| author | Appleman1234 <applemansigloo@gmail.com> | 2022-09-25 13:30:13 +1000 |
|---|---|---|
| committer | Appleman1234 <applemansigloo@gmail.com> | 2022-09-25 13:30:13 +1000 |
| commit | 2c69095a1edf7474073451285238659d0f62ce3f (patch) | |
| tree | 5dee476605402c66dc2853d0836b29f6aedae62b /tools/benchmark.php | |
| parent | e9a61e2fbbd930eaa80d6a5f33420cedc59d748c (diff) | |
PHP8.1 fixes from Rector
Diffstat (limited to 'tools/benchmark.php')
| -rwxr-xr-x | tools/benchmark.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/benchmark.php b/tools/benchmark.php index ed7c200d..0bf38509 100755 --- a/tools/benchmark.php +++ b/tools/benchmark.php @@ -5,17 +5,17 @@ * */ -require dirname(__FILE__) . '/inc/cli.php'; +require __DIR__ . '/inc/cli.php'; require 'inc/image.php'; // move back to this directory -chdir(dirname(__FILE__)); +chdir(__DIR__); -if(count($argv) != 2) +if((is_countable($argv) ? count($argv) : 0) != 2) die("Usage: {$argv[0]} [file]\n"); $file = $argv[1]; -$extension = strtolower(substr($file, strrpos($file, '.') + 1)); +$extension = strtolower(substr((string) $file, strrpos((string) $file, '.') + 1)); $out = tempnam($config['tmp'], 'thumb'); $count = 300; @@ -30,7 +30,7 @@ function benchmark($method) { for($i = 0; $i < $count; $i++) { $image = new Image($file, $extension); $thumb = $image->resize( - $config['thumb_ext'] ? $config['thumb_ext'] : $extension, + $config['thumb_ext'] ?: $extension, $config['thumb_width'], $config['thumb_height'] ); |
