Skip to content

Commit ce2b82e

Browse files
authored
Fix SF6.0 compatibility (#35)
1 parent 2ef24c1 commit ce2b82e

File tree

6 files changed

+19
-18
lines changed

6 files changed

+19
-18
lines changed

composer.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@
1717
"ext-openssl": "*",
1818
"guzzlehttp/guzzle": "~6.0|~7.0",
1919
"minishlink/web-push": "~4.0|~5.0|~6.0",
20-
"symfony/http-kernel": "~3.0|~4.0|~5.0"
20+
"symfony/http-kernel": "~3.0|~4.0|~5.0|~6.0"
2121
},
2222
"require-dev": {
2323
"bentools/doctrine-static": "1.0.x-dev",
2424
"doctrine/dbal": "~2.5 <=2.9",
25-
"nyholm/symfony-bundle-test": "~1.4",
26-
"phpunit/phpunit": "~5.0|~6.0|~7.0",
27-
"symfony/config": "~4.0",
28-
"symfony/dependency-injection": "~3.0|~4.0|~5.0",
29-
"symfony/framework-bundle": "~3.0|~4.0|~5.0",
30-
"symfony/http-foundation": "~3.0|~4.0|~5.0",
31-
"symfony/routing": "~3.0|~4.0|~5.0",
32-
"symfony/security": "~3.0|~4.0|~5.0",
33-
"symfony/var-dumper": "~3.0|~4.0|~5.0",
34-
"symfony/yaml": "~3.0|~4.0|~5.0",
25+
"nyholm/symfony-bundle-test": "~1.8",
26+
"phpunit/phpunit": "~5.0|~6.0|~7.0|~8.0|~9.0",
27+
"symfony/config": "~4.0|~5.0|~6.0",
28+
"symfony/dependency-injection": "~3.0|~4.0|~5.0|~6.0",
29+
"symfony/framework-bundle": "~3.0|~4.0|~5.0|~6.0",
30+
"symfony/http-foundation": "~3.0|~4.0|~5.0|~6.0",
31+
"symfony/routing": "~3.0|~4.0|~5.0|~6.0",
32+
"symfony/security": "~3.0|~4.0|~5.0|~6.0",
33+
"symfony/var-dumper": "~3.0|~4.0|~5.0|~6.0",
34+
"symfony/yaml": "~3.0|~4.0|~5.0|~6.0",
3535
"twig/twig": "~1.0|~2.0"
3636
},
3737
"autoload": {

phpunit.xml.dist

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
backupGlobals="false"
77
colors="true"
88
bootstrap="vendor/autoload.php"
9+
cacheResult ="false"
910
>
1011
<php>
1112
<ini name="error_reporting" value="-1" />

src/Sender/RequestBuilder.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use BenTools\WebPushBundle\Model\Message\PushMessage;
77
use BenTools\WebPushBundle\Model\Subscription\UserSubscriptionInterface;
88
use GuzzleHttp\Psr7\Request;
9-
use function GuzzleHttp\Psr7\stream_for;
9+
use GuzzleHttp\Psr7\Utils as GuzzleUtils;
1010
use GuzzleHttp\Psr7\Uri;
1111
use Minishlink\WebPush\Encryption;
1212
use Minishlink\WebPush\Utils;
@@ -56,7 +56,7 @@ public function createRequest(
5656
$content = $encryptionContentCodingHeader.$encrypted['cipherText'];
5757

5858
return $request
59-
->withBody(stream_for($content))
59+
->withBody(GuzzleUtils::streamFor($content))
6060
->withHeader('Content-Length', Utils::safeStrlen($content));
6161
}
6262

src/WebPushBundle.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
use BenTools\WebPushBundle\DependencyInjection\WebPushCompilerPass;
66
use BenTools\WebPushBundle\DependencyInjection\WebPushExtension;
77
use Symfony\Component\DependencyInjection\ContainerBuilder;
8+
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
89
use Symfony\Component\HttpKernel\Bundle\Bundle;
910

1011
class WebPushBundle extends Bundle
1112
{
1213
/**
1314
* {@inheritdoc}
1415
*/
15-
public function getContainerExtension()
16+
public function getContainerExtension(): ?ExtensionInterface
1617
{
1718
return new WebPushExtension();
1819
}

tests/BundleTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
final class BundleTest extends KernelTestCase
1111
{
12-
protected function setUp()
12+
protected function setUp(): void
1313
{
1414
static::bootKernel();
1515
}
@@ -38,10 +38,10 @@ public function manager_is_found()
3838

3939
/**
4040
* @test
41-
* @expectedException \InvalidArgumentException
4241
*/
4342
public function unknown_manager_raises_exception()
4443
{
44+
$this->expectException(\InvalidArgumentException::class);
4545
self::$kernel->getContainer()->get(UserSubscriptionManagerRegistry::class)->getManager(Foo::class);
4646
}
4747
}

tests/RegistrationTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
final class RegistrationTest extends KernelTestCase
1313
{
14-
protected function setUp()
14+
protected function setUp(): void
1515
{
1616
static::bootKernel();
1717
}
@@ -30,7 +30,6 @@ public function registration_works()
3030
$em->flush();
3131
$this->assertNotNull($em->find(TestUser::class, 'bob'));
3232

33-
3433
$register = self::$kernel->getContainer()->get(RegisterSubscriptionAction::class);
3534

3635
$rawSubscriptionData = [

0 commit comments

Comments
 (0)