diff --git a/composer.json b/composer.json index 3d87546..e3efe96 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "require": { "php": ">=7.4", "ext-fileinfo": "*", - "cakephp/cakephp": "^4.0", + "cakephp/cakephp": "^4.4", "intervention/image": "^2.4", "mirko-pagliai/me-tools": "~2.23.1", "mirko-pagliai/php-thumber": "~1.5.3" diff --git a/src/Middleware/ThumbnailMiddleware.php b/src/Middleware/ThumbnailMiddleware.php index 8ffe267..3471110 100644 --- a/src/Middleware/ThumbnailMiddleware.php +++ b/src/Middleware/ThumbnailMiddleware.php @@ -15,7 +15,6 @@ */ namespace Thumber\Cake\Middleware; -use Cake\Core\Configure; use Cake\Http\Response; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; @@ -41,16 +40,12 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface /** @var \Cake\Http\ServerRequest $request */ $file = Filesystem::instance()->concatenate(THUMBER_TARGET, base64_decode($request->getParam('basename'))); if (!is_readable($file)) { - throw new ThumbNotFoundException(__d('thumber', 'File `{0}` doesn\'t exist', $file)); + throw new ThumbNotFoundException(__d('thumber', "File `{0}` doesn't exist", $file)); } $response = new Response(); $response = $response->withModified(filemtime($file) ?: 0); - /** - * @todo to be removed in a later version - */ - $method = version_compare(Configure::version(), '4.4', '>=') ? 'isNotModified' : 'checkNotModified'; - if ($response->$method($request)) { + if ($response->isNotModified($request)) { return $response->withNotModified(); } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 364be7d..6ebc622 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -76,11 +76,4 @@ define('THUMBER_TARGET', Configure::read('Thumber.target', TMP . 'thumbs')); $_SERVER['PHP_SELF'] = '/'; -/** - * @todo to be removed in a later version - */ -if (!class_exists('Cake\Console\TestSuite\StubConsoleOutput')) { - class_alias('Cake\TestSuite\Stub\ConsoleOutput', 'Cake\Console\TestSuite\StubConsoleOutput'); -} - echo 'Running tests for "' . getenv('THUMBER_DRIVER') . '" driver ' . PHP_EOL;