Skip to content

Commit

Permalink
Merge pull request #50 from Evaneos/fix/php-7-compatible-fixes
Browse files Browse the repository at this point in the history
fix(chore): php 7 compatible fixes
  • Loading branch information
Marc authored Oct 5, 2021
2 parents eb37af4 + 4dbd85f commit 13f98c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pyrite
Pyrite framework
======

Stack Framework
Stack Framework used by many evaneos repos
9 changes: 5 additions & 4 deletions src/Stack/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ
$stackedLayers = $this->buildLayerStack($request, $this->layers);

// run them & get the response bag
if (count($stackedLayers)) {
if (is_array($stackedLayers) && count($stackedLayers)) {
try {
$stackedLayers->handle($responseBag);
$stackedLayer = reset($stackedLayers);
$stackedLayer->handle($responseBag);
} catch (\Exception $e) {
$handlerFound = false;
foreach ($this->exceptionHandlers as $exceptionName => $handler) {
Expand Down Expand Up @@ -88,7 +89,7 @@ protected function buildLayerStack(Request $request, array $layers = array())
}

if (count($layerObjects)) {
return reset($layerObjects);
return $layerObjects;
} else {
return array();
}
Expand Down Expand Up @@ -132,6 +133,6 @@ protected function buildResponseFromResponseBag(ResponseBag $responseBag)
*/
public function terminate(Request $request, Response $response)
{

}
}

0 comments on commit 13f98c0

Please sign in to comment.