Skip to content

Commit

Permalink
Fix SF6.0 compatibility (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
zogs committed Mar 13, 2022
1 parent 2ef24c1 commit ce2b82e
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@
"ext-openssl": "*",
"guzzlehttp/guzzle": "~6.0|~7.0",
"minishlink/web-push": "~4.0|~5.0|~6.0",
"symfony/http-kernel": "~3.0|~4.0|~5.0"
"symfony/http-kernel": "~3.0|~4.0|~5.0|~6.0"
},
"require-dev": {
"bentools/doctrine-static": "1.0.x-dev",
"doctrine/dbal": "~2.5 <=2.9",
"nyholm/symfony-bundle-test": "~1.4",
"phpunit/phpunit": "~5.0|~6.0|~7.0",
"symfony/config": "~4.0",
"symfony/dependency-injection": "~3.0|~4.0|~5.0",
"symfony/framework-bundle": "~3.0|~4.0|~5.0",
"symfony/http-foundation": "~3.0|~4.0|~5.0",
"symfony/routing": "~3.0|~4.0|~5.0",
"symfony/security": "~3.0|~4.0|~5.0",
"symfony/var-dumper": "~3.0|~4.0|~5.0",
"symfony/yaml": "~3.0|~4.0|~5.0",
"nyholm/symfony-bundle-test": "~1.8",
"phpunit/phpunit": "~5.0|~6.0|~7.0|~8.0|~9.0",
"symfony/config": "~4.0|~5.0|~6.0",
"symfony/dependency-injection": "~3.0|~4.0|~5.0|~6.0",
"symfony/framework-bundle": "~3.0|~4.0|~5.0|~6.0",
"symfony/http-foundation": "~3.0|~4.0|~5.0|~6.0",
"symfony/routing": "~3.0|~4.0|~5.0|~6.0",
"symfony/security": "~3.0|~4.0|~5.0|~6.0",
"symfony/var-dumper": "~3.0|~4.0|~5.0|~6.0",
"symfony/yaml": "~3.0|~4.0|~5.0|~6.0",
"twig/twig": "~1.0|~2.0"
},
"autoload": {
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
cacheResult ="false"
>
<php>
<ini name="error_reporting" value="-1" />
Expand Down
4 changes: 2 additions & 2 deletions src/Sender/RequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use BenTools\WebPushBundle\Model\Message\PushMessage;
use BenTools\WebPushBundle\Model\Subscription\UserSubscriptionInterface;
use GuzzleHttp\Psr7\Request;
use function GuzzleHttp\Psr7\stream_for;
use GuzzleHttp\Psr7\Utils as GuzzleUtils;
use GuzzleHttp\Psr7\Uri;
use Minishlink\WebPush\Encryption;
use Minishlink\WebPush\Utils;
Expand Down Expand Up @@ -56,7 +56,7 @@ public function createRequest(
$content = $encryptionContentCodingHeader.$encrypted['cipherText'];

return $request
->withBody(stream_for($content))
->withBody(GuzzleUtils::streamFor($content))
->withHeader('Content-Length', Utils::safeStrlen($content));
}

Expand Down
3 changes: 2 additions & 1 deletion src/WebPushBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
use BenTools\WebPushBundle\DependencyInjection\WebPushCompilerPass;
use BenTools\WebPushBundle\DependencyInjection\WebPushExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;

class WebPushBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function getContainerExtension()
public function getContainerExtension(): ?ExtensionInterface
{
return new WebPushExtension();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/BundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

final class BundleTest extends KernelTestCase
{
protected function setUp()
protected function setUp(): void
{
static::bootKernel();
}
Expand Down Expand Up @@ -38,10 +38,10 @@ public function manager_is_found()

/**
* @test
* @expectedException \InvalidArgumentException
*/
public function unknown_manager_raises_exception()
{
$this->expectException(\InvalidArgumentException::class);
self::$kernel->getContainer()->get(UserSubscriptionManagerRegistry::class)->getManager(Foo::class);
}
}
3 changes: 1 addition & 2 deletions tests/RegistrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

final class RegistrationTest extends KernelTestCase
{
protected function setUp()
protected function setUp(): void
{
static::bootKernel();
}
Expand All @@ -30,7 +30,6 @@ public function registration_works()
$em->flush();
$this->assertNotNull($em->find(TestUser::class, 'bob'));


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

$rawSubscriptionData = [
Expand Down

0 comments on commit ce2b82e

Please sign in to comment.