User tests: Successful: Unsuccessful:
Added an explicit return type hint to the getRowOffset() public method in libraries/src/Pagination/Pagination.php.
Updated method:
getRowOffset(): intThis improves type safety and aligns with Joomla's PHP 8 modernization efforts.
libraries/src/Pagination/Pagination.phpgetRowOffset() now declares an explicit int return typegetRowOffset() did not declare an explicit return type.
getRowOffset() now declares an explicit int return type, improving type safety and static analysis support.
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
| Labels |
Added:
PR-6.2-dev
|
||
In theory, adding return type for a method like that is counted as backward incompatible change. It will cause fatal error if child class extends the class and override getRowOffset method for whatever reason. Also, adding return type for only one method in the class while other methods in same class still without return type is not very useful, I think we should not go with it.
You're right, this could introduce backward compatibility issues for child classes overriding the method. Thanks for pointing that out.
You're right, this could introduce backward compatibility issues for child classes overriding the method. Thanks for pointing that out. I'll close this PR.
| Status | Pending | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-05-19 07:36:07 |
| Closed_By | ⇒ | Mahesh-Gite-28 |
Is this backwards compatible?