Skip to content

Commit a80311d

Browse files
committed
Update v2.x-automation-test for micro/plugin-security
1 parent b657ba7 commit a80311d

File tree

10 files changed

+34
-39
lines changed

10 files changed

+34
-39
lines changed

Business/Provider/SecurityProvider.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@
88
use Micro\Plugin\Security\Token\Token;
99
use Micro\Plugin\Security\Token\TokenInterface;
1010

11-
class SecurityProvider implements SecurityProviderInterface
11+
readonly class SecurityProvider implements SecurityProviderInterface
1212
{
1313
/**
1414
* @param EncoderFactoryInterface $encoderFactory
1515
* @param DecoderFactoryInterface $decoderFactory
1616
* @param ProviderConfigurationInterface $providerConfiguration
1717
*/
1818
public function __construct(
19-
private readonly EncoderFactoryInterface $encoderFactory,
20-
private readonly DecoderFactoryInterface $decoderFactory,
21-
private readonly ProviderConfigurationInterface $providerConfiguration,
22-
)
23-
{
19+
private EncoderFactoryInterface $encoderFactory,
20+
private DecoderFactoryInterface $decoderFactory,
21+
private ProviderConfigurationInterface $providerConfiguration,
22+
) {
2423
}
2524

2625
/**

Business/Provider/SecurityProviderFactory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
use Micro\Plugin\Security\Configuration\SecurityPluginConfigurationInterface;
77
use Micro\Plugin\Security\Business\Token\Encoder\EncoderFactoryInterface;
88

9-
class SecurityProviderFactory implements SecurityProviderFactoryInterface
9+
readonly class SecurityProviderFactory implements SecurityProviderFactoryInterface
1010
{
1111
/**
1212
* @param EncoderFactoryInterface $encoderFactory
1313
* @param DecoderFactoryInterface $decoderFactory
1414
* @param SecurityPluginConfigurationInterface $securityPluginConfiguration
1515
*/
1616
public function __construct(
17-
private readonly EncoderFactoryInterface $encoderFactory,
18-
private readonly DecoderFactoryInterface $decoderFactory,
19-
private readonly SecurityPluginConfigurationInterface $securityPluginConfiguration
17+
private EncoderFactoryInterface $encoderFactory,
18+
private DecoderFactoryInterface $decoderFactory,
19+
private SecurityPluginConfigurationInterface $securityPluginConfiguration
2020
)
2121
{
2222
}

Business/Token/Configuration/TokenConfiguration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Micro\Plugin\Security\Business\Token\Configuration;
44

5-
class TokenConfiguration
5+
readonly class TokenConfiguration
66
{
77
/**
88
* @var int
@@ -14,7 +14,7 @@ class TokenConfiguration
1414
* @param int $lifetime
1515
*/
1616
public function __construct(
17-
private readonly array $parameters,
17+
private array $parameters,
1818
private int $lifetime = 0
1919
)
2020
{

Business/Token/Decoder/DecoderInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface DecoderInterface
1515
*
1616
* @return array
1717
*
18-
* @throws InvalidArgumentException Provided key/key-array was empty or malformed
18+
* @throws \InvalidArgumentException Provided key/key-array was empty or malformed
1919
* @throws DomainException Provided JWT is malformed
2020
* @throws UnexpectedValueException Provided JWT was invalid
2121
* @throws SignatureInvalidException Provided JWT was invalid because the signature verification failed

Business/Token/Decoder/JWTDecoder.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55
use Firebase\JWT\JWT;
66
use Firebase\JWT\Key;
77

8-
class JWTDecoder implements DecoderInterface
8+
readonly class JWTDecoder implements DecoderInterface
99
{
1010
/**
1111
* @param string $publicKey
1212
* @param string $encryptAlgorithm
1313
*/
1414
public function __construct(
15-
private readonly string $publicKey,
16-
private readonly string $encryptAlgorithm
17-
)
18-
{
15+
private string $publicKey,
16+
private string $encryptAlgorithm
17+
) {
1918
}
2019

2120
/**

Business/Token/Encoder/JWTEncoder.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@
44

55
use Firebase\JWT\JWT;
66

7-
class JWTEncoder implements EncoderInterface
7+
readonly class JWTEncoder implements EncoderInterface
88
{
99
/**
1010
* @param string $privateKey
1111
* @param string $encryptAlgorithm
1212
* @param string|null $passphrase
1313
*/
1414
public function __construct(
15-
private readonly string $privateKey,
16-
private readonly string $encryptAlgorithm,
17-
private readonly null|string $passphrase = null,
18-
)
19-
{
15+
private string $privateKey,
16+
private string $encryptAlgorithm,
17+
private null|string $passphrase = null,
18+
) {
2019
}
2120

2221
/**

Facade/SecurityFacade.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
use Micro\Plugin\Security\Configuration\SecurityPluginConfigurationInterface;
77
use Micro\Plugin\Security\Token\TokenInterface;
88

9-
class SecurityFacade implements SecurityFacadeInterface
9+
readonly class SecurityFacade implements SecurityFacadeInterface
1010
{
11-
12-
public function __construct(private readonly SecurityProviderFactoryInterface $securityProviderFactory)
13-
{
11+
public function __construct(
12+
private SecurityProviderFactoryInterface $securityProviderFactory
13+
) {
1414
}
1515

1616
/**
@@ -38,7 +38,6 @@ public function decodeToken(string $encoded, string $providerName = null): Token
3838

3939
return $this->securityProviderFactory
4040
->create($providerName)
41-
->decodeToken($encoded)
42-
;
41+
->decodeToken($encoded);
4342
}
4443
}

SecurityPlugin.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ class SecurityPlugin implements DependencyProviderInterface, ConfigurableInterfa
2323
{
2424
use PluginConfigurationTrait;
2525

26-
/**
27-
* {@inheritDoc}
28-
*/
2926
public function provideDependencies(Container $container): void
3027
{
3128
$container->register(SecurityFacadeInterface::class, function () {

Token/Token.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
namespace Micro\Plugin\Security\Token;
44

5-
class Token implements TokenInterface
5+
readonly class Token implements TokenInterface
66
{
77
/**
88
* @param string $source
99
* @param array $parameters
1010
*/
1111
public function __construct(
12-
private readonly string $source,
13-
private readonly array $parameters
14-
)
15-
{
12+
private string $source,
13+
private array $parameters
14+
) {
1615
}
1716

1817
/**

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@
1717
"require": {
1818
"firebase/php-jwt": "^6"
1919
},
20-
"minimum-stability": "dev"
20+
"minimum-stability": "dev",
21+
"config": {
22+
"sort-packages": true
23+
}
2124
}

0 commit comments

Comments
 (0)