Skip to content

Commit 7ba7e2a

Browse files
dgafkagithub-actions[bot]
authored andcommitted
Release 1.254.0
1 parent 20f4153 commit 7ba7e2a

34 files changed

+122
-122
lines changed

packages/Amqp/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
"require": {
4444
"ext-amqp": "*",
45-
"ecotone/enqueue": "~1.253.0",
45+
"ecotone/enqueue": "~1.254.0",
4646
"enqueue/amqp-ext": "^0.10.18",
4747
"enqueue/dsn": "^0.10.4",
4848
"enqueue/enqueue": "^0.10.0"
@@ -65,7 +65,7 @@
6565
},
6666
"extra": {
6767
"branch-alias": {
68-
"dev-main": "1.253.0-dev"
68+
"dev-main": "1.254.0-dev"
6969
},
7070
"ecotone": {
7171
"repository": "amqp"
@@ -86,7 +86,7 @@
8686
"description": "Allows to use Enterprise features of Ecotone. For more information please write to [email protected]"
8787
}
8888
},
89-
"release-time": "2025-04-16 05:35:52"
89+
"release-time": "2025-04-19 15:37:40"
9090
},
9191
"config": {
9292
"allow-plugins": {

packages/Dbal/composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
}
3535
},
3636
"require": {
37-
"ecotone/enqueue": "~1.253.0",
37+
"ecotone/enqueue": "~1.254.0",
3838
"doctrine/dbal": "^3.9|^4.0",
3939
"enqueue/dsn": "^0.10.4"
4040
},
@@ -46,7 +46,7 @@
4646
"doctrine/cache": "^1.0.0|^2.0",
4747
"doctrine/annotations": "^1.13|^2.0",
4848
"wikimedia/composer-merge-plugin": "^2.1",
49-
"ecotone/jms-converter": "~1.253.0",
49+
"ecotone/jms-converter": "~1.254.0",
5050
"symfony/expression-language": "^6.0|^7.0"
5151
},
5252
"scripts": {
@@ -59,7 +59,7 @@
5959
},
6060
"extra": {
6161
"branch-alias": {
62-
"dev-main": "1.253.0-dev"
62+
"dev-main": "1.254.0-dev"
6363
},
6464
"ecotone": {
6565
"repository": "dbal"
@@ -80,7 +80,7 @@
8080
"description": "Allows to use Enterprise features of Ecotone. For more information please write to [email protected]"
8181
}
8282
},
83-
"release-time": "2025-04-16 05:35:52"
83+
"release-time": "2025-04-19 15:37:40"
8484
},
8585
"config": {
8686
"allow-plugins": {

packages/Dbal/src/Compatibility/QueryBuilderProxy.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44

55
namespace Ecotone\Dbal\Compatibility;
66

7-
use Doctrine\DBAL\Connection;
87
use Doctrine\DBAL\Query\Expression\ExpressionBuilder;
98
use Doctrine\DBAL\Query\QueryBuilder;
109
use Doctrine\DBAL\Result;
10+
use Exception;
1111
use InvalidArgumentException;
12+
use ReflectionMethod;
1213

1314
/**
1415
* @package Ecotone\Dbal\Compatibility
@@ -41,7 +42,7 @@ private function detectDbal4(): bool
4142
{
4243
// Check if the select method has the DBAL 4 signature (with variadic string parameters)
4344
try {
44-
$reflectionMethod = new \ReflectionMethod(QueryBuilder::class, 'select');
45+
$reflectionMethod = new ReflectionMethod(QueryBuilder::class, 'select');
4546
$parameters = $reflectionMethod->getParameters();
4647

4748
if (count($parameters) === 0) {
@@ -50,7 +51,7 @@ private function detectDbal4(): bool
5051

5152
// In DBAL 4, the first parameter is named 'expressions' and is variadic
5253
return $parameters[0]->isVariadic() && $parameters[0]->getName() === 'expressions';
53-
} catch (\Exception $e) {
54+
} catch (Exception $e) {
5455
// If we can't determine the version, assume it's DBAL 3
5556
return false;
5657
}

packages/Dbal/src/Compatibility/SchemaManagerCompatibility.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
namespace Ecotone\Dbal\Compatibility;
66

77
use Doctrine\DBAL\Connection;
8-
use Doctrine\DBAL\Schema\AbstractSchemaManager;
9-
use Doctrine\DBAL\Schema\Column;
108
use Doctrine\DBAL\Schema\Schema;
11-
use Doctrine\DBAL\Types\Type;
129
use Doctrine\DBAL\Schema\Table;
10+
use RuntimeException;
1311

1412
/**
1513
* @package Ecotone\Dbal\Compatibility
@@ -43,7 +41,7 @@ public static function getSchemaManager(Connection $connection): object
4341
}
4442

4543
// If neither method exists, throw an exception
46-
throw new \RuntimeException('Could not get schema manager from connection');
44+
throw new RuntimeException('Could not get schema manager from connection');
4745
}
4846

4947
public static function tableExists(Connection $connection, string $tableName): bool

packages/Dbal/src/DbaBusinessMethod/DbalBusinessMethodHandler.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,12 @@ private function convertScalarParameterType($type)
324324
// If we're using DBAL 4.x with enum ParameterType
325325
if (enum_exists('\Doctrine\DBAL\ParameterType')) {
326326
return match($type) {
327-
1 => \Doctrine\DBAL\ParameterType::INTEGER,
328-
2 => \Doctrine\DBAL\ParameterType::STRING,
329-
3 => \Doctrine\DBAL\ParameterType::LARGE_OBJECT,
330-
5 => \Doctrine\DBAL\ParameterType::BOOLEAN,
331-
16 => \Doctrine\DBAL\ParameterType::BINARY,
332-
17 => \Doctrine\DBAL\ParameterType::ASCII,
327+
1 => ParameterType::INTEGER,
328+
2 => ParameterType::STRING,
329+
3 => ParameterType::LARGE_OBJECT,
330+
5 => ParameterType::BOOLEAN,
331+
16 => ParameterType::BINARY,
332+
17 => ParameterType::ASCII,
333333
default => $type,
334334
};
335335
}

packages/Dbal/src/DbalReconnectableConnectionFactory.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Interop\Queue\ConnectionFactory;
1212
use Interop\Queue\Context;
1313
use ReflectionClass;
14+
use ReflectionMethod;
1415

1516
/**
1617
* licence Apache-2.0
@@ -66,11 +67,11 @@ public function reconnect(): void
6667
{
6768
$connection = $this->getConnection();
6869

69-
$reflectionMethod = new \ReflectionMethod($connection, 'close');
70+
$reflectionMethod = new ReflectionMethod($connection, 'close');
7071
$reflectionMethod->setAccessible(true);
7172
$reflectionMethod->invoke($connection);
7273

73-
$reflectionMethod = new \ReflectionMethod($connection, 'connect');
74+
$reflectionMethod = new ReflectionMethod($connection, 'connect');
7475
$reflectionMethod->setAccessible(true);
7576
$reflectionMethod->invoke($connection);
7677
}

packages/Dbal/src/DbalTransaction/DbalTransactionInterceptor.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Doctrine\DBAL\Connection;
66
use Doctrine\DBAL\Exception\ConnectionException;
7-
use Ecotone\Dbal\Compatibility\ConnectionExceptionCompatibility;
87
use Ecotone\Dbal\DbalReconnectableConnectionFactory;
98
use Ecotone\Enqueue\CachedConnectionFactory;
109
use Ecotone\Messaging\Attribute\Parameter\Reference;
@@ -18,7 +17,6 @@
1817
use Enqueue\Dbal\ManagerRegistryConnectionFactory;
1918
use Exception;
2019
use Interop\Queue\ConnectionFactory;
21-
use PDOException;
2220
use Throwable;
2321

2422
/**
@@ -92,7 +90,7 @@ public function transactional(MethodInvocation $methodInvocation, Message $messa
9290
try {
9391
$connection->commit();
9492
$logger->info('Database Transaction committed', $message);
95-
} catch (\Exception $exception) {
93+
} catch (Exception $exception) {
9694
// Handle the case where a database did an implicit commit or the transaction is no longer active
9795
if ($this->isImplicitCommitException($exception)) {
9896
$logger->info(
@@ -135,7 +133,7 @@ public function transactional(MethodInvocation $methodInvocation, Message $messa
135133
return $result;
136134
}
137135

138-
private function isImplicitCommitException(\Throwable $exception): bool
136+
private function isImplicitCommitException(Throwable $exception): bool
139137
{
140138
$patterns = [
141139
'No active transaction',

packages/Dbal/src/Deduplication/DeduplicationInterceptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function removeExpiredMessages(): void
105105
$this->getConnection($connectionFactory)->createQueryBuilder()
106106
->delete($this->getTableName())
107107
->andWhere('message_id IN (:messageIds)')
108-
->setParameter('messageIds', array_column($messageIds, 'message_id'), class_exists('\Doctrine\DBAL\ArrayParameterType') ? \Doctrine\DBAL\ArrayParameterType::STRING : (defined('\Doctrine\DBAL\Connection::PARAM_STR_ARRAY') ? \Doctrine\DBAL\Connection::PARAM_STR_ARRAY : 'string[]'))
108+
->setParameter('messageIds', array_column($messageIds, 'message_id'), class_exists('\Doctrine\DBAL\ArrayParameterType') ? \Doctrine\DBAL\ArrayParameterType::STRING : (defined('\Doctrine\DBAL\Connection::PARAM_STR_ARRAY') ? Connection::PARAM_STR_ARRAY : 'string[]'))
109109
// In DBAL 4.x, execute() is replaced with executeStatement()
110110
->executeStatement();
111111
}

packages/Dbal/src/EnqueueDbal/DbalConnectionFactory.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66

77
use Doctrine\DBAL\Connection;
88
use Doctrine\DBAL\DriverManager;
9-
use Ecotone\Dbal\Compatibility\ConnectionConfigCompatibility;
10-
use Ecotone\Dbal\Compatibility\DbalTypeCompatibility;
119
use Enqueue\Dsn\Dsn;
10+
use Exception;
1211
use Interop\Queue\ConnectionFactory;
1312
use Interop\Queue\Context;
13+
use LogicException;
14+
use ReflectionMethod;
15+
use Throwable;
1416

1517
/**
1618
* licence MIT
@@ -56,7 +58,7 @@ public function __construct($config = 'mysql:')
5658
unset($config['dsn']);
5759
}
5860
} else {
59-
throw new \LogicException('The config must be either an array of options, a DSN string or null');
61+
throw new LogicException('The config must be either an array of options, a DSN string or null');
6062
}
6163

6264
$this->config = array_replace_recursive([
@@ -88,12 +90,12 @@ public function close(): void
8890
// Try to call close() if it's available, otherwise just set to null
8991
try {
9092
if (method_exists($this->connection, 'close') && is_callable([$this->connection, 'close'])) {
91-
$reflection = new \ReflectionMethod($this->connection, 'close');
93+
$reflection = new ReflectionMethod($this->connection, 'close');
9294
if ($reflection->isPublic()) {
9395
$this->connection->close();
9496
}
9597
}
96-
} catch (\Throwable $e) {
98+
} catch (Throwable $e) {
9799
// Ignore any errors, we'll set the connection to null anyway
98100
}
99101

@@ -112,7 +114,7 @@ private function establishConnection(): Connection
112114
try {
113115
// In DBAL 3.x, connect() is public
114116
if (method_exists($this->connection, 'connect') && is_callable([$this->connection, 'connect'])) {
115-
$reflection = new \ReflectionMethod($this->connection, 'connect');
117+
$reflection = new ReflectionMethod($this->connection, 'connect');
116118
if ($reflection->isPublic()) {
117119
$this->connection->connect();
118120
} else {
@@ -123,7 +125,7 @@ private function establishConnection(): Connection
123125
// Fallback for any other case
124126
$this->connection->getNativeConnection();
125127
}
126-
} catch (\Exception $e) {
128+
} catch (Exception $e) {
127129
// Connection failed, but we've already tried our best
128130
}
129131
}
@@ -152,7 +154,7 @@ private function parseDsn(string $dsn, ?array $config = null): array
152154
];
153155

154156
if ($parsedDsn && false == isset($supported[$parsedDsn->getScheme()])) {
155-
throw new \LogicException(sprintf('The given DSN schema "%s" is not supported. There are supported schemes: "%s".', $parsedDsn->getScheme(), implode('", "', array_keys($supported))));
157+
throw new LogicException(sprintf('The given DSN schema "%s" is not supported. There are supported schemes: "%s".', $parsedDsn->getScheme(), implode('", "', array_keys($supported))));
156158
}
157159

158160
$doctrineScheme = $supported[$parsedDsn->getScheme()];

packages/Dbal/src/EnqueueDbal/DbalConsumerHelperTrait.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Doctrine\DBAL\Connection;
88
use Doctrine\DBAL\Exception\RetryableException;
9+
use LogicException;
910
use Ramsey\Uuid\Uuid;
1011

1112
/**
@@ -25,7 +26,7 @@ abstract protected function getConnection(): Connection;
2526
protected function fetchMessage(array $queues, int $redeliveryDelay): ?DbalMessage
2627
{
2728
if (empty($queues)) {
28-
throw new \LogicException('Queues must not be empty.');
29+
throw new LogicException('Queues must not be empty.');
2930
}
3031

3132
$now = time();
@@ -41,7 +42,7 @@ protected function fetchMessage(array $queues, int $redeliveryDelay): ?DbalMessa
4142
->andWhere('delivery_id IS NULL')
4243
->addOrderBy('priority', 'asc')
4344
->addOrderBy('published_at', 'asc')
44-
->setParameter('queues', $queues, class_exists('\Doctrine\DBAL\ArrayParameterType') ? \Doctrine\DBAL\ArrayParameterType::STRING : (defined('\Doctrine\DBAL\Connection::PARAM_STR_ARRAY') ? \Doctrine\DBAL\Connection::PARAM_STR_ARRAY : 'string[]'))
45+
->setParameter('queues', $queues, class_exists('\Doctrine\DBAL\ArrayParameterType') ? \Doctrine\DBAL\ArrayParameterType::STRING : (defined('\Doctrine\DBAL\Connection::PARAM_STR_ARRAY') ? Connection::PARAM_STR_ARRAY : 'string[]'))
4546
->setParameter('delayedUntil', $now, DbalType::INTEGER)
4647
->setMaxResults(1);
4748

@@ -166,7 +167,7 @@ protected function removeExpiredMessages(): void
166167
private function deleteMessage(string $deliveryId): void
167168
{
168169
if (empty($deliveryId)) {
169-
throw new \LogicException(sprintf('Expected record was removed but it is not. Delivery id: "%s"', $deliveryId));
170+
throw new LogicException(sprintf('Expected record was removed but it is not. Delivery id: "%s"', $deliveryId));
170171
}
171172

172173
$this->getConnection()->delete(

0 commit comments

Comments
 (0)