Small corrections
This commit is contained in:
parent
c6193ede07
commit
fb823d6033
|
@ -24,7 +24,7 @@
|
|||
"support": {
|
||||
"issues": "https://github.com/opencultureconsulting/oai-pmh2/issues",
|
||||
"source": "https://github.com/opencultureconsulting/oai-pmh2",
|
||||
"docs": "https://github.com/opencultureconsulting/oai-pmh2/blob/main/README.md"
|
||||
"docs": "https://opencultureconsulting.github.io/oai-pmh2/"
|
||||
},
|
||||
"require": {
|
||||
"php": "^8.1",
|
||||
|
@ -61,8 +61,8 @@
|
|||
},
|
||||
"scripts": {
|
||||
"pre-install-cmd": [
|
||||
"@php -r \"!is_dir('./data') && mkdir('./data', 0775);\"",
|
||||
"@php -r \"!file_exists('./config/config.yml') && copy('./config/config.dist.yml', './config/config.yml');\""
|
||||
"@php -r \"if (!is_dir('./data')) { mkdir('./data', 0775); }\"",
|
||||
"@php -r \"if (!file_exists('./config/config.yml')) { copy('./config/config.dist.yml', './config/config.yml'); }\""
|
||||
],
|
||||
"post-install-cmd": [
|
||||
"@doctrine:clear-cache --quiet",
|
||||
|
|
|
@ -24,5 +24,4 @@ namespace OCC\OaiPmh2;
|
|||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
$app = new App();
|
||||
$app->run();
|
||||
(new App())->run();
|
||||
|
|
|
@ -77,4 +77,11 @@ abstract class Middleware extends AbstractMiddleware
|
|||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
final public function __construct()
|
||||
{
|
||||
// Make constructor final to avoid issues in dispatcher.
|
||||
// @see https://psalm.dev/229
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -88,9 +88,10 @@ class Dispatcher extends AbstractMiddleware
|
|||
if (!ErrorHandler::getInstance()->hasErrors()) {
|
||||
/** @var string */
|
||||
$verb = $request->getAttribute('verb');
|
||||
/** @var Middleware $middleware */
|
||||
$middleware = __NAMESPACE__ . '\\' . $verb;
|
||||
$this->requestHandler->queue->enqueue(new $middleware());
|
||||
if (is_a($middleware, Middleware::class, true)) {
|
||||
$this->requestHandler->queue->enqueue(new $middleware());
|
||||
}
|
||||
}
|
||||
$this->requestHandler->queue->enqueue(ErrorHandler::getInstance());
|
||||
return $request;
|
||||
|
|
Loading…
Reference in New Issue