Skip to content

Commit 0e3bbdf

Browse files
author
Stepan Zolotarev
committed
Update dependencies
1 parent 4d07768 commit 0e3bbdf

File tree

63 files changed

+399
-695
lines changed

Some content is hidden

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

63 files changed

+399
-695
lines changed

composer.json

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -44,49 +44,48 @@
4444
]
4545
},
4646
"require": {
47-
"php": ">=8.1",
47+
"php": ">=8.2",
4848
"ext-pcntl": "*",
4949
"ext-json": "*",
5050
"ext-zlib": "*",
51-
"php-service-bus/http-client": "v5.1.*",
52-
"php-service-bus/common": "v5.1.*",
53-
"php-service-bus/transport": "v5.1.*",
54-
"php-service-bus/storage": "v5.1.*",
55-
"php-service-bus/mutex": "v5.1.*",
56-
"php-service-bus/message-serializer": "v5.1.*",
57-
"php-service-bus/annotations-reader":"v5.1.*",
58-
"php-service-bus/messages-router": "v5.1.*",
59-
"php-service-bus/telegram-bot-core": "v5.1.*",
60-
"php-service-bus/argument-resolver": "v5.1.*",
61-
"symfony/dependency-injection": "v6.0.*",
62-
"symfony/config": "v6.0.*",
63-
"symfony/dotenv": "v6.0.*",
64-
"symfony/yaml": "v6.0.*",
65-
"symfony/validator": "v6.0.*",
66-
"symfony/error-handler": "v6.0.*",
67-
"amphp/log": "v1.1.*",
51+
"php-service-bus/http-client": "v5.2.*",
52+
"php-service-bus/common": "v5.2.*",
53+
"php-service-bus/transport": "v5.2.*",
54+
"php-service-bus/storage": "v5.2.*",
55+
"php-service-bus/mutex": "v5.2.*",
56+
"php-service-bus/message-serializer": "v5.2.*",
57+
"php-service-bus/annotations-reader":"v5.2.*",
58+
"php-service-bus/messages-router": "v5.2.*",
59+
"php-service-bus/telegram-bot-core": "v5.2.*",
60+
"php-service-bus/argument-resolver": "v5.2.*",
61+
"symfony/dependency-injection": "^6.3 || ^7.0",
62+
"symfony/config": "^6.3 || ^7.0",
63+
"symfony/dotenv": "^6.3 || ^7.0",
64+
"symfony/yaml": "^6.3 || ^7.0",
65+
"symfony/validator": "^6.3 || ^7.0",
66+
"symfony/error-handler": "^6.3 || ^7.0",
67+
"amphp/log": "v1.2.*",
6868
"amphp/file": "v2.0.*",
6969
"amphp/parallel": "v1.4.*",
7070
"kelunik/retry": "v1.0.*"
7171
},
7272
"require-dev": {
73-
"php-service-bus/code-style-config": "v5.1.*",
74-
"kelunik/loop-block": "v1.0.*",
75-
"phpunit/phpunit": "v9.5.*",
76-
"vimeo/psalm": "v4.22.*",
77-
"phpstan/phpstan": "v1.5.*",
78-
"boesing/psalm-plugin-stringf": "v1.1.*"
73+
"php-service-bus/code-style-config": "v5.2.*",
74+
"kelunik/loop-block": "v1.*",
75+
"phpunit/phpunit": "^10.0 || ^11.0",
76+
"vimeo/psalm": "^4.30 || ^5.4",
77+
"phpstan/phpstan": "^1.12 || ^2.0"
7978
},
8079
"prefer-stable": true,
8180
"minimum-stability": "stable",
8281
"scripts": {
8382
"psalm": "rm -rf ~/.cache/psalm/ && ./vendor/bin/psalm --config=psalm.xml",
84-
"phpstan": "./vendor/bin/phpstan analyse src --level 9",
85-
"tests": "./vendor/bin/phpunit --configuration phpunit.xml --verbose --debug",
86-
"coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --configuration phpunit.xml --coverage-html ./coverage --verbose --debug",
83+
"phpstan": "./vendor/bin/phpstan analyse src",
84+
"tests": "./vendor/bin/phpunit --configuration phpunit.xml",
85+
"coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --configuration phpunit.xml --coverage-html ./coverage",
8786
"cs-check": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run",
8887
"cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes",
89-
"pre-commit": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes && ./vendor/bin/psalm --config=psalm.xml && ./vendor/bin/phpstan analyse src --level 9 && ./vendor/bin/phpunit --configuration phpunit.xml --verbose"
88+
"pre-commit": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes && ./vendor/bin/psalm --config=psalm.xml && ./vendor/bin/phpstan analyse src && ./vendor/bin/phpunit --configuration phpunit.xml"
9089
},
9190
"config": {
9291
"optimize-autoloader": true,

phpstan.neon

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
parameters:
2-
checkMissingIterableValueType: false
3-
checkGenericClassInNonGenericObjectType: false
4-
ignoreErrors:
5-
- '#Method ServiceBus\\Context\\KernelContext::validationFailed\(\) is unused#'
2+
level: 9
3+
ignoreErrors:
4+
- identifier: missingType.iterableValue
5+
- identifier: missingType.generics
6+
- identifier: varTag.nativeType

phpunit.xml

Lines changed: 52 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,58 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
44
colors="true"
55
cacheResult="false"
6-
convertDeprecationsToExceptions="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="true"
11-
stopOnError="false"
12-
stopOnFailure="false"
136
beStrictAboutChangesToGlobalState="true"
14-
beStrictAboutOutputDuringTests="true"
15-
verbose="true"
16-
>
17-
<coverage>
18-
<include>
19-
<directory>./src</directory>
20-
</include>
21-
<exclude>
22-
<directory>./tests</directory>
23-
</exclude>
24-
</coverage>
25-
<php>
26-
<ini name="error_reporting" value="-1"/>
27-
<env name="REDIS_CONNECTION_DSN" value="tcp://localhost:6379"/>
28-
<env name="TRANSPORT_CONNECTION_DSN" value="amqp://guest:[email protected]:5672/?heartbeat=0"/>
29-
<env name="NSQ_CONNECTION_DSN" value="tcp://localhost:4150"/>
30-
<env name="TEST_POSTGRES_DSN" value="pgsql://test:123456789@localhost:5432/test"/>
31-
</php>
32-
<testsuites>
33-
34-
<testsuite name="PHP Service Bus: Common component">
35-
<directory>./vendor/php-service-bus/common/tests/</directory>
36-
</testsuite>
37-
38-
<testsuite name="PHP Service Bus: Annotations (attributes) reader component">
39-
<directory>./vendor/php-service-bus/annotations-reader/tests/</directory>
40-
</testsuite>
41-
42-
<testsuite name="PHP Service Bus: Cache component">
43-
<directory>./vendor/php-service-bus/cache/tests/</directory>
44-
</testsuite>
45-
46-
<testsuite name="PHP Service Bus: Http client component">
47-
<directory>./vendor/php-service-bus/http-client/tests/</directory>
48-
</testsuite>
49-
50-
<testsuite name="PHP Service Bus: Message serializer component">
51-
<directory>./vendor/php-service-bus/message-serializer/tests/</directory>
52-
</testsuite>
53-
54-
<testsuite name="PHP Service Bus: Message router component">
55-
<directory>./vendor/php-service-bus/messages-router/tests/</directory>
56-
</testsuite>
57-
58-
<testsuite name="PHP Service Bus: Mutex component">
59-
<directory>./vendor/php-service-bus/mutex/tests/</directory>
60-
</testsuite>
61-
62-
<testsuite name="PHP Service Bus: Storage component">
63-
<directory>./vendor/php-service-bus/storage/tests/</directory>
64-
</testsuite>
65-
66-
<testsuite name="PHP Service Bus: Transport component">
67-
<directory>./vendor/php-service-bus/transport/tests/</directory>
68-
</testsuite>
69-
70-
<testsuite name="PHP Service Bus: Telegram core component">
71-
<directory>./vendor/php-service-bus/telegram-bot-core/tests/</directory>
72-
</testsuite>
73-
74-
<testsuite name="PHP Service Bus">
75-
<directory>./tests/</directory>
76-
</testsuite>
77-
</testsuites>
7+
beStrictAboutOutputDuringTests="true">
8+
<php>
9+
<ini name="error_reporting" value="-1"/>
10+
<env name="REDIS_CONNECTION_DSN" value="tcp://localhost:6379"/>
11+
<env name="TRANSPORT_CONNECTION_DSN" value="amqp://guest:[email protected]:5672/?heartbeat=0"/>
12+
<env name="NSQ_CONNECTION_DSN" value="tcp://localhost:4150"/>
13+
<env name="TEST_POSTGRES_DSN" value="pgsql://test:123456789@localhost:5432/test"/>
14+
</php>
15+
<testsuites>
16+
<testsuite name="PHP Service Bus: Common component">
17+
<directory>./vendor/php-service-bus/common/tests/</directory>
18+
</testsuite>
19+
<testsuite name="PHP Service Bus: Annotations (attributes) reader component">
20+
<directory>./vendor/php-service-bus/annotations-reader/tests/</directory>
21+
</testsuite>
22+
<testsuite name="PHP Service Bus: Cache component">
23+
<directory>./vendor/php-service-bus/cache/tests/</directory>
24+
</testsuite>
25+
<testsuite name="PHP Service Bus: Http client component">
26+
<directory>./vendor/php-service-bus/http-client/tests/</directory>
27+
</testsuite>
28+
<testsuite name="PHP Service Bus: Message serializer component">
29+
<directory>./vendor/php-service-bus/message-serializer/tests/</directory>
30+
</testsuite>
31+
<testsuite name="PHP Service Bus: Message router component">
32+
<directory>./vendor/php-service-bus/messages-router/tests/</directory>
33+
</testsuite>
34+
<testsuite name="PHP Service Bus: Mutex component">
35+
<directory>./vendor/php-service-bus/mutex/tests/</directory>
36+
</testsuite>
37+
<testsuite name="PHP Service Bus: Storage component">
38+
<directory>./vendor/php-service-bus/storage/tests/</directory>
39+
</testsuite>
40+
<testsuite name="PHP Service Bus: Transport component">
41+
<directory>./vendor/php-service-bus/transport/tests/</directory>
42+
</testsuite>
43+
<testsuite name="PHP Service Bus: Telegram core component">
44+
<directory>./vendor/php-service-bus/telegram-bot-core/tests/</directory>
45+
</testsuite>
46+
<testsuite name="PHP Service Bus">
47+
<directory>./tests/</directory>
48+
</testsuite>
49+
</testsuites>
50+
<source>
51+
<include>
52+
<directory>./src</directory>
53+
</include>
54+
<exclude>
55+
<directory>./tests</directory>
56+
</exclude>
57+
</source>
7858
</phpunit>

psalm.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
<issueHandlers>
2121
<PropertyNotSetInConstructor errorLevel="suppress"/>
2222
<UnnecessaryVarAnnotation errorLevel="suppress"/>
23+
<RiskyTruthyFalsyComparison errorLevel="suppress"/>
2324
</issueHandlers>
24-
<plugins>
25-
<pluginClass class="Boesing\PsalmPluginStringf\Plugin"/>
26-
</plugins>
2725
</psalm>

src/Application/Bootstrap.php

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,11 @@ final class Bootstrap
5151
*/
5252
public static function withDotEnv(string $rootDirectoryPath, string $envFilePath): self
5353
{
54-
try
55-
{
54+
try {
5655
(new Dotenv())
5756
->usePutenv(true)
5857
->load($envFilePath);
59-
}
60-
catch (\Throwable $throwable)
61-
{
58+
} catch (\Throwable $throwable) {
6259
throw new ConfigurationCheckFailed($throwable->getMessage(), (int) $throwable->getCode(), $throwable);
6360
}
6461

@@ -99,27 +96,21 @@ public static function withEnvironmentValues(string $rootDirectoryPath): self
9996
*/
10097
public static function create(string $rootDirectoryPath, string $entryPointName, string $environment): self
10198
{
102-
if ($entryPointName === '')
103-
{
99+
if ($entryPointName === '') {
104100
throw ConfigurationCheckFailed::emptyEntryPointName();
105101
}
106102

107-
if ($environment === '')
108-
{
103+
if ($environment === '') {
109104
throw ConfigurationCheckFailed::emptyEnvironment();
110105
}
111106

112-
if ($rootDirectoryPath === '')
113-
{
107+
if ($rootDirectoryPath === '') {
114108
throw ConfigurationCheckFailed::emptyRootDirectoryPath();
115109
}
116110

117-
try
118-
{
111+
try {
119112
$env = Environment::create($environment);
120-
}
121-
catch (\Throwable $throwable)
122-
{
113+
} catch (\Throwable $throwable) {
123114
throw new ConfigurationCheckFailed($throwable->getMessage(), (int) $throwable->getCode(), $throwable);
124115
}
125116

@@ -258,8 +249,7 @@ public function addCompilerPasses(CompilerPassInterface ...$compilerPasses): sel
258249
*/
259250
private function __construct(string $rootDirectoryPath, string $entryPointName, Environment $environment)
260251
{
261-
if (\is_dir($rootDirectoryPath) === false || \is_readable($rootDirectoryPath) === false)
262-
{
252+
if (\is_dir($rootDirectoryPath) === false || \is_readable($rootDirectoryPath) === false) {
263253
throw new ConfigurationCheckFailed('Incorrect root directory path');
264254
}
265255

src/Application/DependencyInjection/Compiler/ImportMessageHandlersCompilerPass.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1616
use Symfony\Component\DependencyInjection\ContainerBuilder;
17+
1718
use function ServiceBus\Common\canonicalizeFilesPath;
1819
use function ServiceBus\Common\extractNamespaceFromFile;
1920
use function ServiceBus\Common\searchFiles;
@@ -22,8 +23,7 @@ final class ImportMessageHandlersCompilerPass implements CompilerPassInterface
2223
{
2324
public function process(ContainerBuilder $container): void
2425
{
25-
if (self::enabled($container))
26-
{
26+
if (self::enabled($container)) {
2727
$excludedFiles = canonicalizeFilesPath(self::getExcludedFiles($container));
2828

2929
$projectFilesIterator = searchFiles(self::getDirectories($container), '/\.php/i');
@@ -38,7 +38,7 @@ public function process(ContainerBuilder $container): void
3838

3939
/**
4040
* @psalm-param \Generator<\SplFileInfo> $projectFilesIterator
41-
* @psalm-param list<string> $excludedFiles
41+
* @psalm-param string[] $excludedFiles
4242
*
4343
* @throws \ServiceBus\Common\Exceptions\FileSystemException
4444
*/
@@ -48,13 +48,11 @@ private function registerClasses(
4848
array $excludedFiles
4949
): void {
5050
/** @var \SplFileInfo $file */
51-
foreach ($projectFilesIterator as $file)
52-
{
51+
foreach ($projectFilesIterator as $file) {
5352
/** @var string $filePath */
5453
$filePath = $file->getRealPath();
5554

56-
if ($filePath !== '' && \in_array($filePath, $excludedFiles, true) === false)
57-
{
55+
if ($filePath !== '' && \in_array($filePath, $excludedFiles, true) === false) {
5856
$class = extractNamespaceFromFile($filePath);
5957

6058
if (
@@ -105,8 +103,6 @@ private static function getDirectories(ContainerBuilder $container): array
105103
private static function getExcludedFiles(ContainerBuilder $container): array
106104
{
107105
/**
108-
* @noinspection PhpUnnecessaryLocalVariableInspection
109-
*
110106
* @psalm-var list<non-empty-string> $excludedFiles
111107
*/
112108
$excludedFiles = $container->hasParameter('service_bus.auto_import.handlers_excluded')

src/Application/DependencyInjection/Compiler/Logger/GraylogLoggerCompilerPass.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
namespace ServiceBus\Application\DependencyInjection\Compiler\Logger;
1414

15+
use Monolog\Level;
1516
use Monolog\Logger;
1617
use Psr\Log\LoggerInterface;
1718
use ServiceBus\Infrastructure\Logger\Handlers\Graylog\UdpHandler;
@@ -40,9 +41,7 @@ final class GraylogLoggerCompilerPass implements CompilerPassInterface
4041
private $port;
4142

4243
/**
43-
* @psalm-var Logger::DEBUG | Logger::INFO | Logger::NOTICE | Logger::WARNING | Logger::ERROR | Logger::CRITICAL | Logger::ALERT | Logger::EMERGENCY
44-
*
45-
* @var int
44+
* @var Level
4645
*/
4746
private $logLevel;
4847

@@ -54,17 +53,18 @@ final class GraylogLoggerCompilerPass implements CompilerPassInterface
5453
/**
5554
* @psalm-param non-empty-string $host
5655
* @psalm-param positive-int $port
57-
* @psalm-param Logger::DEBUG | Logger::INFO | Logger::NOTICE | Logger::WARNING | Logger::ERROR | Logger::CRITICAL | Logger::ALERT | Logger::EMERGENCY $logLevel
56+
* @psalm-param 100|200|250|300|400|500|550|600|'ALERT'|'alert'|'CRITICAL'|'critical'|'DEBUG'|'debug'|'EMERGENCY'|'emergency'|'ERROR'|'error'|'INFO'|'info'|'NOTICE'|'notice'|'WARNING'|'warning'|Level $level
5857
*/
5958
public function __construct(
6059
string $host = '0.0.0.0',
6160
int $port = 514,
62-
int $logLevel = Logger::DEBUG,
61+
int|string|Level $level = Level::Debug,
6362
bool $gzipMessage = false
6463
) {
6564
$this->host = $host;
6665
$this->port = $port;
67-
$this->logLevel = $logLevel;
66+
/** @psalm-suppress PossiblyInvalidArgument */
67+
$this->logLevel = Logger::toMonologLevel($level);
6868
$this->gzipMessage = $gzipMessage;
6969
}
7070

@@ -97,11 +97,10 @@ private function injectParameters(ContainerBuilder $containerBuilder): void
9797
'service_bus.logger.graylog.udp_host' => $this->host,
9898
'service_bus.logger.graylog.udp_port' => $this->port,
9999
'service_bus.logger.graylog.gzip' => $this->gzipMessage,
100-
'service_bus.logger.graylog.log_level' => $this->logLevel,
100+
'service_bus.logger.graylog.log_level' => $this->logLevel->value,
101101
];
102102

103-
foreach ($parameters as $key => $value)
104-
{
103+
foreach ($parameters as $key => $value) {
105104
$containerBuilder->setParameter(
106105
name: $key,
107106
value: $value

0 commit comments

Comments
 (0)