Skip to content

Commit

Permalink
attempts to resolve #68 by only overriding error handler func during …
Browse files Browse the repository at this point in the history
…generation
  • Loading branch information
dcarbone committed Feb 27, 2021
1 parent d97fa43 commit 36eb71a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 30 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
language: php
dist: trusty
dist: xenial

php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
Expand Down
7 changes: 1 addition & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
"psr/log": "@stable"
},
"require-dev": {
"ext-libxml": "*",
"ext-json": "*",
"ext-simplexml": "*",
"ext-curl": "*",
"myena/default-logger": "@stable",
"phpunit/phpunit": "@stable"
Expand All @@ -45,8 +42,7 @@
"autoload": {
"files": [
"files/constants.php",
"files/funcs.php",
"files/errors.php"
"files/funcs.php"
],
"psr-4": {
"DCarbone\\PHPFHIR\\": "src/"
Expand All @@ -58,7 +54,6 @@
}
},
"suggest": {
"myena/default-logger": "Simple PSR-compliant logger",
"ext-zip": "To enable unzipping of downloaded source files"
}
}
21 changes: 0 additions & 21 deletions files/errors.php

This file was deleted.

6 changes: 6 additions & 0 deletions src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public function getDefinition()
*/
public function buildFHIRClasses()
{
set_error_handler(function ($errNum, $errStr, $errFile, $errLine) {
throw new \ErrorException($errStr, $errNum, 1, $errFile, $errLine);
});

$log = $this->config->getLogger();

$this->beforeGeneration();
Expand Down Expand Up @@ -104,6 +108,8 @@ public function buildFHIRClasses()
}
}
$log->endBreak('FHIR Class Generation');

restore_error_handler();
}

/**
Expand Down

0 comments on commit 36eb71a

Please sign in to comment.