Skip to content

Commit

Permalink
Add missing "sprintf" function imports across multiple files
Browse files Browse the repository at this point in the history
This commit ensures consistency by adding the missing import for the "sprintf" function across various files. This addresses potential issues with undefined function calls and aligns the code with the project's coding standards. Additionally, test assertions were updated to use "assertCount" for improved clarity.
  • Loading branch information
Spomky committed Dec 12, 2024
1 parent 1e377d8 commit 8ac1b26
Show file tree
Hide file tree
Showing 76 changed files with 78 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use function sprintf;

final readonly class AlgorithmCompilerPass implements CompilerPassInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use function sprintf;

final readonly class ClaimCheckerCompilerPass implements CompilerPassInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use function sprintf;

final readonly class HeaderCheckerCompilerPass implements CompilerPassInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Override;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use function sprintf;

final readonly class KeySetControllerCompilerPass implements CompilerPassInterface
{
Expand Down
1 change: 1 addition & 0 deletions src/Bundle/DependencyInjection/Source/AbstractSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use function sprintf;

abstract readonly class AbstractSource
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use function sprintf;

final readonly class ClaimChecker implements Source
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use function sprintf;

final readonly class HeaderChecker implements Source
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use function sprintf;

final readonly class JWEBuilder extends AbstractEncryptionSource
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use function sprintf;

final readonly class JWEDecrypter extends AbstractEncryptionSource
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use function sprintf;

final readonly class JWELoader implements Source
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use function sprintf;

final readonly class JWESerializer implements Source
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use function array_key_exists;
use function count;
use function sprintf;

final class JWKSetSource implements Source
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use function array_key_exists;
use function count;
use function sprintf;

final class JWKSource implements Source
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use function sprintf;

final readonly class JWKUriSource implements Source
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use function sprintf;

final readonly class NestedTokenBuilder implements Source
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use function sprintf;

final readonly class NestedTokenLoader implements Source
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use function sprintf;

final readonly class JWSBuilder extends AbstractSignatureSource
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use function sprintf;

final readonly class JWSLoader implements Source
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use function sprintf;

final readonly class JWSSerializer implements Source
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use function sprintf;

final readonly class JWSVerifier extends AbstractSignatureSource
{
Expand Down
1 change: 1 addition & 0 deletions src/Bundle/EnvVarProcessor/KeyEnvVarProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Override;
use RuntimeException;
use Symfony\Component\DependencyInjection\EnvVarProcessorInterface;
use function sprintf;

final readonly class KeyEnvVarProcessor implements EnvVarProcessorInterface
{
Expand Down
1 change: 1 addition & 0 deletions src/Bundle/Routing/JWKSetLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
use function assert;
use function sprintf;

final class JWKSetLoader implements LoaderInterface
{
Expand Down
1 change: 1 addition & 0 deletions src/Bundle/Serializer/JWEEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Throwable;
use function in_array;
use function is_int;
use function sprintf;

final readonly class JWEEncoder implements EncoderInterface, DecoderInterface, NormalizationAwareInterface
{
Expand Down
1 change: 1 addition & 0 deletions src/Bundle/Serializer/JWSEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Symfony\Component\Serializer\Exception\NotEncodableValueException;
use function in_array;
use function is_int;
use function sprintf;

final readonly class JWSEncoder implements EncoderInterface, DecoderInterface, NormalizationAwareInterface
{
Expand Down
1 change: 1 addition & 0 deletions src/Bundle/Services/ClaimCheckerManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use InvalidArgumentException;
use Jose\Component\Checker\ClaimChecker;
use Psr\EventDispatcher\EventDispatcherInterface;
use function sprintf;

final class ClaimCheckerManagerFactory
{
Expand Down
1 change: 1 addition & 0 deletions src/Bundle/Services/HeaderCheckerManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Jose\Component\Checker\HeaderChecker;
use Jose\Component\Checker\TokenTypeSupport;
use Psr\EventDispatcher\EventDispatcherInterface;
use function sprintf;

final class HeaderCheckerManagerFactory
{
Expand Down
1 change: 1 addition & 0 deletions src/Library/Checker/CallableChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Override;
use function call_user_func;
use function is_callable;
use function sprintf;

/**
* This class is responsible for checking claims and headers using a callable function.
Expand Down
1 change: 1 addition & 0 deletions src/Library/Checker/ClaimCheckerManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use function array_key_exists;
use function count;
use function sprintf;

/**
* This class manages claim checkers and performs claim checks.
Expand Down
1 change: 1 addition & 0 deletions src/Library/Checker/ClaimCheckerManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Jose\Component\Checker;

use InvalidArgumentException;
use function sprintf;

/**
* This class is responsible for creating and managing claim checkers.
Expand Down
2 changes: 0 additions & 2 deletions src/Library/Checker/HeaderChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
namespace Jose\Component\Checker;

/**
* Interface HeaderChecker
*
* This interface defines the contract for a header checker.
*/
interface HeaderChecker
Expand Down
3 changes: 1 addition & 2 deletions src/Library/Checker/HeaderCheckerManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use function array_key_exists;
use function count;
use function is_array;
use function sprintf;

/**
* This class is a factory to create Header Checker Managers.
Expand All @@ -29,8 +30,6 @@ class HeaderCheckerManager
private array $tokenTypes = [];

/**
* HeaderCheckerManager constructor.
*
* @param HeaderChecker[] $checkers
* @param TokenTypeSupport[] $tokenTypes
*/
Expand Down
1 change: 1 addition & 0 deletions src/Library/Checker/HeaderCheckerManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Jose\Component\Checker;

use InvalidArgumentException;
use function sprintf;

/**
* This class is a factory to create Header Checker Managers. It allows to add header parameter checkers and token type
Expand Down
1 change: 1 addition & 0 deletions src/Library/Checker/IsEqualChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Jose\Component\Checker;

use Override;
use function sprintf;

/**
* This class implements a claim and header checker that checks if the value is equal to the expected value.
Expand Down
2 changes: 0 additions & 2 deletions src/Library/Checker/MissingMandatoryClaimException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
class MissingMandatoryClaimException extends Exception implements ClaimExceptionInterface
{
/**
* MissingMandatoryClaimException constructor.
*
* @param string[] $claims
*/
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
class MissingMandatoryHeaderParameterException extends Exception
{
/**
* MissingMandatoryHeaderParameterException constructor.
*
* @param string[] $parameters
*/
public function __construct(
Expand Down
1 change: 1 addition & 0 deletions src/Library/Console/KeysetAnalyzerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Symfony\Component\Console\Output\OutputInterface;
use function is_array;
use function is_string;
use function sprintf;

#[AsCommand(name: 'keyset:analyze', description: 'JWKSet quality analyzer.',)]
final class KeysetAnalyzerCommand extends Command
Expand Down
1 change: 1 addition & 0 deletions src/Library/Core/AlgorithmManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use InvalidArgumentException;
use function array_key_exists;
use function sprintf;

final class AlgorithmManager
{
Expand Down
1 change: 1 addition & 0 deletions src/Library/Core/AlgorithmManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use InvalidArgumentException;
use function is_string;
use function sprintf;

/**
* @see \Jose\Tests\Component\Core\AlgorithmManagerFactoryTest
Expand Down
1 change: 1 addition & 0 deletions src/Library/Core/JWK.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use function array_key_exists;
use function in_array;
use function is_array;
use function sprintf;
use const JSON_THROW_ON_ERROR;
use const JSON_UNESCAPED_SLASHES;
use const JSON_UNESCAPED_UNICODE;
Expand Down
1 change: 1 addition & 0 deletions src/Library/Core/JWKSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use function count;
use function in_array;
use function is_array;
use function sprintf;
use const COUNT_NORMAL;
use const JSON_THROW_ON_ERROR;

Expand Down
1 change: 1 addition & 0 deletions src/Library/Core/Util/ECKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use function extension_loaded;
use function is_array;
use function is_string;
use function sprintf;
use const OPENSSL_KEYTYPE_EC;
use const STR_PAD_LEFT;

Expand Down
1 change: 1 addition & 0 deletions src/Library/Core/Util/KeyChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use function in_array;
use function is_array;
use function is_string;
use function sprintf;

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use function extension_loaded;
use function in_array;
use function is_string;
use function sprintf;
use const OPENSSL_RAW_DATA;

abstract readonly class AESGCMKW implements KeyWrapping
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use function in_array;
use function is_array;
use function is_string;
use function sprintf;
use function strlen;

abstract readonly class AbstractECDH implements KeyAgreement
Expand Down
1 change: 1 addition & 0 deletions src/Library/Encryption/JWE.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Override;
use function array_key_exists;
use function count;
use function sprintf;

class JWE implements JWT
{
Expand Down
1 change: 1 addition & 0 deletions src/Library/Encryption/JWEBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use function array_key_exists;
use function count;
use function is_string;
use function sprintf;

class JWEBuilder
{
Expand Down
1 change: 1 addition & 0 deletions src/Library/Encryption/JWEDecrypter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Jose\Component\Encryption\Algorithm\KeyEncryptionAlgorithm;
use Throwable;
use function is_string;
use function sprintf;
use function strlen;

class JWEDecrypter
Expand Down
1 change: 1 addition & 0 deletions src/Library/Encryption/Recipient.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use InvalidArgumentException;
use function array_key_exists;
use function sprintf;

/**
* @internal
Expand Down
Loading

0 comments on commit 8ac1b26

Please sign in to comment.