Skip to content

Commit

Permalink
Interface fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Spomky committed Jun 3, 2019
1 parent ee44e52 commit b037d7f
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 20 deletions.
1 change: 1 addition & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ return PhpCsFixer\Config::create()
'@DoctrineAnnotation' => true,
'@PHP70Migration' => true,
'@PHP71Migration' => true,
'phpdoc_no_empty_return' => false,
'strict_param' => true,
'strict_comparison' => true,
'array_syntax' => ['syntax' => 'short'],
Expand Down
4 changes: 3 additions & 1 deletion Checker/AlgHeaderChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ public function __construct(string $algorithm)

/**
* @param mixed $algorithm
*
* @return void
*/
public function checkHeader($algorithm): void
public function checkHeader($algorithm)
{
if (!\is_string($algorithm)) {
throw new InvalidHeaderException('The value of the header "alg" is not valid', 'alg', $algorithm);
Expand Down
4 changes: 3 additions & 1 deletion Checker/EncHeaderChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ public function __construct(string $algorithm)

/**
* @param mixed $algorithm
*
* @return void
*/
public function checkHeader($algorithm): void
public function checkHeader($algorithm)
{
if (!\is_string($algorithm)) {
throw new InvalidHeaderException('The value of the header "enc" is not valid', 'enc', $algorithm);
Expand Down
8 changes: 6 additions & 2 deletions Checker/IssuerChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ public function supportedClaim(): string

/**
* @param mixed $issuer
*
* @return void
*/
public function checkClaim($issuer): void
public function checkClaim($issuer)
{
if ($this->issuer !== $issuer) {
throw new \Exception(sprintf('The issuer "%s" is not allowed.', $issuer));
Expand All @@ -54,8 +56,10 @@ public function checkClaim($issuer): void

/**
* @param mixed $value
*
* @return void
*/
public function checkHeader($value): void
public function checkHeader($value)
{
$this->checkClaim($value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
final class EncryptionSupportCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
* @return void
*/
public function process(ContainerBuilder $container): void
public function process(ContainerBuilder $container)
{
if (false === $container->hasDefinition(LexikJoseEncoder::class) || false === $container->getParameter('lexik_jose_bridge.encoder.encryption.enabled')) {
return;
Expand Down
5 changes: 4 additions & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ public function getConfigTreeBuilder()
return $treeBuilder;
}

private function addEncryptionSection(NodeDefinition $node): void
/**
* @return void
*/
private function addEncryptionSection(NodeDefinition $node)
{
$node
->addDefaultsIfNotSet()
Expand Down
16 changes: 8 additions & 8 deletions DependencyInjection/SpomkyLabsLexikJoseExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public function getAlias()
}

/**
* {@inheritdoc}
* @return void
*/
public function load(array $configs, ContainerBuilder $container): void
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
Expand Down Expand Up @@ -63,27 +63,27 @@ public function load(array $configs, ContainerBuilder $container): void
}

/**
* @param ContainerBuilder $container
* @return void
*/
public function loadServices(ContainerBuilder $container): void
public function loadServices(ContainerBuilder $container)
{
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
}

/**
* @param ContainerBuilder $container
* @return void
*/
public function loadEncryptionServices(ContainerBuilder $container): void
public function loadEncryptionServices(ContainerBuilder $container)
{
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('encryption_services.yml');
}

/**
* {@inheritdoc}
* @return void
*/
public function prepend(ContainerBuilder $container): void
public function prepend(ContainerBuilder $container)
{
$isDebug = $container->getParameter('kernel.debug');
$bridgeConfig = current($container->getExtensionConfig($this->getAlias()));
Expand Down
4 changes: 3 additions & 1 deletion Encoder/LexikJoseEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,10 @@ public function __construct(JWSBuilder $jwsBuilder,
* @param int|string $encryptionKeyIndex
* @param string $keyEncryptionAlgorithm
* @param string $contentEncryptionAlgorithm
*
* @return void
*/
public function enableEncryptionSupport(JWEBuilder $jweBuilder, JWEDecrypter $jweLoader, HeaderCheckerManager $encryptionHeaderCheckerManager, JWKSet $encryptionKeyset, $encryptionKeyIndex, string $keyEncryptionAlgorithm, string $contentEncryptionAlgorithm): void
public function enableEncryptionSupport(JWEBuilder $jweBuilder, JWEDecrypter $jweLoader, HeaderCheckerManager $encryptionHeaderCheckerManager, JWKSet $encryptionKeyset, $encryptionKeyIndex, string $keyEncryptionAlgorithm, string $contentEncryptionAlgorithm)
{
$this->jweBuilder = $jweBuilder;
$this->jweLoader = $jweLoader;
Expand Down
8 changes: 4 additions & 4 deletions SpomkyLabsLexikJoseBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
final class SpomkyLabsLexikJoseBundle extends Bundle
{
/**
* {@inheritdoc}
* @return SpomkyLabsLexikJoseExtension
*/
public function getContainerExtension(): SpomkyLabsLexikJoseExtension
public function getContainerExtension()
{
return new SpomkyLabsLexikJoseExtension();
}

/**
* {@inheritdoc}
* @return void
*/
public function build(ContainerBuilder $container): void
public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(new EncryptionSupportCompilerPass());
Expand Down

0 comments on commit b037d7f

Please sign in to comment.