Skip to content

Refactor #473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"phpstan/phpstan-strict-rules": "^1.4",
"phpunit/phpunit": "^10.1",
"qossmic/deptrac-shim": "^1.0",
"rector/rector": "^0.17",
"rector/rector": "^0.18",
"roave/security-advisories": "dev-latest",
"symfony/browser-kit": "^6.1.3",
"symfony/finder": "^5.4|^6.0",
Expand All @@ -143,7 +143,7 @@
"symfony/serializer": "^6.1.3",
"symfony/var-dumper": "^6.1.3",
"symfony/yaml": "^6.1.3",
"symplify/easy-coding-standard": "^11.0",
"symplify/easy-coding-standard": "^12.0",
"symplify/monorepo-builder": "11.2.3.72"
},
"replace": {
Expand Down
3 changes: 1 addition & 2 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@
'import_functions' => true,
]);

$config->services()
->remove(PhpUnitTestClassRequiresCoversFixer::class);
$config->parallel();
$config->skip([PhpUnitTestClassRequiresCoversFixer::class]);
$config->paths([
__DIR__ . '/performance',
__DIR__ . '/src',
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1215,11 +1215,6 @@ parameters:
count: 1
path: src/Component/Core/Util/ECSignature.php

-
message: "#^Access to an uninitialized property Jose\\\\Component\\\\Core\\\\Util\\\\RSAKey\\:\\:\\$modulus\\.$#"
count: 1
path: src/Component/Core/Util/RSAKey.php

-
message: "#^Method Jose\\\\Component\\\\Core\\\\Util\\\\RSAKey\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand Down
13 changes: 4 additions & 9 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
use Rector\Config\RectorConfig;

use Rector\Core\ValueObject\PhpVersion;

use Rector\Doctrine\Set\DoctrineSetList;
use Rector\PHPUnit\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\Set\PHPUnitLevelSetList;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
Expand All @@ -18,19 +19,14 @@
$config->import(SetList::DEAD_CODE);
$config->import(LevelSetList::UP_TO_PHP_81);
$config->import(SymfonyLevelSetList::UP_TO_SYMFONY_54);
$config->import(SymfonySetList::SYMFONY_50_TYPES);
$config->import(SymfonySetList::SYMFONY_52_VALIDATOR_ATTRIBUTES);
$config->import(SymfonySetList::SYMFONY_CODE_QUALITY);
$config->import(SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION);
$config->import(SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES);
$config->import(DoctrineSetList::DOCTRINE_ORM_214);
$config->import(DoctrineSetList::DOCTRINE_CODE_QUALITY);
$config->import(DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES);
$config->import(PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD);
$config->import(PHPUnitLevelSetList::UP_TO_PHPUNIT_100);
$config->import(PHPUnitSetList::PHPUNIT_CODE_QUALITY);
$config->import(PHPUnitSetList::PHPUNIT_EXCEPTION);
$config->import(PHPUnitSetList::REMOVE_MOCKS);
$config->import(PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD);
$config->import(PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES);
$config->paths([
__DIR__ . '/ecs.php',
Expand All @@ -41,12 +37,11 @@
__DIR__ . '/tests',
]);
$config->skip([
PreferPHPUnitThisCallRector::class,
__DIR__ . '/src/Component/Core/JWKSet.php',
__DIR__ . '/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource.php',
__DIR__ . '/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource.php',
]);
$config->services()
->remove(PreferPHPUnitThisCallRector::class);
$config->phpVersion(PhpVersion::PHP_81);
$config->parallel();
$config->importNames();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Jose\Bundle\JoseFramework\DataCollector;

use function array_key_exists;
use Jose\Component\Core\Algorithm;
use Jose\Component\Core\AlgorithmManagerFactory;
use Jose\Component\Encryption\Algorithm\ContentEncryptionAlgorithm;
Expand All @@ -14,6 +13,7 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Throwable;
use function array_key_exists;

final class AlgorithmCollector implements Collector
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

final class AlgorithmCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
if (! $container->hasDefinition(AlgorithmManagerFactory::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

final class CheckerCollectorCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
if (! $container->hasDefinition(CheckerCollector::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

final class ClaimCheckerCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
if (! $container->hasDefinition(ClaimCheckerManagerFactory::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

final class CompressionMethodCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
if (! $container->hasDefinition(CompressionMethodManagerFactory::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

final class DataCollectorCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
if (! $container->hasDefinition(JoseCollector::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

final class EncryptionSerializerCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
if (! $container->hasDefinition(JWESerializerManagerFactory::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

final class EventDispatcherAliasCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
if (! $container->hasDefinition('event_dispatcher') || $container->hasAlias(EventDispatcherInterface::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@

final class HeaderCheckerCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
if (! $container->hasDefinition(HeaderCheckerManagerFactory::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

final class JWECollectorCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
if (! $container->hasDefinition(JWECollector::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

final class JWSCollectorCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
if (! $container->hasDefinition(JWSCollector::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

final class KeyAnalyzerCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
if (! $container->hasDefinition(KeyAnalyzerManager::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

final class KeyCollectorCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
if (! $container->hasDefinition(KeyCollector::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

final class KeySetControllerCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
if (! $container->hasDefinition(JWKSetLoader::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

final class KeysetAnalyzerCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
if (! $container->hasDefinition(KeysetAnalyzerManager::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

final class SignatureSerializerCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
if (! $container->hasDefinition(JWSSerializerManagerFactory::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace Jose\Bundle\JoseFramework\DependencyInjection;

use function count;
use Jose\Bundle\JoseFramework\DependencyInjection\Source\Source;
use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use function count;

final class JoseFrameworkExtension extends Extension implements PrependExtensionInterface
{
Expand All @@ -28,7 +28,6 @@ public function getAlias(): string
}

/**
* {@inheritdoc}
* @param array<array> $configs
*/
public function load(array $configs, ContainerBuilder $container): void
Expand All @@ -41,17 +40,13 @@ public function load(array $configs, ContainerBuilder $container): void
}
}

/**
* {@inheritdoc}
*/

public function getConfiguration(array $configs, ContainerBuilder $container): Configuration
{
return new Configuration($this->getAlias(), $this->sources);
}

/**
* {@inheritdoc}
*/

public function prepend(ContainerBuilder $container): void
{
$configs = $container->getExtensionConfig($this->getAlias());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

namespace Jose\Bundle\JoseFramework\DependencyInjection\Source\Checker;

use function array_key_exists;
use function count;
use Jose\Bundle\JoseFramework\DependencyInjection\Compiler\ClaimCheckerCompilerPass;
use Jose\Bundle\JoseFramework\DependencyInjection\Compiler\HeaderCheckerCompilerPass;
use Jose\Bundle\JoseFramework\DependencyInjection\Source\Source;
Expand All @@ -18,6 +16,8 @@
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use function array_key_exists;
use function count;

class CheckerSource implements SourceWithCompilerPasses
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

namespace Jose\Bundle\JoseFramework\DependencyInjection\Source\Encryption;

use function array_key_exists;
use function count;
use function in_array;
use Jose\Bundle\JoseFramework\DependencyInjection\Compiler\CompressionMethodCompilerPass;
use Jose\Bundle\JoseFramework\DependencyInjection\Compiler\EncryptionSerializerCompilerPass;
use Jose\Bundle\JoseFramework\DependencyInjection\Source\Source;
Expand All @@ -29,6 +26,9 @@
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use function array_key_exists;
use function count;
use function in_array;

class EncryptionSource implements SourceWithCompilerPasses
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

namespace Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement;

use function array_key_exists;
use function count;
use InvalidArgumentException;
use Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement\JWKSetSource\JWKSetSource as JWKSetSourceInterface;
use Jose\Bundle\JoseFramework\DependencyInjection\Source\Source;
Expand All @@ -14,6 +12,8 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use function array_key_exists;
use function count;

class JWKSetSource implements Source
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

namespace Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement;

use function array_key_exists;
use function count;
use InvalidArgumentException;
use Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement\JWKSource\JWKSource as JWKSourceInterface;
use Jose\Bundle\JoseFramework\DependencyInjection\Source\Source;
Expand All @@ -14,6 +12,8 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use function array_key_exists;
use function count;

class JWKSource implements Source
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

namespace Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement\JWKSource;

use function is_int;
use function is_string;
use Jose\Bundle\JoseFramework\DependencyInjection\Source\AbstractSource;
use Jose\Component\Core\JWK;
use Jose\Component\KeyManagement\JWKFactory;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use function is_int;
use function is_string;

class JWKSet extends AbstractSource implements JWKSource
{
Expand Down
Loading