Skip to content

Commit a7f6296

Browse files
committed
Merge remote-tracking branch 'origin/v1.3' into v1.3
2 parents 7b46815 + 0f97010 commit a7f6296

File tree

8 files changed

+53
-16
lines changed

8 files changed

+53
-16
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ matrix:
1818
emv: SYMFONY_DEPRECATIONS_HELPER=weak
1919
- php: 7.2
2020
emv: SYMFONY_DEPRECATIONS_HELPER=weak
21+
- php: 7.3
22+
emv: SYMFONY_DEPRECATIONS_HELPER=weak
2123
- php: nightly
2224
emv: SYMFONY_DEPRECATIONS_HELPER=weak
2325

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"autoload": {
1818
"psr-4": {
1919
"Jose\\": "src/",
20-
"Jose\\Tests\\": "test/",
20+
"Jose\\Tests\\": "tests/",
2121
"Jose\\Component\\Signature\\Algorithm\\": [
2222
"src/SignatureAlgorithm/ECDSA",
2323
"src/SignatureAlgorithm/EdDSA",
@@ -76,6 +76,7 @@
7676
"php-coveralls/php-coveralls": "^2.0",
7777
"php-http/httplug-bundle": "^1.7",
7878
"php-http/mock-client": "^1.0",
79+
"phpunit/phpunit": "^7.5",
7980
"symfony/browser-kit": "^3.4|^4.0",
8081
"symfony/finder": "^3.4|^4.0",
8182
"symfony/phpunit-bridge": "^3.4|^4.0",
@@ -116,7 +117,7 @@
116117
},
117118
"extra": {
118119
"branch-alias": {
119-
"dev-master": "1.2.x-dev"
120+
"dev-master": "1.3.x-dev"
120121
}
121122
},
122123
"conflict": {

phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
</whitelist>
4848
</filter>
4949
<listeners>
50+
<listener class="Symfony\Bridge\PhpUnit\CoverageListener" />
5051
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
5152
</listeners>
5253
</phpunit>

src/Bundle/JoseFramework/DependencyInjection/Configuration.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ public function getConfigTreeBuilder()
5151

5252
return $treeBuilder;
5353
}
54-
55-
private function getRootNode(TreeBuilder $treeBuilder, $name)
56-
{
57-
// BC layer for symfony/config 4.1 and older
58-
if (! \method_exists($treeBuilder, 'getRootNode')) {
59-
return $treeBuilder->root($name);
60-
}
6154

62-
return $treeBuilder->getRootNode();
63-
}
55+
private function getRootNode(TreeBuilder $treeBuilder, $name)
56+
{
57+
// BC layer for symfony/config 4.1 and older
58+
if (!\method_exists($treeBuilder, 'getRootNode')) {
59+
return $treeBuilder->root($name);
60+
}
61+
62+
return $treeBuilder->getRootNode();
63+
}
6464
}

src/Bundle/JoseFramework/Serializer/JWEEncoder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ public function encode($data, $format, array $context = [])
5454
return $this->serializerManager->serialize(mb_strtolower($format), $data, $this->getRecipientIndex($context));
5555
} catch (\Exception $ex) {
5656
$message = sprintf('Cannot encode JWE to %s format.', $format);
57-
57+
5858
if (\class_exists('Symfony\Component\Serializer\Exception\NotEncodableValueException')) {
5959
throw new NotEncodableValueException($message, 0, $ex);
6060
}
61-
61+
6262
throw new UnexpectedValueException($message, 0, $ex);
6363
}
6464
}
@@ -67,13 +67,13 @@ public function decode($data, $format, array $context = [])
6767
{
6868
try {
6969
return $this->serializerManager->unserialize($data);
70-
} catch (\Exception $ex) {
70+
} catch (\Exception $ex) {
7171
$message = sprintf('Cannot decode JWE from %s format.', $format);
72-
72+
7373
if (\class_exists('Symfony\Component\Serializer\Exception\NotEncodableValueException')) {
7474
throw new NotEncodableValueException($message, 0, $ex);
7575
}
76-
76+
7777
throw new UnexpectedValueException($message, 0, $ex);
7878
}
7979
}

src/Component/Core/Converter/JsonConverter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
namespace Jose\Component\Core\Converter;
1515

16+
/**
17+
* @deprecated This interface is deprecated in v1.3 and will be removed in v2.0
18+
*/
1619
interface JsonConverter
1720
{
1821
/**

src/Component/Core/Converter/StandardConverter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
namespace Jose\Component\Core\Converter;
1515

16+
/**
17+
* @deprecated This class is deprecated in v1.3 and will be removed in v2.0
18+
*/
1619
final class StandardConverter implements JsonConverter
1720
{
1821
/**
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* The MIT License (MIT)
7+
*
8+
* Copyright (c) 2014-2018 Spomky-Labs
9+
*
10+
* This software may be modified and distributed under the terms
11+
* of the MIT license. See the LICENSE file for details.
12+
*/
13+
14+
namespace Jose\Component\Core\Util;
15+
16+
final class JsonConverter
17+
{
18+
public static function encode($payload): string
19+
{
20+
return \json_encode($payload, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
21+
}
22+
23+
public static function decode(string $payload)
24+
{
25+
return \json_decode($payload, true, 512, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
26+
}
27+
}

0 commit comments

Comments
 (0)