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

[5.x] Use #[\Override] PHP Attribute to detect breaking changes #1506

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
"nesbot/carbon": "^2.17|^3.0",
"ramsey/uuid": "^4.0",
"symfony/console": "^6.0|^7.0",
"symfony/process": "^6.0|^7.0",
"symfony/error-handler": "^6.0|^7.0"
"symfony/error-handler": "^6.0|^7.0",
"symfony/polyfill-php83": "^1.28",
"symfony/process": "^6.0|^7.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
Expand Down
9 changes: 9 additions & 0 deletions src/RedisQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function readyNow($queue = null)
* @param string|null $queue
* @return mixed
*/
#[\Override]
public function push($job, $data = '', $queue = null)
{
return $this->enqueueUsing(
Expand All @@ -62,6 +63,7 @@ function ($payload, $queue) use ($job) {
* @param array $options
* @return mixed
*/
#[\Override]
public function pushRaw($payload, $queue = null, array $options = [])
{
$payload = (new JobPayload($payload))->prepare($this->lastPushed);
Expand All @@ -81,6 +83,7 @@ public function pushRaw($payload, $queue = null, array $options = [])
* @param mixed $data
* @return array
*/
#[\Override]
protected function createPayloadArray($job, $queue, $data = '')
{
$payload = parent::createPayloadArray($job, $queue, $data);
Expand All @@ -99,6 +102,7 @@ protected function createPayloadArray($job, $queue, $data = '')
* @param string $queue
* @return mixed
*/
#[\Override]
public function later($delay, $job, $data = '', $queue = null)
{
$payload = (new JobPayload($this->createPayload($job, $queue, $data)))->prepare($job)->value;
Expand Down Expand Up @@ -126,8 +130,10 @@ function ($payload, $queue, $delay) {
* Pop the next job off of the queue.
*
* @param string $queue
* @param int $index
* @return \Illuminate\Contracts\Queue\Job|null
*/
#[\Override]
public function pop($queue = null, $index = 0)
{
return tap(parent::pop($queue, $index), function ($result) use ($queue) {
Expand All @@ -144,6 +150,7 @@ public function pop($queue = null, $index = 0)
* @param string $to
* @return void
*/
#[\Override]
public function migrateExpiredJobs($from, $to)
{
return tap(parent::migrateExpiredJobs($from, $to), function ($jobs) use ($to) {
Expand All @@ -158,6 +165,7 @@ public function migrateExpiredJobs($from, $to)
* @param \Illuminate\Queue\Jobs\RedisJob $job
* @return void
*/
#[\Override]
public function deleteReserved($queue, $job)
{
parent::deleteReserved($queue, $job);
Expand All @@ -173,6 +181,7 @@ public function deleteReserved($queue, $job)
* @param int $delay
* @return void
*/
#[\Override]
public function deleteAndRelease($queue, $job, $delay)
{
parent::deleteAndRelease($queue, $job, $delay);
Expand Down
1 change: 1 addition & 0 deletions src/SupervisorProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public function __construct(SupervisorOptions $options, $process, Closure $outpu
*
* @return void
*/
#[\Override]
public function monitor()
{
if (! $this->process->isStarted()) {
Expand Down