Skip to content

Commit

Permalink
Minor fixes after PHPMD
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankraemer committed Mar 16, 2024
1 parent 68c5a7f commit ca28e5c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/Authenticator/HttpDigestAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ protected function loginHeaders(ServerRequestInterface $request): array
if (is_bool($v)) {
$v = $v ? 'true' : 'false';
$opts[] = sprintf('%s=%s', $k, $v);
} else {
$opts[] = sprintf('%s="%s"', $k, $v);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/Identifier/Ldap/ExtensionAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public function setOption(int $option, $value)
*/
public function getOption($option)
{
$returnValue = null;
$this->setErrorHandler();
ldap_get_option($this->getConnection(), $option, $returnValue);
$this->unsetErrorHandler();
Expand Down
8 changes: 4 additions & 4 deletions src/Middleware/AuthenticationErrorHandlerMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
* @param \Phauthentic\Authentication\Authenticator\Exception\UnauthorizedException $e Exception.
* @return \Psr\Http\Message\ResponseInterface
*/
protected function createUnauthorizedResponse(UnauthorizedException $e): ResponseInterface
protected function createUnauthorizedResponse(UnauthorizedException $exception): ResponseInterface

Check failure on line 78 in src/Middleware/AuthenticationErrorHandlerMiddleware.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

PHPDoc tag @param references unknown parameter: $e

Check failure on line 78 in src/Middleware/AuthenticationErrorHandlerMiddleware.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

PHPDoc tag @param references unknown parameter: $e
{
$body = $this->streamFactory->createStream();
$body->write($e->getBody());
$body->write($exception->getBody());

$response = $this
->responseFactory
->createResponse($e->getCode())
->createResponse($exception->getCode())
->withBody($body);

foreach ($e->getHeaders() as $header => $value) {
foreach ($exception->getHeaders() as $header => $value) {
$response = $response->withHeader($header, $value);
}

Expand Down

0 comments on commit ca28e5c

Please sign in to comment.