-
Notifications
You must be signed in to change notification settings - Fork 79
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
feat: update PHPStan lvl to 5 #91
base: develop
Are you sure you want to change the base?
Conversation
7dfe886
to
9ce7944
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a couple of type changes you can have a look at #92. Or wait until that one is in. It should make a couple things easier.
* @method string get(string $key) | ||
* @method bool exists(string $key) | ||
* @method array smembers(string $set) | ||
* @method bool sismember(string $set, string $key) | ||
* @method bool del(string $key) | ||
* @method void set(string $key, mixed $value) | ||
* @method bool expire(string $key, int $time) | ||
* @method bool ping(?string $value = null) | ||
* @method bool incrby(string $key, int $increment) | ||
* @method bool decrby(string $key, int $decrement) | ||
* @method bool rpush(string $key, string ...$element) | ||
* @method array blpop(string|array $key, int $timeout) | ||
* @method string|bool lpop(string $key, int $count = 1) | ||
* @method string|bool rpop(string $key, int $count = 1) | ||
* @method int rpoplpush(string $source, string $destination) | ||
* @method int|false llen(string $key) | ||
* @method array lrange(string $key, int $start, int $stop) | ||
* @method void zadd(string $key, int $score, mixed ...$value) | ||
* @method int zcard(string $key) | ||
* @method int sadd(string $key, string $member) | ||
* @method int srem(string $key, string $member) | ||
* @method int lrem(string $key, int $count, string $element) | ||
* @method array keys(string $pattern) | ||
* @method int zrem(string $key, string|int ...$member) | ||
* @method array zrangebyscore(string $key, int|string $min, int|string $max, array $options = []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a list sourced from Credis that I put in #94. I think that one is slightly more accurate, considering Credis is the main supported driver
@@ -97,7 +97,8 @@ public function isTracking() | |||
/** | |||
* Update the status indicator for the current job with a new status. | |||
* | |||
* @param int The status of the job (see constants in Resque\Job\Status) | |||
* @param int $status The status of the job (see constants in Resque\Job\Status) | |||
* @param int|null $result The result of the job |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has to be mixed
. $result
can be pretty much anything returned from a Job's perform()
method
/** | ||
* @var object|\Resque\Job\JobInterface Instance of the class performing work for this job. | ||
* @var object|\Resque\Job\JobInterface|null Instance of the class performing work for this job. | ||
*/ | ||
private $instance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be nullable. Where would the NULL come from?
* @param string $prefix The prefix needs to be set for the status key | ||
* @param string $queue The name of the queue to place the job in. | ||
* @param class-string $class The name of the class that contains the code to execute the job. | ||
* @param array|null $args Any optional arguments that should be passed when the job is executed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be null. It should be an empty array for optional cases
This updates the PHPStan check to lvl 5. There are still some unresolved issues and the method types are based on the redis docs so might not be complete.