Skip to content

Commit 994deae

Browse files
committed
Fix phpstan-issues
1 parent def0dfc commit 994deae

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

phpstan-baseline.neon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Parameter \$assertions of class SimpleSAML\\SAML2\\XML\\samlp\\Response constructor expects array\<SimpleSAML\\SAML2\\XML\\saml\\Assertion\|SimpleSAML\\SAML2\\XML\\saml\\EncryptedAssertion\>, array\<int, SimpleSAML\\XMLSecurity\\XML\\SignableElementInterface\> given\.$#'
5+
identifier: argument.type
6+
count: 1
7+
path: src/Controller/AttributeServer.php

phpstan.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ parameters:
22
level: 6
33
paths:
44
- src
5+
includes:
6+
- phpstan-baseline.neon

src/Controller/AttributeServer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public function setMetadataStorageHandler(MetaDataStorageHandler $handler): void
9393
*/
9494
public function main(/** @scrutinizer ignore-unused */ SOAP $soap, ServerRequest $request): RunnableResponse
9595
{
96+
/** @var \SimpleSAML\SAML2\XML\samlp\AttributeQuery $message */
9697
$message = $soap->receive($request);
9798
Assert::isInstanceOf($message, AttributeQuery::class, InvalidDOMElementException::class);
9899

@@ -103,9 +104,6 @@ public function main(/** @scrutinizer ignore-unused */ SOAP $soap, ServerRequest
103104
throw new Error\BadRequest('Missing <saml:Issuer> in <samlp:AttributeQuery>.');
104105
} else {
105106
$spEntityId = $issuer->getContent();
106-
if ($spEntityId === null) {
107-
throw new Error\BadRequest('Empty <saml:Issuer> in <samlp:AttributeQuery>.');
108-
}
109107
}
110108

111109
$idpMetadata = $this->metadataHandler->getMetaDataConfig($idpEntityId, 'saml20-idp-hosted');

tests/src/Controller/AttributeServerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ public function testMain(): void
8585
$request = new ServerRequest('', '');
8686
$response = $c->main($soap, $request);
8787

88-
$this->assertInstanceOf(RunnableResponse::class, $response);
8988
$this->assertTrue($response->isSuccessful());
9089
}
9190

9291

9392
/**
93+
* @param mixed $input
9494
* @return \SimpleSAML\SAML2\Binding\SOAP
9595
*/
9696
private function getStubWithInput($input): SOAP

0 commit comments

Comments
 (0)