From a081e08629522015299140f3ebacdb27258ee7a3 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Tue, 7 Jan 2025 17:15:07 +1300 Subject: [PATCH] FIX Stop using deprecated API (#457) * FIX Stop using deprecated API * ENH Minor refactor to remove PHP 5.* condition --- src/DataObjects/QueuedJobDescriptor.php | 2 +- src/Jobs/DoormanQueuedJobTask.php | 1 - src/Services/JobErrorHandler.php | 9 ++------- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/DataObjects/QueuedJobDescriptor.php b/src/DataObjects/QueuedJobDescriptor.php index 1012a3f5..1467f5b7 100644 --- a/src/DataObjects/QueuedJobDescriptor.php +++ b/src/DataObjects/QueuedJobDescriptor.php @@ -243,7 +243,7 @@ protected function getJobDir() // make sure our temp dir is in place. This is what will be inotify watched $jobDir = Config::inst()->get(QueuedJobService::class, 'cache_dir'); if ($jobDir[0] !== '/') { - $jobDir = TEMP_FOLDER . '/' . $jobDir; + $jobDir = TEMP_PATH . '/' . $jobDir; } if (!is_dir($jobDir ?? '')) { diff --git a/src/Jobs/DoormanQueuedJobTask.php b/src/Jobs/DoormanQueuedJobTask.php index e77f4008..4b9867c4 100644 --- a/src/Jobs/DoormanQueuedJobTask.php +++ b/src/Jobs/DoormanQueuedJobTask.php @@ -2,7 +2,6 @@ namespace Symbiote\QueuedJobs\Jobs; -use SilverStripe\Dev\Deprecation; use AsyncPHP\Doorman\Cancellable; use AsyncPHP\Doorman\Expires; use AsyncPHP\Doorman\Process; diff --git a/src/Services/JobErrorHandler.php b/src/Services/JobErrorHandler.php index 9559ef7a..f757df3b 100644 --- a/src/Services/JobErrorHandler.php +++ b/src/Services/JobErrorHandler.php @@ -25,14 +25,9 @@ public function clear() public function handleError($errno, $errstr, $errfile, $errline) { if (error_reporting()) { - // Don't throw E_DEPRECATED in PHP 5.3+ - if (defined('E_DEPRECATED')) { - if ($errno == E_DEPRECATED || $errno == E_USER_DEPRECATED) { - return; - } - } - switch ($errno) { + case E_DEPRECATED: + case E_USER_DEPRECATED: case E_NOTICE: case E_USER_NOTICE: case E_STRICT: