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

Added support for PDO exception mode, which is default in PHP 8 #52

Closed
wants to merge 4 commits into from

Conversation

boan-jfm
Copy link
Contributor

@boan-jfm boan-jfm commented Jul 5, 2022

Added support for PDO error mode set to ERRMODE_EXCEPTION, which is the new default in PHP 8.

Added return type to the getIterator method within the Result model extending the IteratorAggregate. This has added return types in new PHP versions.

Resolves #51

@boan-jfm

This comment was marked as resolved.

"ext-pdo": "*",
"mindplay/unbox": "^2",
"psr/log": "^1"
},
"require-dev": {
"mindplay/testies": "^0.3.2",
"mindplay/benchpress": "^0.1",
"mockery/mockery": "^0.9",
"mockery/mockery": "^1.5.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This supports newer versions of PHP

@@ -85,7 +85,7 @@ public function all()
*
* @return Iterator
*/
public function getIterator()
public function getIterator(): Iterator
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Must adhere to the updated interface in new PHP versions

@mindplay-dk
Copy link
Owner

Thanks, but I'm not currently maintaining this.

If you need these changes anytime soon, you should fork.

@boan-jfm
Copy link
Contributor Author

boan-jfm commented Jul 7, 2022

Okay, thank you for the reply 👍 😊

@@ -104,7 +105,13 @@ public function execute()
{
$microtime_begin = microtime(true);

if (@$this->handle->execute()) {
try {
$execution_successful = @$this->handle->execute();
Copy link
Owner

Choose a reason for hiding this comment

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

We probably shouldn't @ error-suppress in a try/catch?

@mindplay-dk
Copy link
Owner

I've done some maintenance today, the project should be in a better state for PHP 8 now.

I've reviewed the change - if you'd like to update this PR, I will merge it.

mindplay-dk added a commit that referenced this pull request May 28, 2024
@mindplay-dk
Copy link
Owner

Fixed in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP 8 support - error handling mode has been changed from "silent" to "exceptions"
2 participants