Skip to content

Commit da64009

Browse files
committed
PHPCS: search comments for annotations
Prior to this change, phpcs would not allow imports for classes referenced in annotations only. This change enables that. Also, fix a wrong reference to `\LogicException` where in reality `\Surfnet\SamlBundle\Security\Exception\LogicException` was thrown.
1 parent b057d6e commit da64009

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

ci/qa/phpcs.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
</rule>
2424

2525
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"/>
26-
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/>
26+
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
27+
<properties>
28+
<property name="searchAnnotations" type="bool" value="true"/>
29+
</properties>
30+
</rule>
2731
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
2832
</ruleset>

src/Http/ReceivedAuthnRequestPost.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
namespace Surfnet\SamlBundle\Http;
2020

21+
use Exception;
2122
use RobRichards\XMLSecLibs\XMLSecurityKey;
2223
use Surfnet\SamlBundle\Http\Exception\InvalidRequestException;
2324
use Surfnet\SamlBundle\SAML2\ReceivedAuthnRequest;
@@ -80,7 +81,7 @@ public function getRelayState(): ?string
8081
}
8182

8283
/**
83-
* @throws \Exception when signature is invalid (@see SAML2\Utils::validateSignature)
84+
* @throws Exception when signature is invalid (@see SAML2\Utils::validateSignature)
8485
*/
8586
public function verify(XMLSecurityKey $key): bool
8687
{

src/Security/Authentication/AuthenticatedSessionStateHandler.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@
1818

1919
namespace Surfnet\SamlBundle\Security\Authentication;
2020

21+
use Surfnet\SamlBundle\Security\Exception\LogicException;
2122
use Surfnet\SamlBundle\Value\DateTime;
2223

2324
interface AuthenticatedSessionStateHandler
2425
{
2526
/**
2627
* Sets the moment at which the user was authenticated
2728
*
28-
* @throws \LogicException when an authentication moment was already logged
29+
* @throws LogicException when an authentication moment was already logged
2930
*/
3031
public function logAuthenticationMoment(): void;
3132

@@ -34,7 +35,7 @@ public function isAuthenticationMomentLogged(): bool;
3435
/**
3536
* Gets the moment at which the user was authenticated
3637
*
37-
* @throws \LogicException when no authentication moment was logged
38+
* @throws LogicException when no authentication moment was logged
3839
*/
3940
public function getAuthenticationMoment(): DateTime;
4041

0 commit comments

Comments
 (0)