Skip to content

Commit 3db0ca8

Browse files
authored
To Rector 1.0 (#516)
1 parent cd826e7 commit 3db0ca8

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"phpstan/phpstan-strict-rules": "^1.4",
8787
"phpunit/phpunit": "^10.1",
8888
"qossmic/deptrac-shim": "^1.0",
89-
"rector/rector": "^0.19",
89+
"rector/rector": "^1.0",
9090
"roave/security-advisories": "dev-latest",
9191
"symfony/browser-kit": "^6.1|^7.0",
9292
"symfony/finder": "^6.1|^7.0",

src/Library/KeyManagement/KeyConverter/KeyConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static function loadKeyFromX509Resource(OpenSSLCertificate $res): array
8686
$values = self::loadKeyFromPEM($details['key']);
8787
openssl_x509_export($res, $out);
8888
$x5c = preg_replace('#-.*-#', '', (string) $out);
89-
$x5c = preg_replace('~\R~', '', $x5c);
89+
$x5c = preg_replace('~\R~', '', (string) $x5c);
9090
if (! is_string($x5c)) {
9191
throw new InvalidArgumentException('Unable to load the certificate');
9292
}

tests/Component/Signature/JWSFlattenedTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ public function loadFlattenedJWS(): void
2828
'iss' => 'joe',
2929
'exp' => 1_300_819_380,
3030
'http://example.com/is_root' => true,
31-
], json_decode($loaded->getPayload(), true, 512, JSON_THROW_ON_ERROR));
31+
], json_decode((string) $loaded->getPayload(), true, 512, JSON_THROW_ON_ERROR));
3232
}
3333
}

tests/Component/Signature/RFC7520/NestingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ public function signatureVerification(): void
5353

5454
static::assertTrue($jwsVerifier->verifyWithKey($loaded_compact_json, $signature_key, 0));
5555
static::assertSame($signature_header, $loaded_compact_json->getSignature(0)->getProtectedHeader());
56-
static::assertSame($payload, json_decode($loaded_compact_json->getPayload(), true, 512, JSON_THROW_ON_ERROR));
56+
static::assertSame($payload, json_decode((string) $loaded_compact_json->getPayload(), true, 512, JSON_THROW_ON_ERROR));
5757
}
5858
}

tests/Component/Signature/SignerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ public function signAndLoadJWKSet(): void
971971
static::assertSame(2, $loaded->countSignatures());
972972
static::assertEqualsCanonicalizing(
973973
$this->getKeyset(),
974-
JWKSet::createFromKeyData(json_decode($loaded->getPayload(), true, 512, JSON_THROW_ON_ERROR))
974+
JWKSet::createFromKeyData(json_decode((string) $loaded->getPayload(), true, 512, JSON_THROW_ON_ERROR))
975975
);
976976
static::assertTrue($jwsVerifier->verifyWithKeySet($loaded, $this->getSymmetricKeySet(), 0));
977977
static::assertTrue($jwsVerifier->verifyWithKeySet($loaded, $this->getPublicKeySet(), 1));
@@ -1009,7 +1009,7 @@ public function keySetIsEmpty(): void
10091009
static::assertSame(2, $loaded->countSignatures());
10101010
static::assertEqualsCanonicalizing(
10111011
$this->getKeyset(),
1012-
JWKSet::createFromKeyData(json_decode($loaded->getPayload(), true, 512, JSON_THROW_ON_ERROR))
1012+
JWKSet::createFromKeyData(json_decode((string) $loaded->getPayload(), true, 512, JSON_THROW_ON_ERROR))
10131013
);
10141014
static::assertTrue($jwsVerifier->verifyWithKeySet($loaded, new JWKSet([]), 0));
10151015
static::assertTrue($jwsVerifier->verifyWithKey($loaded, new JWK([

tests/SignatureAlgorithm/RSA/RSASignatureTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public function loadJWSJSONSerialization(): void
345345
'{"payload":"eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ","signatures":[{"protected":"eyJhbGciOiJSUzI1NiJ9","header":{"kid":"2010-12-29"},"signature":"cC4hiUPoj9Eetdgtv3hF80EGrhuB__dzERat0XF9g2VtQgr9PJbu3XOiZj5RZmh7AAuHIm4Bh-0Qc_lF5YKt_O8W2Fp5jujGbds9uJdbF9CUAr7t1dnZcAcQjbKBYNX4BAynRFdiuB--f_nZLgrnbyTyWzO75vRK5h6xBArLIARNPvkSjtQBMHlb1L07Qe7K0GarZRmB_eSN9383LcOLn6_dO--xi12jzDwusC-eOkHWEsqtFZESc6BfI7noOPqvhJ1phCnvWh6IeYI2w9QOYEUipUTI8np6LbgGY9Fs98rqVt5AXLIhWkWywlVmtVrBp0igcN_IoypGlUPQGe77Rw"},{"protected":"eyJhbGciOiJFUzI1NiJ9","header":{"kid":"e9bc097a-ce51-4036-9562-d2ade882db0d"},"signature":"DtEhU3ljbEg8L38VWAfUAqOyKAM6-Xx-F4GawxaepmXFCgfTjDxw5djxLa8ISlSApmWQxfKTUJqPP3-Kg6NU1Q"}]}'
346346
);
347347

348-
$claims = json_decode($result->getPayload(), true, 512, JSON_THROW_ON_ERROR);
348+
$claims = json_decode((string) $result->getPayload(), true, 512, JSON_THROW_ON_ERROR);
349349
static::assertSame([
350350
'iss' => 'joe',
351351
'exp' => 1_300_819_380,
@@ -440,7 +440,7 @@ public function loadIETFExample1(): void
440440
'iss' => 'joe',
441441
'exp' => 1_300_819_380,
442442
'http://example.com/is_root' => true,
443-
], json_decode($result->getPayload(), true, 512, JSON_THROW_ON_ERROR));
443+
], json_decode((string) $result->getPayload(), true, 512, JSON_THROW_ON_ERROR));
444444
static::assertSame(1, $result->countSignatures());
445445
static::assertSame('HS256', $result->getSignature(0)->getProtectedHeaderParameter('alg'));
446446
}
@@ -460,7 +460,7 @@ public function loadIETFExample2(): void
460460
'iss' => 'joe',
461461
'exp' => 1_300_819_380,
462462
'http://example.com/is_root' => true,
463-
], json_decode($result->getPayload(), true, 512, JSON_THROW_ON_ERROR));
463+
], json_decode((string) $result->getPayload(), true, 512, JSON_THROW_ON_ERROR));
464464
static::assertSame(1, $result->countSignatures());
465465
static::assertSame('RS256', $result->getSignature(0)->getProtectedHeaderParameter('alg'));
466466
}
@@ -480,7 +480,7 @@ public function loadIETFExample3(): void
480480
'iss' => 'joe',
481481
'exp' => 1_300_819_380,
482482
'http://example.com/is_root' => true,
483-
], json_decode($result->getPayload(), true, 512, JSON_THROW_ON_ERROR));
483+
], json_decode((string) $result->getPayload(), true, 512, JSON_THROW_ON_ERROR));
484484
static::assertSame(1, $result->countSignatures());
485485
static::assertSame('ES256', $result->getSignature(0)->getProtectedHeaderParameter('alg'));
486486
}

0 commit comments

Comments
 (0)