Skip to content

Commit

Permalink
Small corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-meyer committed Jul 18, 2024
1 parent c6193ed commit fb823d6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@

require __DIR__ . '/../vendor/autoload.php';

$app = new App();
$app->run();
(new App())->run();
7 changes: 7 additions & 0 deletions src/Middleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,11 @@ protected function processResponse(ResponseInterface $response): ResponseInterfa
}
return $response;
}

final public function __construct()
{
// Make constructor final to avoid issues in dispatcher.
// @see https://psalm.dev/229
}

}
5 changes: 3 additions & 2 deletions src/Middleware/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ protected function processRequest(ServerRequestInterface $request): ServerReques
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;
Expand Down

0 comments on commit fb823d6

Please sign in to comment.