Skip to content

Commit

Permalink
[5.x] Use #[\Override] PHP Attribute to detect breaking changes
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Oct 9, 2024
1 parent cfbc5af commit f424b95
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
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

0 comments on commit f424b95

Please sign in to comment.