Skip to content

Commit 13cf9fd

Browse files
authored
Fix return type for Connection::connect()
Method must return `bool` according to phpdoc in `Doctrine\DBAL\Connection::connect()` > @return bool TRUE if the connection was successfully established, FALSE if the connection is already open. Missed return bool leads to type error while this package used with `doctrine/migrations:^2`
1 parent 484734f commit 13cf9fd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Decorator/JaegerConnectionDecorator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ public function __construct(Connection $connection, TracerInterface $tracer)
2626
parent::__construct($connection);
2727
}
2828

29-
public function connect()
29+
public function connect(): bool
3030
{
3131
if ($this->isConnected()) {
32-
return;
32+
return false;
3333
}
3434
$span = $this->tracer
3535
->start('dbal.connect')
@@ -38,7 +38,7 @@ public function connect()
3838
->addTag(new DbalAutoCommitTag($this->isAutoCommit()))
3939
->addTag(new DbalNestingLevelTag($this->getTransactionNestingLevel()));
4040
try {
41-
parent::connect();
41+
return parent::connect();
4242
} catch (\Exception $e) {
4343
$span->addTag(new DbalErrorCodeTag($e->getCode()))
4444
->addTag(new ErrorTag());

0 commit comments

Comments
 (0)