Open
Description
Expected Behavior
No deprecation notices
Current Behavior
PHP outputs deprecation notices due to undefined class properties that are later assigned.
PHP Deprecated: Creation of dynamic property Resque_Worker::$logLevel is deprecated in
...phplib\vendor\resque\php-resque\bin\resque on line 173
$worker->logLevel = $logLevel;
PHP Deprecated: Creation of dynamic property Resque_Redis::$driver is deprecated in
...phplib\vendor\resque\php-resque\lib\Resque\Redis.php on line 134
$this->driver = new Credis_Client($host, $port, $timeout, $persistent);
and probably elsewhere.
Possible Solution
declare the class properties, eg:
class Resque_Worker {
...
public $logLevel
}
class Resque_Redis
{
...
private $driver; // unsure what visibility is actually needed
}
Context
In this instance I am setting up a worker script that includes vendor/bin/resque, eg:
require __DIR__."/config.php";
require __DIR__ . '/../phplib/vendor/bin/resque';
My Environment
This should happen regardless of environment
- PHP-Resque version: "resque/php-resque": "^1.3"
- PHP version: 8.2.9
- Redis version: 7.2
- Server type and version: php internal web server / phpstorm
- Operating System and version: windows 11