-
-
Notifications
You must be signed in to change notification settings - Fork 3
Cleanup #48
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
Conversation
samdark
commented
Dec 21, 2025
| Q | A |
|---|---|
| Is bugfix? | ❌ |
| New feature? | ❌ |
| Breaks BC? | ❌ |
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.
Pull request overview
This PR performs code cleanup by modernizing PHP syntax and improving code style consistency across the codebase. The changes focus on using fully qualified class names from imports, updating attribute syntax, and adding proper type hints.
Key changes:
- Replaced
#[\Override]with#[Override]after adding properuse Override;imports - Added type hints to static properties (e.g.,
public static $DRIVER→public static ?string $DRIVER) - Replaced fully qualified class names with imported aliases (e.g.,
\ArrayIterator→ArrayIterator,\ReflectionMethod→ReflectionMethod) - Updated
EntityWriterconstructor to usereadonlyproperty promotion - Simplified string interpolation syntax from
{$var}to$varin test assertions - Replaced deprecated
Handlerclass reference withHandlerInterface
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/Sqlite/Reader/FilterHandler/SqliteLikeHandlerTest.php | Added type hint to static $DRIVER property |
| tests/Unit/Reader/EntityReaderTest.php | Added ReflectionMethod import and replaced fully qualified name |
| tests/Unit/Reader/Cache/CachedCountTest.php | Added Countable import and replaced fully qualified name |
| tests/Unit/Reader/Cache/CachedCollectionTest.php | Added ArrayIterator import, replaced fully qualified names, removed Generator type assertion |
| tests/Unit/Mssql/Reader/FilterHandler/SqlServerLikeHandlerTest.php | Added type hint to static $DRIVER property |
| tests/Feature/DataTrait.php | Added type hint to $DRIVER property, updated Handler to HandlerInterface |
| tests/Feature/Base/Writer/BaseEntityWriterTestCase.php | Added iterator_to_array function import and replaced fully qualified calls |
| tests/Feature/Base/Reader/ReaderWithFilter/BaseReaderWithOrXTestCase.php | Simplified string interpolation syntax in assertions |
| tests/Feature/Base/Reader/ReaderWithFilter/BaseReaderWithAllTestCase.php | Simplified string interpolation syntax in assertions |
| src/Writer/EntityWriter.php | Added Override import, updated attribute syntax, added readonly to constructor property |
| src/Reader/FilterHandler/OrXHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/NotHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/NoneHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/LikeHandler/SqliteLikeHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/LikeHandler/SqlServerLikeHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/LikeHandler/PostgresLikeHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/LikeHandler/MysqlLikeHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/LikeHandler/BaseLikeHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/LessThanOrEqualHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/LessThanHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/InHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/GreaterThanOrEqualHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/GreaterThanHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/EqualsNullHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/EqualsHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/BetweenHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/AndXHandler.php | Added Override import and updated attribute syntax |
| src/Reader/FilterHandler/AllHandler.php | Added Override import and updated attribute syntax |
| src/Reader/EntityReader.php | Added Override import and updated attribute syntax |
| src/Reader/Cache/CachedCollection.php | Added Generator import and replaced fully qualified return type |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $cachedCollection->setCollection($collection); | ||
|
|
||
| $this->assertInstanceOf(\Generator::class, $cachedCollection->getGenerator()); | ||
| $this->assertSame(['foo'], iterator_to_array($cachedCollection->getGenerator())); |
Copilot
AI
Dec 21, 2025
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.
A test assertion was removed that verified the return type of getGenerator() is a Generator. This reduces test coverage by removing validation of the method's return type. Consider keeping this assertion to maintain comprehensive test coverage.
| use Cycle\Database\DatabaseManager; | ||
| use Cycle\Database\DatabaseProviderInterface; | ||
| use Cycle\Database\Driver\Handler; | ||
| use Cycle\Database\Driver\HandlerInterface; |
Copilot
AI
Dec 21, 2025
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.
The old import statement for Handler is no longer used after replacing Handler::DROP_FOREIGN_KEYS with HandlerInterface::DROP_FOREIGN_KEYS. This unused import should be removed as part of the cleanup.
| use Cycle\Database\Driver\HandlerInterface; |