Skip to content

Add strict type declarations and modernize codebase#155

Open
BastianLedererIcinga wants to merge 4 commits intomainfrom
modernize-code
Open

Add strict type declarations and modernize codebase#155
BastianLedererIcinga wants to merge 4 commits intomainfrom
modernize-code

Conversation

@BastianLedererIcinga
Copy link
Contributor

@BastianLedererIcinga BastianLedererIcinga commented Dec 9, 2025

Add strict type declarations to all method parameters, return types, and
properties throughout the codebase. Replace return type self with
static for better fluent interface support. Remove redundant runtime
type checks now enforced by the type system. Replace list() with array
destructuring.

Raise the minimum required ipl/sql and ipl/stdlib versions to adopt
their strict type declarations.

requires Icinga/ipl-stdlib#63
requires Icinga/ipl-sql#96

@cla-bot cla-bot bot added the cla/signed label Dec 9, 2025
@BastianLedererIcinga BastianLedererIcinga changed the base branch from main to 8.4/8.5-compatibility December 9, 2025 13:28
@BastianLedererIcinga BastianLedererIcinga marked this pull request as ready for review December 9, 2025 13:30
Jan-Schuppik
Jan-Schuppik previously approved these changes Dec 10, 2025
@BastianLedererIcinga BastianLedererIcinga force-pushed the 8.4/8.5-compatibility branch 3 times, most recently from 40c7f0b to be36f28 Compare December 18, 2025 14:17
Base automatically changed from 8.4/8.5-compatibility to main January 7, 2026 12:55
@lippserd lippserd dismissed stale reviews from sukhwinder33445 and Jan-Schuppik January 7, 2026 12:55

The base branch was changed.

Copy link
Contributor

@sukhwinder33445 sukhwinder33445 left a comment

Choose a reason for hiding this comment

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

  1. I think we can define return types for PersistBehavior|RetrieveBehavior interfaces, as they are not overridden by any other module.
  2. Please use [...] instead of list()
  3. Please import the class instead of using qualifier in PropertiesWithDefaults (line 10-11).
  4. Please remove the unused variable $err in MillisecondTimestamp.

Note for myself:
The following classes and interfaces have not yet been modernized, as they are overridden by some modules (TBD):
Classes:

  • PropertyBehavior
  • Binary|BoolCast|MillisecondTimestamp
  • Model
  • UnionModel
  • ResultSet
  • Relation (partially)
  • Query (Partially)

Interfaces:

  • QueryAwareBehavior
  • RewriteColumnBehavior
  • RewriteFilterBehavior

Copy link
Contributor

@sukhwinder33445 sukhwinder33445 left a comment

Choose a reason for hiding this comment

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

Looks good.
Please use backticks in the commits to highlight function, class, interface, etc. names.

@BastianLedererIcinga BastianLedererIcinga force-pushed the modernize-code branch 2 times, most recently from 28bd4f2 to 1a6a329 Compare March 3, 2026 13:46
BastianLedererIcinga added a commit to Icinga/icinga-notifications-web that referenced this pull request Mar 4, 2026
Add types and missing return statements for implementations of:
* `QueryAwarebehavior`
* `RewriteFilterbehavior`

To ensure compatibility with Icinga/ipl-orm#155.

Add types to `ContactForm::isValidEent()` as required by
Icinga/ipl-stdlib#68
@BastianLedererIcinga BastianLedererIcinga force-pushed the modernize-code branch 6 times, most recently from 59f2fe9 to 9b944e8 Compare March 5, 2026 08:11
sukhwinder33445
sukhwinder33445 previously approved these changes Mar 5, 2026
Copy link
Contributor

@sukhwinder33445 sukhwinder33445 left a comment

Choose a reason for hiding this comment

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

Looks good to me.
@lippserd, please take a look.

sukhwinder33445
sukhwinder33445 previously approved these changes Mar 5, 2026
BastianLedererIcinga and others added 4 commits March 19, 2026 15:18
Add strict type declarations to properties, function/method signatures, where
types are unambiguous and no inheritance  or interface contract is affected.
Raise the minimum `ipl/sql` and `ipl/stdlib` requirements to versions that
include the strict-typing updates and PHP 8.5 support.
@lippserd lippserd changed the title Modernize code Add strict type declarations and modernize codebase Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants