Skip to content
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

Update error500.php cannot use protected property #970

Closed
wants to merge 1 commit into from

Conversation

markusramsak
Copy link
Contributor

@markusramsak markusramsak commented Sep 14, 2023

cannot use protected property params -> use ->getBoundParams()

@othercorey othercorey added this to the 5.x milestone Sep 14, 2023
@othercorey
Copy link
Member

The annotation seems incorrect here if $error can be an instance of Error.

@@ -24,9 +24,9 @@
<?= h($error->queryString) ?>
</p>
<?php endif; ?>
<?php if (!empty($error->params)) : ?>
<?php if (!empty($error->getBoundParams())) : ?>
Copy link
Member

Choose a reason for hiding this comment

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

If $error can be multiple classes, should probably wrap all of this in a instanceof check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but the Error class also only has getBoundParams() and protected params ...

Copy link
Member

Choose a reason for hiding this comment

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

Which exception class has getBoundParams()? I only see it on Database\Statement\Statement.

Copy link
Member

@ADmad ADmad Sep 15, 2023

Choose a reason for hiding this comment

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

This now needs to be a method_exists() check now or better yet an instanceof check for specific exception class. Suggested change will generate errors for other error classes.

@dereuromark dereuromark mentioned this pull request Jan 7, 2024
3 tasks
Copy link

This pull request is stale because it has been open 30 days with no activity. Remove the stale label or comment on this issue, or it will be closed in 15 days

@github-actions github-actions bot added the stale label Jan 14, 2024
@github-actions github-actions bot closed this Jan 30, 2024
ADmad added a commit that referenced this pull request Feb 21, 2024
With debug enabled the WebExceptionRenderer switches the template to pdo_error.php,
so having checks for SQL query related stuff in debug mode is redundant.

Refs #970, closes #992.
@ADmad ADmad mentioned this pull request Feb 21, 2024
ADmad added a commit that referenced this pull request Feb 21, 2024
With debug enabled the WebExceptionRenderer switches the template to pdo_error.php,
so having checks for SQL query related stuff in debug mode is redundant.

Refs #970, closes #992.
ADmad added a commit that referenced this pull request Feb 21, 2024
With debug enabled the WebExceptionRenderer switches the template to pdo_error.php in case
of a PDOException, so having checks for SQL query related stuff in debug mode is redundant.

Refs #970, closes #992.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants