Skip to content

Commit

Permalink
Upgrade data providers to be
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk committed Feb 20, 2023
1 parent 948cb03 commit 24e1b63
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions tests/RFC6978VectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ public function theVectorsFromRFC6978CanBeVerified(
}

/** @return mixed[] */
public function dataRFC6979(): iterable
public static function dataRFC6979(): iterable
{
yield from $this->sha256Data();
yield from $this->sha384Data();
yield from $this->sha512Data();
yield from self::sha256Data();
yield from self::sha384Data();
yield from self::sha512Data();
}

/** @return mixed[] */
public function sha256Data(): iterable
public static function sha256Data(): iterable
{
$signer = new Sha256();
$key = InMemory::plainText(
Expand Down Expand Up @@ -86,7 +86,7 @@ public function sha256Data(): iterable
}

/** @return mixed[] */
public function sha384Data(): iterable
public static function sha384Data(): iterable
{
$signer = new Sha384();
$key = InMemory::plainText(
Expand Down Expand Up @@ -115,7 +115,7 @@ public function sha384Data(): iterable
}

/** @return mixed[] */
public function sha512Data(): iterable
public static function sha512Data(): iterable
{
$signer = new Sha512();
$key = InMemory::plainText(
Expand Down
2 changes: 1 addition & 1 deletion tests/Signer/Ecdsa/EcdsaTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function signShouldRaiseAnExceptionWhenKeyLengthIsNotTheExpectedOne(
}

/** @return iterable<string, array{string, int}> */
abstract protected function incompatibleKeys(): iterable;
abstract public static function incompatibleKeys(): iterable;

/** @test */
public function signShouldRaiseAnExceptionWhenKeyTypeIsNotEC(): void
Expand Down
4 changes: 2 additions & 2 deletions tests/Signer/Ecdsa/MultibyteStringConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function fromAsn1ShouldReturnTheConcatenatedPoints(string $r, string $s,
}

/** @return string[][] */
public function pointsConversionData(): iterable
public static function pointsConversionData(): iterable
{
return [
[
Expand Down Expand Up @@ -125,7 +125,7 @@ public function fromAsn1ShouldRaiseExceptionOnInvalidMessage(string $message, st
}

/** @return string[][] */
public function invalidAsn1Structures(): iterable
public static function invalidAsn1Structures(): iterable
{
return [
'Not a sequence' => ['', 'Should start with a sequence'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Signer/Ecdsa/Sha256Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function signingKey(): Key
}

/** {@inheritdoc} */
protected function incompatibleKeys(): iterable
public static function incompatibleKeys(): iterable
{
yield '384 bits' => ['private_ec384', 384];
yield '521 bits' => ['private_ec512', 521];
Expand Down
2 changes: 1 addition & 1 deletion tests/Signer/Ecdsa/Sha384Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function signingKey(): Key
}

/** {@inheritdoc} */
protected function incompatibleKeys(): iterable
public static function incompatibleKeys(): iterable
{
yield '256 bits' => ['private', 256];
yield '521 bits' => ['private_ec512', 521];
Expand Down
2 changes: 1 addition & 1 deletion tests/Signer/Ecdsa/Sha512Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function signingKey(): Key
}

/** {@inheritdoc} */
protected function incompatibleKeys(): iterable
public static function incompatibleKeys(): iterable
{
yield '256 bits' => ['private', 256];
yield '384 bits' => ['private_ec384', 384];
Expand Down
2 changes: 1 addition & 1 deletion tests/SodiumBase64PolyfillTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function base642binFallback(int $variant): void
}

/** @return int[][] */
public function provideVariants(): array
public static function provideVariants(): array
{
return [
[SODIUM_BASE64_VARIANT_ORIGINAL],
Expand Down
4 changes: 2 additions & 2 deletions tests/TimeFractionPrecisionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function timeFractionsPrecisionsAreRespected(string $timeFraction): void
}

/** @return iterable<string[]> */
public function datesWithPotentialRoundingIssues(): iterable
public static function datesWithPotentialRoundingIssues(): iterable
{
yield ['1613938511.017448'];
yield ['1613938511.023691'];
Expand Down Expand Up @@ -86,7 +86,7 @@ public function typeConversionDoesNotCauseParsingErrors(float|int|string $issued
}

/** @return iterable<array{0: float|int|string, 1: string}> */
public function timeFractionConversions(): iterable
public static function timeFractionConversions(): iterable
{
yield [1616481863.528781890869140625, '1616481863.528782'];
yield [1616497608.0510409, '1616497608.051041'];
Expand Down
2 changes: 1 addition & 1 deletion tests/Validation/Constraint/HasClaimWithValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function registeredClaimsCannotBeValidatedUsingThisConstraint(string $cla
}

/** @return iterable<non-empty-string, array{non-empty-string}> */
public function registeredClaims(): iterable
public static function registeredClaims(): iterable
{
foreach (Token\RegisteredClaims::ALL as $claim) {
yield $claim => [$claim];
Expand Down

0 comments on commit 24e1b63

Please sign in to comment.