Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php 8.2.9 Creation of dynamic property deprecation notices #75

Open
foobarhl opened this issue Aug 25, 2023 · 1 comment
Open

php 8.2.9 Creation of dynamic property deprecation notices #75

foobarhl opened this issue Aug 25, 2023 · 1 comment
Labels

Comments

@foobarhl
Copy link

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
@foobarhl foobarhl added the bug label Aug 25, 2023
@liviocmachado
Copy link

I love this package, for me it always works very well for what I need without having to use frameworks or the like. It would be great to be updated to php 8.2! Congratulations to the developer anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants