Skip to content

Commit

Permalink
php 7.2 & 7.3 issue with xdebug
Browse files Browse the repository at this point in the history
  • Loading branch information
bkdotcom committed Oct 15, 2024
1 parent f984104 commit 4d102d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
php-version: ${{ matrix.php-version }}
extensions: intl, mysqli, oauth
ini-values: error_reporting=-1, memory_limit=512M, post_max_size=256M, xdebug.mode="debug,coverage,develop"
ini-values: error_reporting=-1, memory_limit=512M, post_max_size=256M, xdebug.mode="coverage,debug,develop"
coverage: xdebug #optional
- name: Check PHP Version
run: |
Expand Down
10 changes: 7 additions & 3 deletions src/Debug/Abstraction/Object/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,19 @@ private function onStartMysqli(Abstraction $abs)
test if stat() throws an error (ie "Property access is not allowed yet")
if so, don't collect property values
*/
\set_error_handler(static function ($errno, $errstr) {
throw new RuntimeException($errstr, $errno); // @codeCoverageIgnore
$haveError = false;
\set_error_handler(static function ($errno, $errstr) use (&$haveError) {
$haveError = true;
}, E_ALL);
try {
$mysqli = $abs->getSubject();
$mysqli->stat();
} catch (Error $e) {
$abs['collectPropertyValues'] = false;
$haveError = true;
} catch (RuntimeException $e) {
$haveError = true;
}
if ($haveError) {
$abs['collectPropertyValues'] = false;
}
\restore_error_handler();
Expand Down

0 comments on commit 4d102d5

Please sign in to comment.