Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .github/workflows/coding-style.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/fabbot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: CS

on:
pull_request:

permissions:
contents: read

jobs:
call-fabbot:
name: Fabbot
uses: symfony-tools/fabbot/.github/workflows/fabbot.yml@main
with:
package: MercureBundle
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@ parameters:
bootstrapFiles:
- vendor/bin/.phpunit/phpunit/vendor/autoload.php
ignoreErrors:
-
message: "#^Method .*::test.*\\(\\) has no return type specified\\.$#"
reportUnmatched: false
paths:
- tests/*
# Intended
- '#Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition::fixXmlConfig\(\)\.#'
16 changes: 8 additions & 8 deletions src/DependencyInjection/MercureExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ public function load(array $configs, ContainerBuilder $container): void
if (isset($hub['jwt'])) {
$tokenProvider = null;
if (isset($hub['jwt']['value'])) {
$tokenProvider = sprintf('mercure.hub.%s.jwt.provider', $name);
$tokenProvider = \sprintf('mercure.hub.%s.jwt.provider', $name);

$container->register($tokenProvider, StaticTokenProvider::class)
->addArgument($hub['jwt']['value'])
->addTag('mercure.jwt.provider')
;

// TODO: remove the following definition in 0.4
$jwtProvider = sprintf('mercure.hub.%s.jwt_provider', $name);
$jwtProvider = \sprintf('mercure.hub.%s.jwt_provider', $name);
$jwtProviderDefinition = $container->register($jwtProvider, StaticJwtProvider::class)
->addArgument($hub['jwt']['value']);

Expand All @@ -100,7 +100,7 @@ public function load(array $configs, ContainerBuilder $container): void
$tokenFactory = $hub['jwt']['factory'];
} else {
// 'secret' must be set.
$tokenFactory = sprintf('mercure.hub.%s.jwt.factory', $name);
$tokenFactory = \sprintf('mercure.hub.%s.jwt.factory', $name);
$container->register($tokenFactory, LcobucciFactory::class)
->addArgument($hub['jwt']['secret'])
->addArgument($hub['jwt']['algorithm'])
Expand All @@ -110,7 +110,7 @@ public function load(array $configs, ContainerBuilder $container): void
;
}

$tokenProvider = sprintf('mercure.hub.%s.jwt.provider', $name);
$tokenProvider = \sprintf('mercure.hub.%s.jwt.provider', $name);
$container->register($tokenProvider, FactoryTokenProvider::class)
->addArgument(new Reference($tokenFactory))
->addArgument($hub['jwt']['subscribe'] ?? [])
Expand All @@ -124,7 +124,7 @@ public function load(array $configs, ContainerBuilder $container): void
}
} else {
$jwtProvider = $hub['jwt_provider'];
$tokenProvider = sprintf('mercure.hub.%s.jwt.provider', $name);
$tokenProvider = \sprintf('mercure.hub.%s.jwt.provider', $name);

$container->register($tokenProvider, CallableTokenProvider::class)
->addArgument(new Reference($jwtProvider))
Expand All @@ -137,8 +137,8 @@ public function load(array $configs, ContainerBuilder $container): void
$container->registerAliasForArgument($tokenProvider, TokenProviderInterface::class, "{$name}TokenProvider");

$hubUrls[$name] = $hub['url'];
$hubId = sprintf('mercure.hub.%s', $name);
$publisherId = sprintf('mercure.hub.%s.publisher', $name);
$hubId = \sprintf('mercure.hub.%s', $name);
$publisherId = \sprintf('mercure.hub.%s.publisher', $name);
$hubs[$name] = new Reference($hubId);
if (!$defaultPublisher && ($config['default_hub'] ?? $name) === $name) {
$defaultHubName = $name;
Expand Down Expand Up @@ -184,7 +184,7 @@ public function load(array $configs, ContainerBuilder $container): void
$bus = $hub['bus'] ?? null;
$attributes = null === $bus ? [] : ['bus' => $hub['bus']];

$messengerHandlerId = sprintf('mercure.hub.%s.message_handler', $name);
$messengerHandlerId = \sprintf('mercure.hub.%s.message_handler', $name);
$container->register($messengerHandlerId, UpdateHandler::class)
->addArgument(new Reference($hubId))
->addTag('messenger.message_handler', $attributes);
Expand Down
2 changes: 1 addition & 1 deletion src/MercureBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function build(ContainerBuilder $container): void

$container->addCompilerPass(new StimulusHelperPass());

$container->addCompilerPass(new class() implements CompilerPassInterface {
$container->addCompilerPass(new class implements CompilerPassInterface {
public function process(ContainerBuilder $container): void
{
if (!$container->hasDefinition(Authorization::class)) {
Expand Down
4 changes: 2 additions & 2 deletions tests/DependencyInjection/MercureExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
class MercureExtensionTest extends TestCase
{
public function testExtensionMinimum(): void
public function testExtensionMinimum()
{
$config = [
'mercure' => [
Expand Down Expand Up @@ -59,7 +59,7 @@ public function testExtensionMinimum(): void
$this->assertArrayNotHasKey('Symfony\Component\Mercure\Jwt\TokenFactoryInterface $defaultTokenFactory', $container->getAliases());
}

public function testExtension(): void
public function testExtension()
{
$config = [
'mercure' => [
Expand Down
4 changes: 2 additions & 2 deletions tests/MercureBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

class MercureBundleTest extends TestCase
{
public function testBuildSetsAuthorizationCookieLifetime(): void
public function testBuildSetsAuthorizationCookieLifetime()
{
$config = [
'mercure' => [
Expand Down Expand Up @@ -61,7 +61,7 @@ public function testBuildSetsAuthorizationCookieLifetime(): void
$this->assertSame(60, $container->getDefinition(Authorization::class)->getArgument(1));
}

public function testBuildSkipsSettingAuthorizationCookieLifetimeIfNotWired(): void
public function testBuildSkipsSettingAuthorizationCookieLifetimeIfNotWired()
{
$config = ['mercure' => ['hubs' => []]];

Expand Down
Loading