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

feat: Make use of new "async" RPC #36

Merged
merged 7 commits into from
Jun 17, 2024
Merged

feat: Make use of new "async" RPC #36

merged 7 commits into from
Jun 17, 2024

Conversation

L3tum
Copy link
Contributor

@L3tum L3tum commented Feb 5, 2024

Q A
Bugfix?
Breaks BC?
New feature? ✔️TODO:
Issues roadrunner-php/goridge#22
Docs PR spiral/docs#...

This is a follow-up PR for roadrunner-php/goridge#22 implementing the new "async" RPC calls in the Cache class.
It may be an option to instead modify the Factory to return an AsyncCache class instead if it detects an async RPC interface, or something like that. Please lmk if you'd like me to change that. Once the implementation is good to go I'll add tests for it as well.

EDIT: FYI I switched to the factory (similar to the other PR in Metrics) because I think this is easier to use. I've also added the corresponding tests.

For further info please read the linked PR in the goridge repo.

Same PR for the metrics repo: roadrunner-php/metrics#13

Summary by CodeRabbit

  • New Features

    • Introduced asynchronous cache operations, including methods for setting, deleting, and committing cache data asynchronously.
  • Bug Fixes

    • Improved version compatibility for dependencies, ensuring smoother integration with spiral/roadrunner and spiral/goridge.
  • Tests

    • Added comprehensive test cases for the new asynchronous cache functionality, covering various scenarios and error handling.
  • Chores

    • Updated dependency version constraints in composer.json for better alignment and compatibility.

Copy link

coderabbitai bot commented Feb 5, 2024

Walkthrough

The updates introduce asynchronous caching capabilities to the project by adding the AsyncCache class and AsyncStorageInterface. Dependencies for spiral/roadrunner and spiral/goridge have been updated, and new tests ensure the reliability of async operations. This enhancement allows for non-blocking cache interactions, improving performance and scalability.

Changes

File(s) Change Summary
composer.json Updated version constraints for spiral/roadrunner and spiral/goridge.
src/AsyncCache.php Added AsyncCache class for asynchronous cache operations.
src/AsyncStorageInterface.php Introduced AsyncStorageInterface with async methods for key-value store interactions.
src/Cache.php Modified visibility of constants, properties, and methods; added exception types to method signatures.
src/Factory.php Added async cache instantiation based on RPC type.
tests/AsyncCacheTest.php Added test cases for AsyncCache class.
tests/FactoryTest.php Updated tests to include async factory and caching operations.
tests/Stub/AsyncFrozenDateCacheStub.php Introduced AsyncFrozenDateCacheStub for testing with a frozen date.
tests/Stub/AsyncRPCConnectionStub.php Added AsyncRPCConnectionStub for handling async RPC calls in tests.
tests/TestCase.php Added asyncRPC method to facilitate async RPC testing.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant AsyncCache
    participant AsyncRPCInterface
    participant Storage

    Client->>AsyncCache: setAsync(key, value, ttl)
    AsyncCache->>AsyncRPCInterface: request set operation
    AsyncRPCInterface->>Storage: set key-value pair
    Storage-->>AsyncRPCInterface: confirmation
    AsyncRPCInterface-->>AsyncCache: confirmation
    AsyncCache-->>Client: operation result

    Client->>AsyncCache: getAsync(key)
    AsyncCache->>AsyncRPCInterface: request get operation
    AsyncRPCInterface->>Storage: get key-value pair
    Storage-->>AsyncRPCInterface: key-value pair
    AsyncRPCInterface-->>AsyncCache: key-value pair
    AsyncCache-->>Client: key-value pair
Loading

Poem

In the code where bytes do dance,
AsyncCache now takes a stance.
With keys and values in its care,
It moves with speed, beyond compare.
Dependencies aligned, tests in place,
Our cache now runs an async race.
Hopping swiftly, data flows,
In Rabbit's realm, performance grows! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rustatian rustatian requested a review from msmakouz February 5, 2024 12:34
@rustatian rustatian added B-performance Bug: performance issues C-enhancement Category: enhancement. Meaning improvements of current module, transport, etc.. labels Feb 5, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 5, 2024

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Project coverage is 88.16%. Comparing base (203917d) to head (3100e53).
Report is 2 commits behind head on 4.x.

Current head 3100e53 differs from pull request most recent head 4048565

Please upload reports for the commit 4048565 to get more accurate results.

Files Patch % Lines
src/Cache.php 0.00% 20 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##                 4.x      #36       +/-   ##
==============================================
- Coverage     100.00%   88.16%   -11.84%     
- Complexity        61       69        +8     
==============================================
  Files              6        6               
  Lines            149      169       +20     
==============================================
  Hits             149      149               
- Misses             0       20       +20     

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

@rustatian
Copy link
Contributor

@L3tum @msmakouz Friendly ping, what is a showstopper here? 😃

@L3tum
Copy link
Contributor Author

L3tum commented May 23, 2024

Hey @rustatian, sorry I've been kinda busy as I'm currently hunting for a new apartment and my workplace is in a complete overhaul. There shouldn't be anything left to do here (and it's already in use) but lmk if there's any issues and I'll try to fix them

@rustatian
Copy link
Contributor

Hey @L3tum 👋 Glad to hear you 👍
It would be great if you would be able to finish this PR in terms of CI and updating deps (since we've released the worker package with your changes).

L3tum added 2 commits May 31, 2024 15:48
@L3tum
Copy link
Contributor Author

L3tum commented May 31, 2024

Hey @rustatian / @msmakouz , PR is fixed now and I've upped the required version for goridge to 4.2 (which is the first version that has the async changes). It could be made to work with prior versions by moving the usings I think, so lmk if it's okay with you with how it is right now or if it needs to be changed.

@L3tum L3tum marked this pull request as ready for review May 31, 2024 13:54
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 8

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a9e13c8 and 6988774.

Files selected for processing (10)
  • composer.json (1 hunks)
  • src/AsyncCache.php (1 hunks)
  • src/AsyncStorageInterface.php (1 hunks)
  • src/Cache.php (6 hunks)
  • src/Factory.php (2 hunks)
  • tests/AsyncCacheTest.php (1 hunks)
  • tests/FactoryTest.php (2 hunks)
  • tests/Stub/AsyncFrozenDateCacheStub.php (1 hunks)
  • tests/Stub/AsyncRPCConnectionStub.php (1 hunks)
  • tests/TestCase.php (2 hunks)
Files not reviewed due to errors (2)
  • src/AsyncCache.php (no review received)
  • src/Cache.php (no review received)
Additional context used
PHPStan
tests/Stub/AsyncFrozenDateCacheStub.php

12-12: Class Spiral\RoadRunner\KeyValue\Tests\Stub\AsyncFrozenDateCacheStub extends unknown class Spiral\RoadRunner\KeyValue\AsyncCache.


18-18: Parameter $rpc of method Spiral\RoadRunner\KeyValue\Tests\Stub\AsyncFrozenDateCacheStub::__construct() has invalid type Spiral\Goridge\RPC\AsyncRPCInterface.


20-20: Instantiated class Spiral\RoadRunner\KeyValue\Serializer\DefaultSerializer not found.


20-20: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\Stub\AsyncFrozenDateCacheStub::__construct() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


24-24: Spiral\RoadRunner\KeyValue\Tests\Stub\AsyncFrozenDateCacheStub::__construct() calls parent::__construct() but Spiral\RoadRunner\KeyValue\Tests\Stub\AsyncFrozenDateCacheStub does not extend any class.

tests/TestCase.php

11-11: Class Spiral\RoadRunner\KeyValue\Tests\TestCase extends unknown class PHPUnit\Framework\TestCase.


17-17: Method Spiral\RoadRunner\KeyValue\Tests\TestCase::rpc() has invalid return type Spiral\RoadRunner\KeyValue\Tests\Stub\RPCConnectionStub.


19-19: Instantiated class Spiral\RoadRunner\KeyValue\Tests\Stub\RPCConnectionStub not found.


26-26: Method Spiral\RoadRunner\KeyValue\Tests\TestCase::asyncRPC() has invalid return type Spiral\RoadRunner\KeyValue\Tests\Stub\AsyncRPCConnectionStub.


28-28: Instantiated class Spiral\RoadRunner\KeyValue\Tests\Stub\AsyncRPCConnectionStub not found.

src/Factory.php

16-16: Class Spiral\RoadRunner\KeyValue\Factory implements unknown interface Spiral\RoadRunner\KeyValue\FactoryInterface.


18-18: Class Spiral\RoadRunner\KeyValue\Factory uses unknown trait Spiral\RoadRunner\KeyValue\Serializer\SerializerAwareTrait.


21-21: Parameter $rpc of method Spiral\RoadRunner\KeyValue\Factory::__construct() has invalid type Spiral\Goridge\RPC\RPCInterface.


21-21: Property Spiral\RoadRunner\KeyValue\Factory::$rpc has unknown class Spiral\Goridge\RPC\RPCInterface as its type.


22-22: Instantiated class Spiral\RoadRunner\KeyValue\Serializer\DefaultSerializer not found.


22-22: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Factory::__construct() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


24-24: Call to an undefined method Spiral\RoadRunner\KeyValue\Factory::setSerializer().


27-27: Method Spiral\RoadRunner\KeyValue\Factory::select() has invalid return type Spiral\RoadRunner\KeyValue\StorageInterface.


29-29: Class Spiral\Goridge\RPC\AsyncRPCInterface not found.


30-30: Call to an undefined method Spiral\RoadRunner\KeyValue\Factory::getSerializer().


30-30: Instantiated class Spiral\RoadRunner\KeyValue\AsyncCache not found.


32-32: Call to an undefined method Spiral\RoadRunner\KeyValue\Factory::getSerializer().


32-32: Instantiated class Spiral\RoadRunner\KeyValue\Cache not found.

tests/Stub/AsyncRPCConnectionStub.php

7-7: Class Spiral\RoadRunner\KeyValue\Tests\Stub\AsyncRPCConnectionStub extends unknown class Spiral\RoadRunner\KeyValue\Tests\Stub\RPCConnectionStub.


7-7: Class Spiral\RoadRunner\KeyValue\Tests\Stub\AsyncRPCConnectionStub implements unknown interface Spiral\Goridge\RPC\AsyncRPCInterface.


17-17: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\Stub\AsyncRPCConnectionStub::call().


41-41: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\Stub\AsyncRPCConnectionStub::call().

tests/FactoryTest.php

13-13: Class Spiral\RoadRunner\KeyValue\Tests\FactoryTest extends unknown class Spiral\RoadRunner\KeyValue\Tests\TestCase.


18-18: Instantiated class Spiral\RoadRunner\KeyValue\Serializer\DefaultSerializer not found.


18-18: Method Spiral\RoadRunner\KeyValue\Tests\FactoryTest::factory() has invalid return type Spiral\RoadRunner\KeyValue\FactoryInterface.


18-18: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\FactoryTest::factory() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


20-20: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\FactoryTest::rpc().


20-20: Instantiated class Spiral\RoadRunner\KeyValue\Factory not found.


26-26: Instantiated class Spiral\RoadRunner\KeyValue\Serializer\DefaultSerializer not found.


26-26: Method Spiral\RoadRunner\KeyValue\Tests\FactoryTest::asyncFactory() has invalid return type Spiral\RoadRunner\KeyValue\FactoryInterface.


26-26: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\FactoryTest::asyncFactory() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


28-28: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\FactoryTest::asyncRPC().


28-28: Instantiated class Spiral\RoadRunner\KeyValue\Factory not found.


33-33: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\FactoryTest::expectNotToPerformAssertions().


39-39: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\FactoryTest::expectNotToPerformAssertions().


50-50: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\FactoryTest::assertSame().


60-60: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\FactoryTest::assertSame().

src/AsyncStorageInterface.php

8-8: Interface Spiral\RoadRunner\KeyValue\AsyncStorageInterface extends unknown interface Spiral\RoadRunner\KeyValue\StorageInterface.

src/AsyncCache.php

22-22: Class Spiral\RoadRunner\KeyValue\AsyncCache extends unknown class Spiral\RoadRunner\KeyValue\Cache.


22-22: Class Spiral\RoadRunner\KeyValue\AsyncCache implements unknown interface Spiral\RoadRunner\KeyValue\AsyncStorageInterface.


34-34: Parameter $rpc of method Spiral\RoadRunner\KeyValue\AsyncCache::__construct() has invalid type Spiral\Goridge\RPC\RPCInterface.


36-36: Instantiated class Spiral\RoadRunner\KeyValue\Serializer\DefaultSerializer not found.


36-36: Parameter $serializer of method Spiral\RoadRunner\KeyValue\AsyncCache::__construct() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


38-38: Spiral\RoadRunner\KeyValue\AsyncCache::__construct() calls parent::__construct() but Spiral\RoadRunner\KeyValue\AsyncCache does not extend any class.


41-41: Access to an undefined property Spiral\RoadRunner\KeyValue\AsyncCache::$rpc.


41-41: Class Spiral\Goridge\RPC\AsyncRPCInterface not found.


71-71: Access to an undefined property Spiral\RoadRunner\KeyValue\AsyncCache::$rpc.


71-71: Class Spiral\Goridge\RPC\AsyncRPCInterface not found.


78-78: Call to an undefined method Spiral\RoadRunner\KeyValue\AsyncCache::requestKeys().


107-107: Access to an undefined property Spiral\RoadRunner\KeyValue\AsyncCache::$rpc.


107-107: Class Spiral\Goridge\RPC\AsyncRPCInterface not found.


116-116: Call to an undefined method Spiral\RoadRunner\KeyValue\AsyncCache::requestValues().


116-116: Call to an undefined method Spiral\RoadRunner\KeyValue\AsyncCache::ttlToRfc3339String().


128-128: Access to an undefined property Spiral\RoadRunner\KeyValue\AsyncCache::$rpc.


128-128: Class Spiral\Goridge\RPC\AsyncRPCInterface not found.


131-131: Class RoadRunner\KV\DTO\V1\Response not found.


132-132: Caught class Spiral\Goridge\RPC\Exception\ServiceException not found.


136-136: Access to an undefined property Spiral\RoadRunner\KeyValue\AsyncCache::$name.


136-136: Access to undefined constant Spiral\RoadRunner\KeyValue\AsyncCache::ERROR_INVALID_STORAGE.


136-136: Instantiated class Spiral\RoadRunner\KeyValue\Exception\StorageException not found.


139-139: Instantiated class Spiral\RoadRunner\KeyValue\Exception\KeyValueException not found.

src/Cache.php

25-25: Class Spiral\RoadRunner\KeyValue\Cache implements unknown interface Spiral\RoadRunner\KeyValue\StorageInterface.


27-27: Class Spiral\RoadRunner\KeyValue\Cache uses unknown trait Spiral\RoadRunner\KeyValue\Serializer\SerializerAwareTrait.


43-43: Property Spiral\RoadRunner\KeyValue\Cache::$rpc has unknown class Spiral\Goridge\RPC\RPCInterface as its type.


50-50: Parameter $rpc of method Spiral\RoadRunner\KeyValue\Cache::__construct() has invalid type Spiral\Goridge\RPC\RPCInterface.


52-52: Instantiated class Spiral\RoadRunner\KeyValue\Serializer\DefaultSerializer not found.


52-52: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Cache::__construct() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


54-54: Instantiated class Spiral\Goridge\RPC\Codec\ProtobufCodec not found.


57-57: Call to an undefined method Spiral\RoadRunner\KeyValue\Cache::setSerializer().


92-92: Caught class Spiral\RoadRunner\KeyValue\Exception\KeyValueException not found.


95-95: Instantiated class Spiral\RoadRunner\KeyValue\Exception\NotImplementedException not found.


111-111: Parameter $response of method Spiral\RoadRunner\KeyValue\Cache::createIndex() has invalid type RoadRunner\KV\DTO\V1\Response.


130-130: Method Spiral\RoadRunner\KeyValue\Cache::call() has invalid return type RoadRunner\KV\DTO\V1\Response.


130-130: Parameter $request of method Spiral\RoadRunner\KeyValue\Cache::call() has invalid type RoadRunner\KV\DTO\V1\Request.


133-133: Class RoadRunner\KV\DTO\V1\Response not found.


134-134: Caught class Spiral\Goridge\RPC\Exception\ServiceException not found.


138-138: Instantiated class Spiral\RoadRunner\KeyValue\Exception\StorageException not found.


141-141: Instantiated class Spiral\RoadRunner\KeyValue\Exception\KeyValueException not found.


149-149: Method Spiral\RoadRunner\KeyValue\Cache::requestKeys() has invalid return type RoadRunner\KV\DTO\V1\Request.


155-155: Instantiated class RoadRunner\KV\DTO\V1\Item not found.


164-164: Method Spiral\RoadRunner\KeyValue\Cache::request() has invalid return type RoadRunner\KV\DTO\V1\Request.


166-166: Instantiated class RoadRunner\KV\DTO\V1\Request not found.


210-210: Call to an undefined method Spiral\RoadRunner\KeyValue\Cache::getSerializer().


240-240: Instantiated class Spiral\RoadRunner\KeyValue\Exception\InvalidArgumentException not found.


262-262: Method Spiral\RoadRunner\KeyValue\Cache::requestValues() has invalid return type RoadRunner\KV\DTO\V1\Request.


265-265: Call to an undefined method Spiral\RoadRunner\KeyValue\Cache::getSerializer().


271-271: Instantiated class RoadRunner\KV\DTO\V1\Item not found.


353-353: Caught class Spiral\RoadRunner\KeyValue\Exception\KeyValueException not found.


355-355: Instantiated class Spiral\RoadRunner\KeyValue\Exception\KeyValueException not found.

tests/AsyncCacheTest.php

24-24: Class Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest extends unknown class Spiral\RoadRunner\KeyValue\Tests\TestCase.


34-34: Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::setUp() calls parent::setUp() but Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest does not extend any class.


41-41: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertSame().


48-48: Instantiated class Spiral\RoadRunner\KeyValue\Serializer\DefaultSerializer not found.


48-48: Method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::cache() has invalid return type Spiral\RoadRunner\KeyValue\AsyncCache.


48-48: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::cache() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


50-50: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::asyncRPC().


50-50: Instantiated class Spiral\RoadRunner\KeyValue\AsyncCache not found.


56-56: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::testTtl() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


62-62: Instantiated class RoadRunner\KV\DTO\V1\Item not found.


72-72: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertNotNull().


73-73: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertEquals().


98-98: Instantiated class RoadRunner\KV\DTO\V1\Response not found.


104-104: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::testNoTtl() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


108-108: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertNull().


114-114: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::testMultipleTtl() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


121-121: Instantiated class RoadRunner\KV\DTO\V1\Item not found.


126-126: Instantiated class RoadRunner\KV\DTO\V1\Item not found.


137-137: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertContains().


138-138: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertEquals().


145-145: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::testMultipleTtlWithMissingTime() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


152-152: Instantiated class RoadRunner\KV\DTO\V1\Item not found.


163-163: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertContains().


166-166: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertEquals().


173-173: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::testTtlWithInvalidResponseKey() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


177-177: Instantiated class RoadRunner\KV\DTO\V1\Item not found.


185-185: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertNull().


194-194: Parameter $c of anonymous function has invalid type Spiral\RoadRunner\KeyValue\AsyncCache.


195-195: Parameter $c of anonymous function has invalid type Spiral\RoadRunner\KeyValue\AsyncCache.


196-196: Parameter $c of anonymous function has invalid type Spiral\RoadRunner\KeyValue\AsyncCache.


197-197: Parameter $c of anonymous function has invalid type Spiral\RoadRunner\KeyValue\AsyncCache.


198-198: Parameter $c of anonymous function has invalid type Spiral\RoadRunner\KeyValue\AsyncCache.


199-199: Parameter $c of anonymous function has invalid type Spiral\RoadRunner\KeyValue\AsyncCache.


200-200: Parameter $c of anonymous function has invalid type Spiral\RoadRunner\KeyValue\AsyncCache.


201-201: Parameter $c of anonymous function has invalid type Spiral\RoadRunner\KeyValue\AsyncCache.


202-202: Parameter $c of anonymous function has invalid type Spiral\RoadRunner\KeyValue\AsyncCache.


203-203: Parameter $c of anonymous function has invalid type Spiral\RoadRunner\KeyValue\AsyncCache.


204-204: Parameter $c of anonymous function has invalid type Spiral\RoadRunner\KeyValue\AsyncCache.


205-205: Parameter $c of anonymous function has invalid type Spiral\RoadRunner\KeyValue\AsyncCache.


206-206: Parameter $c of anonymous function has invalid type Spiral\RoadRunner\KeyValue\AsyncCache.


218-218: Instantiated class Spiral\Goridge\RPC\Exception\ServiceException not found.


222-222: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectException().


222-222: Class Spiral\RoadRunner\KeyValue\Exception\StorageException not found.


223-223: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectExceptionMessage().


252-252: Instantiated class Spiral\Goridge\RPC\Exception\ServiceException not found.


256-256: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectException().


256-256: Class Spiral\RoadRunner\KeyValue\Exception\NotImplementedException not found.


257-257: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectExceptionMessage().


273-273: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::testGet() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


279-279: Instantiated class RoadRunner\KV\DTO\V1\Item not found.


283-283: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertSame().


290-290: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertNull().


299-299: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertSame().


305-305: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::testGetMultiple() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


317-317: Instantiated class RoadRunner\KV\DTO\V1\Item not found.


318-318: Instantiated class RoadRunner\KV\DTO\V1\Item not found.


324-324: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertSame().


330-330: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::testHas() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


336-336: Instantiated class RoadRunner\KV\DTO\V1\Item not found.


340-340: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertTrue().


346-346: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::testHasWhenNotExists() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


354-354: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertFalse().


360-360: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::testHasWithInvalidResponse() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


366-366: Instantiated class RoadRunner\KV\DTO\V1\Item not found.


370-370: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertFalse().


379-379: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertTrue().


384-384: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectException().


384-384: Class Spiral\RoadRunner\KeyValue\Exception\KeyValueException not found.


385-385: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectExceptionMessage().


389-389: Instantiated class Spiral\Goridge\RPC\Exception\ServiceException not found.


398-398: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectException().


398-398: Class Spiral\RoadRunner\KeyValue\Exception\KeyValueException not found.


399-399: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectExceptionMessage().


413-413: Call to an undefined static method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::valuesDataProvider().


428-428: Instantiated class Spiral\RoadRunner\KeyValue\Serializer\DefaultSerializer not found.


432-432: Instantiated class Spiral\RoadRunner\KeyValue\Serializer\IgbinarySerializer not found.


439-439: Instantiated class Spiral\RoadRunner\KeyValue\Serializer\SodiumSerializer not found.


450-450: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::testSet() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


453-453: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::markTestSkipped().


457-457: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::markTestSkipped().


468-468: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::testSetAsync() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


471-471: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::markTestSkipped().


475-475: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::markTestSkipped().


489-489: Method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::getAssertableCacheOnSet() has invalid return type Spiral\RoadRunner\KeyValue\AsyncCache.


489-489: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::getAssertableCacheOnSet() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


492-492: Parameter $request of anonymous function has invalid type RoadRunner\KV\DTO\V1\Request.


501-501: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertArrayHasKey().


502-502: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertEquals().


505-505: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertSame().


515-515: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::testMultipleSet() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


518-518: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::markTestSkipped().


522-522: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::markTestSkipped().


534-534: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::testMultipleSetAsync() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


537-537: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::markTestSkipped().


541-541: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::markTestSkipped().


562-562: Parameter $request of anonymous function has invalid type RoadRunner\KV\DTO\V1\Request.


565-565: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertSame().


586-586: Parameter $request of anonymous function has invalid type RoadRunner\KV\DTO\V1\Request.


589-589: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertSame().


607-607: Instantiated class Spiral\RoadRunner\KeyValue\Serializer\DefaultSerializer not found.


607-607: Parameter $serializer of method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::frozenDateCache() has invalid type Spiral\RoadRunner\KeyValue\Serializer\SerializerInterface.


608-608: Method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::frozenDateCache() has invalid return type Spiral\RoadRunner\KeyValue\AsyncCache.


609-609: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::asyncRPC().


609-609: Instantiated class Spiral\RoadRunner\KeyValue\Tests\Stub\AsyncFrozenDateCacheStub not found.


625-625: Parameter $request of anonymous function has invalid type RoadRunner\KV\DTO\V1\Request.


628-628: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertSame().


650-650: Parameter $request of anonymous function has invalid type RoadRunner\KV\DTO\V1\Request.


653-653: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertSame().


671-671: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::markTestSkipped().


674-674: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectException().


674-674: Class Spiral\RoadRunner\KeyValue\Exception\InvalidArgumentException not found.


675-675: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectExceptionMessage().


693-693: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::markTestSkipped().


696-696: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectException().


696-696: Class Spiral\RoadRunner\KeyValue\Exception\InvalidArgumentException not found.


697-697: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectExceptionMessage().


706-706: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertSame().


713-713: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertTrue().


719-719: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertTrue().


720-720: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertTrue().


725-725: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectException().


725-725: Class Spiral\RoadRunner\KeyValue\Exception\KeyValueException not found.


729-729: Instantiated class Spiral\Goridge\RPC\Exception\ServiceException not found.


740-740: Instantiated class Spiral\Goridge\RPC\Exception\ServiceException not found.


745-745: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectException().


745-745: Class Spiral\RoadRunner\KeyValue\Exception\KeyValueException not found.


752-752: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertTrue().


758-758: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertTrue().


759-759: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertTrue().


764-764: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectException().


764-764: Class Spiral\RoadRunner\KeyValue\Exception\KeyValueException not found.


768-768: Instantiated class Spiral\Goridge\RPC\Exception\ServiceException not found.


779-779: Instantiated class Spiral\Goridge\RPC\Exception\ServiceException not found.


784-784: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectException().


784-784: Class Spiral\RoadRunner\KeyValue\Exception\KeyValueException not found.


790-790: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectException().


790-790: Class Spiral\RoadRunner\KeyValue\Exception\InvalidArgumentException not found.


791-791: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectExceptionMessage().


801-801: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectException().


801-801: Class Spiral\RoadRunner\KeyValue\Exception\InvalidArgumentException not found.


802-802: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectExceptionMessage().


810-810: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectException().


810-810: Class Spiral\RoadRunner\KeyValue\Exception\InvalidArgumentException not found.


811-811: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectExceptionMessage().


816-816: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertSame().


822-822: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectException().


822-822: Class Spiral\RoadRunner\KeyValue\Exception\InvalidArgumentException not found.


823-823: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectExceptionMessage().


831-831: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectException().


831-831: Class Spiral\RoadRunner\KeyValue\Exception\InvalidArgumentException not found.


832-832: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectExceptionMessage().


837-837: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertSame().


846-846: Instantiated class RoadRunner\KV\DTO\V1\Item not found.


847-847: Instantiated class Spiral\RoadRunner\KeyValue\Tests\Stub\RawSerializerStub not found.


849-849: Instantiated class Spiral\RoadRunner\KeyValue\Serializer\DefaultSerializer not found.


852-852: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::assertSame().


857-857: Call to an undefined method Spiral\RoadRunner\KeyValue\Tests\AsyncCacheTest::expectException().


857-857: Class Spiral\RoadRunner\KeyValue\Exception\SerializationException not found.


862-862: Instantiated class RoadRunner\KV\DTO\V1\Item not found.


863-863: Instantiated class Spiral\RoadRunner\KeyValue\Tests\Stub\RawSerializerStub not found.


865-865: Instantiated class Spiral\RoadRunner\KeyValue\Serializer\DefaultSerializer not found.

Additional comments not posted (20)
tests/Stub/AsyncFrozenDateCacheStub.php (2)

27-30: The method now is correctly implemented to return the frozen date.


12-25: Ensure that AsyncCache is correctly defined and accessible as the parent class.

Verification successful

The AsyncCache class is correctly defined and accessible in the codebase.

  • src/AsyncCache.php:class AsyncCache extends Cache implements AsyncStorageInterface
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the existence of AsyncCache class.
ast-grep --lang php --pattern $'class AsyncCache { $$$ }'

Length of output: 165



Script:

#!/bin/bash
# Description: Verify the existence of AsyncCache class using ripgrep.
rg 'class AsyncCache' --type php

Length of output: 180

tests/TestCase.php (2)

22-29: Verify the existence and correct implementation of AsyncRPCConnectionStub.

Verification successful

Verify the existence and correct implementation of AsyncRPCConnectionStub.


The class AsyncRPCConnectionStub exists and is defined in tests/Stub/AsyncRPCConnectionStub.php. The method asyncRPC in tests/TestCase.php correctly returns an instance of this class.

  • Location of AsyncRPCConnectionStub class: tests/Stub/AsyncRPCConnectionStub.php
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the existence of AsyncRPCConnectionStub class.
ast-grep --lang php --pattern $'class AsyncRPCConnectionStub { $$$ }'

Length of output: 177



Script:

#!/bin/bash
# Description: Verify the existence of AsyncRPCConnectionStub class using ripgrep.
rg 'class AsyncRPCConnectionStub' --type php

Length of output: 168


Line range hint 8-17: Verify the existence and correct implementation of RPCConnectionStub.

Verification successful

The RPCConnectionStub class is correctly defined in tests/Stub/RPCConnectionStub.php and implements the RPCInterface. The constructor and properties align with the usage in the TestCase class.

  • RPCConnectionStub class is found in tests/Stub/RPCConnectionStub.php.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the existence of RPCConnectionStub class.
ast-grep --lang php --pattern $'class RPCConnectionStub { $$$ }'

Length of output: 172



Script:

#!/bin/bash
# Description: Verify the existence of RPCConnectionStub class using ripgrep.
rg 'class RPCConnectionStub' --files-with-matches

Length of output: 84



Script:

#!/bin/bash
# Description: Retrieve the implementation of RPCConnectionStub class.
rg 'class RPCConnectionStub' -A 20 tests/Stub/RPCConnectionStub.php

Length of output: 581

src/Factory.php (2)

Line range hint 7-33: Verify the existence and correct implementation of FactoryInterface, SerializerAwareTrait, and related methods.

Verification successful

The FactoryInterface and SerializerAwareTrait are correctly defined in the codebase.

  • FactoryInterface is defined in src/FactoryInterface.php.
  • SerializerAwareTrait is defined in src/Serializer/SerializerAwareTrait.php.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the existence of FactoryInterface and SerializerAwareTrait.
ast-grep --lang php --pattern $'interface FactoryInterface { $$$ }'
ast-grep --lang php --pattern $'trait SerializerAwareTrait { $$$ }'

Length of output: 351



Script:

#!/bin/bash
# Description: Verify the existence of FactoryInterface and SerializerAwareTrait using ripgrep.
rg 'interface FactoryInterface' --files-with-matches
rg 'trait SerializerAwareTrait' --files-with-matches

Length of output: 174



Script:

#!/bin/bash
# Description: Display the contents of FactoryInterface and SerializerAwareTrait files to verify their definitions.
cat src/FactoryInterface.php
cat src/Serializer/SerializerAwareTrait.php

Length of output: 1065


29-33: Verify the existence and correct implementation of AsyncCache and Cache.

Verification successful

Verify the existence and correct implementation of AsyncCache and Cache using rg instead of ast-grep.


The classes AsyncCache and Cache exist in the codebase and are correctly implemented.

  • AsyncCache is defined in src/AsyncCache.php.
  • Cache is defined in src/Cache.php.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the existence of AsyncCache and Cache classes.
ast-grep --lang php --pattern $'class AsyncCache { $$$ }'
ast-grep --lang php --pattern $'class Cache { $$$ }'

Length of output: 326



Script:

#!/bin/bash
# Description: Verify the existence of AsyncCache and Cache classes using ripgrep.
rg 'class AsyncCache' --type php
rg 'class Cache' --type php

Length of output: 317

tests/Stub/AsyncRPCConnectionStub.php (5)

20-26: The method callAsync is correctly implemented to manage asynchronous calls and maintain a sequence of responses.


28-31: The method hasResponse is correctly implemented to check if a response exists for a given sequence number.


33-36: The method hasResponses is correctly implemented to filter a list of sequence numbers to find those that have responses.


38-45: Verify the existence and correct implementation of the method call in AsyncRPCConnectionStub.


15-18: Verify the existence and correct implementation of the method call in AsyncRPCConnectionStub.

Verification successful

The call method is defined in tests/Stub/RPCConnectionStub.php as a public method. Since AsyncRPCConnectionStub extends RPCConnectionStub, it inherits this method. Therefore, the callIgnoreResponse method in AsyncRPCConnectionStub is correctly calling the inherited call method.

  • tests/Stub/RPCConnectionStub.php: public function call(string $method, mixed $payload, mixed $options = null): mixed
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the existence of the call method in AsyncRPCConnectionStub.
ast-grep --lang php --pattern $'class AsyncRPCConnectionStub { $$$ call($_, $_) { $$$ } $$$ }'

Length of output: 202



Script:

#!/bin/bash
# Description: Verify the existence of the call method in AsyncRPCConnectionStub using ripgrep.
rg --pcre2 --multiline --multiline-dotall 'class\s+AsyncRPCConnectionStub\s+{[^}]*function\s+call\s*\('

Length of output: 105



Script:

#!/bin/bash
# Description: Verify the existence of the call method in RPCConnectionStub and AsyncRPCInterface using ripgrep.

# Search for the call method in RPCConnectionStub
rg --pcre2 --multiline --multiline-dotall 'class\s+RPCConnectionStub\s+{[^}]*function\s+call\s*\('

# Search for the call method in AsyncRPCInterface
rg --pcre2 --multiline --multiline-dotall 'interface\s+AsyncRPCInterface\s+{[^}]*function\s+call\s*\('

Length of output: 205



Script:

#!/bin/bash
# Description: Search for the definition of the call method across the entire codebase.
rg --pcre2 --multiline --multiline-dotall 'function\s+call\s*\('

Length of output: 270

tests/FactoryTest.php (3)

37-58: The test methods are correctly implemented to perform various assertions using the factory and asyncFactory methods.


Line range hint 11-17: Verify the existence and correct implementation of the class Factory.

Verification successful

The Factory class exists and is defined in src/Factory.php as final class Factory implements FactoryInterface.

  • src/Factory.php: final class Factory implements FactoryInterface
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the existence of Factory class.
ast-grep --lang php --pattern $'class Factory { $$$ }'

Length of output: 162



Script:

#!/bin/bash
# Description: Verify the existence of Factory class using ripgrep.
rg 'class Factory' --type php

Length of output: 152


23-29: Verify the existence and correct implementation of the class Factory.

Verification successful

The Factory class exists in the codebase, specifically in src/Factory.php, and it implements the FactoryInterface. This confirms that the asyncFactory method in tests/FactoryTest.php is correctly referencing an existing class.

  • src/Factory.php: final class Factory implements FactoryInterface
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the existence of Factory class.
ast-grep --lang php --pattern $'class Factory { $$$ }'

Length of output: 162



Script:

#!/bin/bash
# Description: Verify the existence of Factory class using ripgrep.
rg 'class Factory' --type php

Length of output: 152

composer.json (1)

51-52: The dependency updates for spiral/roadrunner and spiral/goridge are correctly aligned with the PR's objectives to support async changes.

src/AsyncStorageInterface.php (5)

8-15: LGTM! The commitAsync method is well-documented and correctly throws a KeyValueException for error handling.


17-31: LGTM! The setMultipleAsync method correctly handles multiple key-value pairs with optional TTL, aligning with PSR-16 standards.


33-47: LGTM! The setAsync method is a well-implemented convenience method for setting a single key-value pair asynchronously.


49-59: LGTM! The deleteAsync method correctly implements asynchronous deletion of a single key, with appropriate error handling.


61-72: LGTM! The deleteMultipleAsync method properly handles asynchronous deletion of multiple keys, consistent with the interface's standards.

@msmakouz
Copy link
Member

msmakouz commented Jun 6, 2024

Hey @rustatian / @msmakouz , PR is fixed now and I've upped the required version for goridge to 4.2 (which is the first version that has the async changes). It could be made to work with prior versions by moving the usings I think, so lmk if it's okay with you with how it is right now or if it needs to be changed.

Hey @L3tum, raising the minimum version of spiral/goridge to 4.2 is normal. This is a minor version increase, and there is no problem with that.

@roadrunner-php roadrunner-php deleted a comment from coderabbitai bot Jun 6, 2024
@roadrunner-php roadrunner-php deleted a comment from coderabbitai bot Jun 6, 2024
@roadrunner-php roadrunner-php deleted a comment from coderabbitai bot Jun 6, 2024
@roadrunner-php roadrunner-php deleted a comment from coderabbitai bot Jun 6, 2024
@roadrunner-php roadrunner-php deleted a comment from coderabbitai bot Jun 6, 2024
@roadrunner-php roadrunner-php deleted a comment from coderabbitai bot Jun 6, 2024
@roadrunner-php roadrunner-php deleted a comment from coderabbitai bot Jun 6, 2024
@roadrunner-php roadrunner-php deleted a comment from coderabbitai bot Jun 6, 2024
composer.json Outdated Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6988774 and 4048565.

Files selected for processing (1)
  • composer.json (1 hunks)
Additional comments not posted (2)
composer.json (2)

51-51: Update to spiral/goridge version ^4.2 aligns with the requirement for async features as per PR objectives.


51-51: The version constraint for spiral/roadrunner is correctly placed and allows for future compatibility with versions 2023.1 and 2024.1.

@rustatian rustatian requested a review from msmakouz June 11, 2024 12:09
@msmakouz msmakouz merged commit 9f294a4 into roadrunner-php:4.x Jun 17, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-performance Bug: performance issues C-enhancement Category: enhancement. Meaning improvements of current module, transport, etc..
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants