Skip to content

Replace StubAdapter to InMemoryAdapter + Add stubs to CS Fixer config#285

Merged
vjik merged 7 commits intomasterfrom
in-memory-adapter
May 5, 2026
Merged

Replace StubAdapter to InMemoryAdapter + Add stubs to CS Fixer config#285
vjik merged 7 commits intomasterfrom
in-memory-adapter

Conversation

@vjik
Copy link
Copy Markdown
Member

@vjik vjik commented May 3, 2026

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.39%. Comparing base (c529da1) to head (08bd0e1).

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #285   +/-   ##
=========================================
  Coverage     98.39%   98.39%           
  Complexity      324      324           
=========================================
  Files            48       48           
  Lines           873      873           
=========================================
  Hits            859      859           
  Misses           14       14           

☔ 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 added the status:under development Someone is working on a pull request. label May 3, 2026
@vjik vjik changed the title Add InMemoryAdapter + Add stubs to CS Fixer config Replace StubAdapter to InMemoryAdapter + Add stubs to CS Fixer config May 3, 2026
@vjik vjik added status:code review The pull request needs review. and removed status:under development Someone is working on a pull request. labels May 3, 2026
@vjik vjik requested a review from a team May 3, 2026 18:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the queue package’s testing stubs by replacing the no-op StubAdapter with a functional in-memory adapter and adjusting tooling configs to include the stubs/ directory.

Changes:

  • Replace StubAdapter usage in unit tests with InMemoryAdapter and add dedicated InMemoryAdapter unit tests.
  • Move/standardize the in-memory adapter implementation into the shipped Yiisoft\Queue\Stubs namespace.
  • Update tooling configs: include stubs/ in PHP-CS-Fixer, and adjust Psalm configuration scope.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/Unit/Stubs/StubAdapterTest.php Removed unit test for StubAdapter (adapter is removed).
tests/Unit/Stubs/InMemoryAdapterTest.php Added unit tests for InMemoryAdapter behavior (push/status/runExisting/subscribe).
tests/Unit/QueueTest.php Switched queue unit tests to use Yiisoft\Queue\Stubs\InMemoryAdapter.
tests/Unit/Provider/QueueFactoryProviderTest.php Switched provider test DI adapter from StubAdapter to InMemoryAdapter.
stubs/StubLoop.php Minor constructor formatting simplification.
stubs/StubAdapter.php Removed the StubAdapter implementation.
stubs/InMemoryAdapter.php Renamed/relocated the in-memory adapter into Yiisoft\Queue\Stubs\InMemoryAdapter and improved docs/types.
psalm.xml Removed tests/ from Psalm’s analyzed project files and removed related issue handler suppression.
.php-cs-fixer.dist.php Added stubs/ directory to PHP-CS-Fixer finder paths.
Comments suppressed due to low confidence (1)

stubs/InMemoryAdapter.php:24

  • PR metadata says this doesn't break BC, but Yiisoft\\Queue\\Stubs\\StubAdapter is removed and InMemoryAdapter becomes the replacement stub implementation. Since stubs/ is shipped via Composer autoload (Yiisoft\\Queue\\Stubs\\), removing/renaming these classes is a public API change. Consider keeping StubAdapter as a deprecated alias or updating the PR's BC declaration/release notes accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/Unit/Stubs/InMemoryAdapterTest.php
Comment thread tests/Unit/Stubs/InMemoryAdapterTest.php Outdated
Comment thread tests/Unit/Stubs/InMemoryAdapterTest.php Outdated
Comment thread psalm.xml
@vjik vjik merged commit 5e9818c into master May 5, 2026
2 checks passed
@vjik vjik deleted the in-memory-adapter branch May 5, 2026 13:47
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