Skip to content

Commit 32325bd

Browse files
committed
Tweak CS-Fixer settings
1 parent 266cde6 commit 32325bd

File tree

61 files changed

+417
-448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+417
-448
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/tests export-ignore
44
/.gitattributes export-ignore
55
/.gitignore export-ignore
6-
/.php_cs export-ignore
6+
/.php-cs-fixer.php export-ignore
77
/CHANGELOG.md export-ignore
88
/gulpfile.js export-ignore
99
/package.json export-ignore

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
composer.lock
33
.phpunit.result.cache
44
/phpunit.xml
5-
.php_cs.cache
6-
/.php_cs
5+
.php-cs-fixer.cache
76
/.phpstan.neon
87
/node_modules/
98
/package-lock.json

.php-cs-fixer.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
<?php declare(strict_types=1);
22

3-
return PhpCsFixer\Config::create()
3+
return (new PhpCsFixer\Config())
44
->setRules([
55
'@Symfony' => true,
66
'@Symfony:risky' => true,
7-
'@PHPUnit75Migration:risky' => true,
7+
'@PHP74Migration' => true,
8+
'@PHP74Migration:risky' => true,
9+
'@PHPUnit84Migration:risky' => true,
810
'array_syntax' => ['syntax' => 'short'],
911
'blank_line_after_opening_tag' => false,
10-
'declare_strict_types' => true,
1112
'fopen_flags' => false,
12-
'ordered_imports' => true,
13-
'protected_to_private' => true,
14-
'void_return' => true,
13+
'linebreak_after_opening_tag' => false,
14+
'no_superfluous_phpdoc_tags' => ['remove_inheritdoc' => true],
15+
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
1516
])
1617
->setRiskyAllowed(true)
1718
->setFinder(
18-
PhpCsFixer\Finder::create()
19+
(new PhpCsFixer\Finder())
1920
->in(__DIR__.'/src')
2021
->in(__DIR__.'/tests')
2122
)

src/Client/ClientConnection.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ public function getConnection(): ConnectionInterface
2828

2929
/**
3030
* @param int|string $offset
31-
*
32-
* @return bool
3331
*/
3432
public function offsetExists($offset): bool
3533
{
@@ -64,7 +62,7 @@ public function offsetGet($offset)
6462
$trace[0]['file'],
6563
$trace[0]['line']
6664
),
67-
E_USER_NOTICE
65+
\E_USER_NOTICE
6866
);
6967
}
7068
}

src/Client/ClientManipulator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function findByRoles(Topic $topic, array $roles): array
6666
if (\in_array($role, $roles)) {
6767
$result[] = new ClientConnection($client, $connection);
6868

69-
continue 1;
69+
continue 2;
7070
}
7171
}
7272
}

src/DependencyInjection/CompilerPass/DataCollectorCompilerPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(bool $internal = false)
2626
public function process(ContainerBuilder $container): void
2727
{
2828
if (!$this->internal) {
29-
trigger_deprecation('gos/web-socket-bundle', '3.1', 'The "%s" class is deprecated and will be removed in 4.0, use the symfony/messenger component instead.', DataCollectorCompilerPass::class);
29+
trigger_deprecation('gos/web-socket-bundle', '3.1', 'The "%s" class is deprecated and will be removed in 4.0, use the symfony/messenger component instead.', self::class);
3030
}
3131

3232
if (!$container->getParameter('kernel.debug') || !$container->hasDefinition('debug.stopwatch')) {

src/DependencyInjection/CompilerPass/PusherCompilerPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(bool $internal = false)
2828
public function process(ContainerBuilder $container): void
2929
{
3030
if (!$this->internal) {
31-
trigger_deprecation('gos/web-socket-bundle', '3.1', 'The "%s" class is deprecated and will be removed in 4.0, use the symfony/messenger component instead.', PusherCompilerPass::class);
31+
trigger_deprecation('gos/web-socket-bundle', '3.1', 'The "%s" class is deprecated and will be removed in 4.0, use the symfony/messenger component instead.', self::class);
3232
}
3333

3434
if ($container->hasDefinition('gos_web_socket.registry.pusher')) {

src/DependencyInjection/CompilerPass/ServerPushHandlerCompilerPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(bool $internal = false)
2828
public function process(ContainerBuilder $container): void
2929
{
3030
if (!$this->internal) {
31-
trigger_deprecation('gos/web-socket-bundle', '3.1', 'The "%s" class is deprecated and will be removed in 4.0, use the symfony/messenger component instead.', ServerPushHandlerCompilerPass::class);
31+
trigger_deprecation('gos/web-socket-bundle', '3.1', 'The "%s" class is deprecated and will be removed in 4.0, use the symfony/messenger component instead.', self::class);
3232
}
3333

3434
if ($container->hasDefinition('gos_web_socket.registry.server_push_handler')) {

src/DependencyInjection/GosWebSocketExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ private function registerServerConfiguration(array $configs, ContainerBuilder $c
203203
// Adapt configuration based on the version of GosPubSubRouterBundle installed, if the XML loader is available the newer configuration structure is used
204204
if (isset($configs['server']['router']['resources'])) {
205205
foreach ($configs['server']['router']['resources'] as $resource) {
206-
if (is_array($resource)) {
206+
if (\is_array($resource)) {
207207
$routerConfig[] = $resource;
208208
} else {
209209
$routerConfig[] = [

src/EventListener/StartServerListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ public function bindPnctlEvent(ServerLaunchedEvent $event): void
5959
};
6060

6161
if (\defined('SIGINT')) {
62-
$loop->addSignal(SIGINT, $closer);
62+
$loop->addSignal(\SIGINT, $closer);
6363
}
6464

6565
if (\defined('SIGTERM')) {
66-
$loop->addSignal(SIGTERM, $closer);
66+
$loop->addSignal(\SIGTERM, $closer);
6767
}
6868
}
6969
}

0 commit comments

Comments
 (0)