Skip to content

Commit

Permalink
Replace mbstring functions with equivalent standard PHP string functions
Browse files Browse the repository at this point in the history
Multibyte PHP functions are replaced with equivalent standard string functions to improve program efficiency. The mbstring extension dependency from the composer.json files has also been removed as it's no longer needed. This change should have no impact on functionality as the string operations being performed do not require multi-byte safe functions.
  • Loading branch information
Spomky committed Jul 11, 2024
1 parent 51a0109 commit dd031f1
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 4 deletions.
2 changes: 0 additions & 2 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

declare(strict_types=1);

use PhpCsFixer\Fixer\Alias\MbStrFunctionsFixer;
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
use PhpCsFixer\Fixer\ClassNotation\ProtectedToPrivateFixer;
use PhpCsFixer\Fixer\Comment\HeaderCommentFixer;
Expand Down Expand Up @@ -53,7 +52,6 @@
$config->rule(ProtectedToPrivateFixer::class);
$config->rule(DeclareStrictTypesFixer::class);
$config->rule(NativeConstantInvocationFixer::class);
$config->rule(MbStrFunctionsFixer::class);
$config->rule(LinebreakAfterOpeningTagFixer::class);
$config->rule(CombineConsecutiveIssetsFixer::class);
$config->rule(CombineConsecutiveUnsetsFixer::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

use const PHP_EOL;

final readonly class
CertificateToolbox
final readonly class CertificateToolbox
{
private const string PEM_HEADER = '-----BEGIN ';

Expand Down
1 change: 1 addition & 0 deletions src/webauthn/src/CeremonyStep/CheckCredentialId.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Webauthn\PublicKeyCredentialCreationOptions;
use Webauthn\PublicKeyCredentialRequestOptions;
use Webauthn\PublicKeyCredentialSource;
use function strlen;

class CheckCredentialId implements CeremonyStep
{
Expand Down
1 change: 1 addition & 0 deletions src/webauthn/src/CeremonyStep/CheckOrigin.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use function in_array;
use function is_array;
use function is_string;
use function strlen;

final readonly class CheckOrigin implements CeremonyStep
{
Expand Down
1 change: 1 addition & 0 deletions src/webauthn/src/PublicKeyCredentialUserEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Webauthn;

use Webauthn\Exception\InvalidDataException;
use function strlen;

class PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity
{
Expand Down
1 change: 1 addition & 0 deletions src/webauthn/src/StringStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use function fread;
use function fwrite;
use function rewind;
use function strlen;

final class StringStream implements Stream
{
Expand Down
1 change: 1 addition & 0 deletions src/webauthn/src/U2FPublicKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use CBOR\UnsignedIntegerObject;
use Cose\Algorithms;
use Cose\Key\Ec2Key;
use function strlen;

/**
* @internal
Expand Down
1 change: 1 addition & 0 deletions src/webauthn/src/Util/CoseSignatureFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Cose\Algorithm\Signature\ECDSA\ES384;
use Cose\Algorithm\Signature\ECDSA\ES512;
use Cose\Algorithm\Signature\Signature;
use function strlen;

/**
* This class fixes the signature of the ECDSA based algorithms.
Expand Down
1 change: 1 addition & 0 deletions tests/symfony/functional/Attestation/AttestationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Webauthn\Tests\MockedRequestTrait;
use Webauthn\TrustPath\CertificateTrustPath;
use Webauthn\TrustPath\EmptyTrustPath;
use function strlen;

/**
* @internal
Expand Down

0 comments on commit dd031f1

Please sign in to comment.