Skip to content

Remove $middlewareDefinitions from QueueInterface::push()#273

Merged
viktorprogger merged 4 commits intomasterfrom
rm-push-middlewares
May 1, 2026
Merged

Remove $middlewareDefinitions from QueueInterface::push()#273
viktorprogger merged 4 commits intomasterfrom
rm-push-middlewares

Conversation

@vjik
Copy link
Copy Markdown
Member

@vjik vjik commented Apr 29, 2026

Q A
Is bugfix?
New feature?
Breaks BC? ✔️
Tests pass? ✔️

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.82%. Comparing base (42e0b04) to head (9d88450).

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #273   +/-   ##
=========================================
  Coverage     98.82%   98.82%           
- Complexity      313      314    +1     
=========================================
  Files            46       47    +1     
  Lines           853      854    +1     
=========================================
+ Hits            843      844    +1     
  Misses           10       10           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vjik vjik requested a review from a team April 29, 2026 13:56
@vjik vjik added the status:code review The pull request needs review. label Apr 29, 2026
Comment thread docs/guide/en/usage.md
```php
$delayMiddleware = $container->get(\Yiisoft\Queue\Middleware\Push\Implementation\DelayMiddlewareInterface::class);
$queue->push($message, $delayMiddleware->withDelay(5 * 60));
$queue->withMiddlewaresAdded($delayMiddleware->withDelay(5 * 60))->push($message);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

withMiddlewaresAdded() isn't part of the queue interface.

@samdark
Copy link
Copy Markdown
Member

samdark commented Apr 30, 2026

// new:
$queue->withMiddlewaresAdded($delayMiddleware->withDelay(5 * 60))->push($message);

// vs old:

$queue->push($message, $delayMiddleware->withDelay(5 * 60));

The middleware is still there, but end-user syntax was changed for the worse. Also, withMiddlewaresAdded() is not part of the queue interface.

@viktorprogger viktorprogger merged commit 0a946f7 into master May 1, 2026
2 checks passed
@viktorprogger viktorprogger deleted the rm-push-middlewares branch May 1, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:code review The pull request needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants