-
Notifications
You must be signed in to change notification settings - Fork 2
Delete replicated event and fix test suite
#70
Conversation
WalkthroughGrant/revoke methods now return bool and accept wider user types in fakes; the fake manager implements ManagerInterface and adds stub listRelations/write methods; tuple callback type hints updated; the HasAuthorization trait no longer registers a replicated model event. Changes
Sequence Diagram(s)(Skipped — changes are signature/type adjustments and an event removal; no new control-flow interaction requiring a sequence diagram.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
src/Testing/FakeOpenFga.php(3 hunks)src/Testing/FakesOpenFga.php(4 hunks)src/Traits/HasAuthorization.php(0 hunks)
💤 Files with no reviewable changes (1)
- src/Traits/HasAuthorization.php
🧰 Additional context used
📓 Path-based instructions (1)
**/*.php
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.php: Use PHP 8.3+ with strict typing (declare(strict_types=1))
Use modern PHP features such as constructor property promotion, readonly properties, and#[Override]attributes
Always use named parameters whenever possible for clarity, rather than positional parameters
Apply comprehensive Rector rules for code modernization
Maintain PHPStan level 1 and Psalm level 1 for type safety
Maintain strict typing and add proper PHPDoc annotations
**/*.php: Use PHP 8.3+ with strict typing (declare(strict_types=1))
Use modern PHP features such as constructor property promotion, readonly properties, and #[Override] attributes
Always use named parameters whenever possible (rather than positional parameters) for clarity
Apply comprehensive Rector rules for code modernization
Maintain strict typing and add proper PHPDoc annotations for type safety
Files:
src/Testing/FakeOpenFga.phpsrc/Testing/FakesOpenFga.php
🧬 Code graph analysis (2)
src/Testing/FakeOpenFga.php (3)
src/Testing/FakesOpenFga.php (2)
grant(134-137)revoke(139-142)src/Traits/HasAuthorization.php (2)
grant(160-169)revoke(258-267)src/Contracts/ManagerInterface.php (2)
grant(58-63)revoke(133-138)
src/Testing/FakesOpenFga.php (2)
src/Testing/FakeOpenFga.php (2)
grant(403-408)revoke(555-560)src/Contracts/ManagerInterface.php (4)
grant(58-63)revoke(133-138)listRelations(96-103)write(147-151)
🔇 Additional comments (4)
src/Testing/FakeOpenFga.php (1)
629-631: LGTM!The typed array parameter in the filter callback improves type safety and is consistent with the similar change in the
revoke()method.src/Testing/FakesOpenFga.php (3)
7-9: LGTM!The added imports are necessary for implementing
ManagerInterfaceand typing thewrite()method parameters.
124-124: LGTM!Implementing
ManagerInterfaceformalizes the contract and ensures the fake manager provides all required methods with correct signatures.
134-141: Signature changes align with ManagerInterface.The updated method signatures correctly match the
ManagerInterfacecontract (acceptingstring|array $userand returningbool). However, these methods delegate toFakeOpenFgamethods that only acceptstring, which will cause runtime errors if arrays are passed. Please ensure the underlyingFakeOpenFga::grant()andFakeOpenFga::revoke()methods are updated to handlestring|arrayas well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/Testing/FakesOpenFga.php(4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.php
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.php: Use PHP 8.3+ with strict typing (declare(strict_types=1))
Use modern PHP features such as constructor property promotion, readonly properties, and#[Override]attributes
Always use named parameters whenever possible for clarity, rather than positional parameters
Apply comprehensive Rector rules for code modernization
Maintain PHPStan level 1 and Psalm level 1 for type safety
Maintain strict typing and add proper PHPDoc annotations
**/*.php: Use PHP 8.3+ with strict typing (declare(strict_types=1))
Use modern PHP features such as constructor property promotion, readonly properties, and #[Override] attributes
Always use named parameters whenever possible (rather than positional parameters) for clarity
Apply comprehensive Rector rules for code modernization
Maintain strict typing and add proper PHPDoc annotations for type safety
Files:
src/Testing/FakesOpenFga.php
🧬 Code graph analysis (1)
src/Testing/FakesOpenFga.php (3)
src/Traits/HasAuthorization.php (2)
grant(160-169)revoke(258-267)src/Testing/FakeOpenFga.php (2)
grant(403-408)revoke(555-560)src/Contracts/ManagerInterface.php (4)
grant(58-63)revoke(133-138)listRelations(96-103)write(147-151)
🔇 Additional comments (4)
src/Testing/FakesOpenFga.php (4)
7-9: LGTM: Required imports for interface implementation.The imports are necessary for implementing
ManagerInterfaceand declaring thewritemethod signature withTupleKeysInterface.
124-124: LGTM: Interface implementation ensures contract compliance.Implementing
ManagerInterfaceon the anonymous class ensures all required methods are present and type-checked at compile time.
215-218: LGTM: Exception properly marks the method as unimplemented.Throwing
RuntimeExceptionclearly indicates this method is not yet implemented in the fake and prevents silent failures. This addresses the past review concern about missing return statements.
220-223: LGTM: Exception properly marks the method as unimplemented.Throwing
RuntimeExceptionclearly indicates this method is not yet implemented in the fake and prevents silent failures. This addresses the past review concern about missing return statements.
|
Closed cause of #71 |
Pull Request
Summary
Delete
replicatedevent and fix test suiteFixes #35
Type
Implementation
Deleted
replicatedevent this it doesnt exist in default laravel frameworkFixed types and implemented fake inline class
I didn't applied missed contract methods in this PR
Testing
Checklist
Summary by CodeRabbit
New Features
Behavior Changes