- Small WIP of template and adjusted the composer.json allowing registration into the autoload

This commit is contained in:
Dave Mc Nicoll committed 2019-07-04 13:27:49 -04:00
1 parent db8bf36cf7
commit ec873145d2
3 files changed
+69 -2

No files matched your search

+9 -1
View File
@@ -21,10 +21,12 @@ class JavascriptMiddleware implements MiddlewareInterface
"headers" => [
"User-Agent" => "TheBugs/1.0",
],
# Callable functions
"functions" => []
];
/**
* Filter list, allows custom invokable
* Filter list, allows custom invokable too
* @var array
*/
protected $filters = [];
@@ -56,6 +58,12 @@ class JavascriptMiddleware implements MiddlewareInterface
}
}
foreach($this->filters['functions'] as $func) {
if ( $func->bindTo($this, $this)() ) {
return $handler->handle($request);
}
}
$this->throwError(json_decode($request->getBody(), true));
}