Skip to content

Breaking changes in modernize code#100

Open
sukhwinder33445 wants to merge 1 commit intomainfrom
modernize-code-with-breaking-changes
Open

Breaking changes in modernize code#100
sukhwinder33445 wants to merge 1 commit intomainfrom
modernize-code-with-breaking-changes

Conversation

@sukhwinder33445
Copy link
Contributor

@sukhwinder33445 sukhwinder33445 commented Mar 13, 2026

This PR adds parameter types and return types to method Connection::prepexec().

This change requires an adjustment in the sub-class Icinga\Module\Reporting\RetryConnection of the reporting module.

public function prepexec(
Delete|Insert|Select|Update|string $stmt,
string|array|null $values = null
): PDOStatement|false {
Copy link
Member

Choose a reason for hiding this comment

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

How can false be returned?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this because PDO::prepare() could return false, but overlooked that the default adapter option (PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION) enforce PDO to throw an exception instead of returning false.

I will remove the false return type.

This change requires an adjustment in the sub-class
`Icinga\Module\Reporting\RetryConnection` of the reporting module.
@sukhwinder33445 sukhwinder33445 force-pushed the modernize-code-with-breaking-changes branch from eacf096 to 287e959 Compare March 20, 2026 16:52
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.

3 participants