-
Notifications
You must be signed in to change notification settings - Fork 6
0.6.x gateway improvements #110
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Refactor RowGateway and TableGateway classes to use PHP 8+ features: - Replace docblock type hints with native property type declarations using union types and nullable types - Add return type declarations to methods (offsetExists(): bool, offsetGet(): mixed, count(): int, etc.) - Use static return type for fluent interface methods - Convert constructor parameters to use union types in RowGateway and TableGateway Improve type safety and code quality: - Replace loose equality (==) with strict equality (===) in primary key comparisons - Simplify initialization checks using null comparisons instead of instanceof checks - Add proper instanceof StatementInterface guards before executing statements - Add lazy initialization to getFeatureSet(), getResultSetPrototype(), and getSql() getters - Add default case to match expression in TableGateway constructor - Update TableGatewayInterface::getTable() to return proper union type Cleanup: - Remove unused imports (is_string) - Remove redundant comments and phpcs ignore directives - Remove unused $alias variable in foreach loop - Fix @todo annotation format Update tests: - Change primaryKeyColumn to array format to match expected type - Remove unnecessary setAccessible(true) calls (not needed in PHP 8.1+) Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Reverted constructor in TableGateway to allow nullable args and pass existing tests Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Introduced spread operators instead of call_user_func_array
Aligned return types
Modified existing files to add RowPrototypeInterface Updated tests
Signed-off-by: Simon Mundy <46739456+simon-mundy@users.noreply.github.com>
tyrsson
reviewed
Jan 11, 2026
test/unit/TableGateway/Feature/TestAsset/TestGlobalAdapterFeatureSubclass.php
Show resolved
Hide resolved
Added new FeatureInterface
…ements # Conflicts: # src/RowGateway/AbstractRowGateway.php
tyrsson
approved these changes
Jan 12, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
enhancement
New feature or request
Lang Feature Refactor
Refactoring to new language features
qa
Improvements in quality assurance of the project
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds PHP8.2+ modernisation, strong typing and general code cleanup.
Adds new RowPrototypeInterface to solve issues with new ResultSet and RowGateway
Adds 100% code coverage testing
Closes #63