-
-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
62 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace Doctrine\Bundle\DoctrineBundle\Middleware; | ||
|
||
use Doctrine\DBAL\Driver; | ||
use Doctrine\DBAL\Driver\Middleware; | ||
use Symfony\Bridge\Doctrine\ConnectionTimingWeakMap; | ||
use Symfony\Bridge\Doctrine\Middleware\ConnectionKeepAliveDriver; | ||
|
||
class ConnectionKeepAlive implements Middleware, ConnectionNameAwareInterface | ||
{ | ||
private \ArrayObject $connectionExpiries; | ||
private string $connectionName; | ||
private array $timeToLiveByConnection; | ||
Check failure on line 14 in Middleware/ConnectionKeepAlive.php GitHub Actions / Coding Standards / Coding Standards (8.2)
|
||
|
||
/** | ||
* @param array<string, int> $timeToLiveByConnection | ||
*/ | ||
public function __construct( | ||
\ArrayObject $connectionExpiries, | ||
array $timeToLiveByConnection, | ||
string $connectionName = 'default' | ||
) { | ||
$this->timeToLiveByConnection = $timeToLiveByConnection; | ||
$this->connectionName = $connectionName; | ||
$this->connectionExpiries = $connectionExpiries; | ||
} | ||
|
||
public function setConnectionName(string $name): void | ||
{ | ||
$this->connectionName = $name; | ||
} | ||
|
||
public function wrap(Driver $driver): Driver | ||
{ | ||
return new ConnectionKeepAliveDriver($driver, $this->connectionExpiries, $this->timeToLiveByConnection, $this->connectionName); | ||
Check failure on line 36 in Middleware/ConnectionKeepAlive.php GitHub Actions / Static Analysis with PsalmUndefinedClass
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters