Skip to content

Commit

Permalink
Fix psr/log dependency (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie committed Jan 21, 2024
1 parent 9c4b605 commit c31be2c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2']
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"vectorface/whip": "^0.4",
"twig/twig": "^2.0",
"nikic/fast-route":"^1.0.0",
"psr/log": "^1.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"ext-json": "*"
},
"require-dev": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ public function handleException(Exception $e)
if ($e instanceof RouterExceptionInterface) {
$responseCode = $e->getAssociatedStatusCode();
}
http_response_code($responseCode);
if (!headers_sent()) {
http_response_code($responseCode);
}
return parent::handleException($e);
}

Expand Down
4 changes: 3 additions & 1 deletion src/Vectorface/SnappyRouter/Handler/ControllerHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ public function performRoute()
$action = null;
$this->determineControllerAndAction($controller, $action);
$response = $this->invokeControllerAction($controller, $action);
http_response_code($response->getStatusCode());
if (!headers_sent()) {
http_response_code($response->getStatusCode());
}
return $this->getEncoder()->encode($response);
}

Expand Down
4 changes: 3 additions & 1 deletion src/Vectorface/SnappyRouter/SnappyRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ private function handleInvocationException($exception, $activeHandler, $isCli)
if ($exception instanceof RouterExceptionInterface) {
$responseCode = $exception->getAssociatedStatusCode();
}
http_response_code($responseCode);
if (!headers_sent()) {
http_response_code($responseCode);
}
}
return $exception->getMessage();
}
Expand Down

0 comments on commit c31be2c

Please sign in to comment.