-
-
Save brzuchal/2057266a1d2a22cdd3ffd397ea34436a to your computer and use it in GitHub Desktop.
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
<?php | |
namespace Symfony\Component\Messenger\Bridge\Doctrine\Transport; | |
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface; | |
use Symfony\Component\Messenger\Transport\TransportFactoryInterface; | |
use Symfony\Contracts\Service\ResetInterface; | |
class DoctrineTransportFactory implements TransportFactoryInterface | |
{ | |
public function createTransport(string $dsn, array $options, SerializerInterface $serializer): TransportInterface | |
{ | |
// access to inner protected static class is allowed | |
$configuration = self\PostgreSqlConnection::buildConfiguration($dsn, $options); | |
if (substr($dsn, 8) === 'pgsql://') { | |
$connection = new self\PostgreSqlConnection($configuration, $driverConnection); | |
} else { | |
$connection = new self\Connection($configuration, $driverConnection); | |
} | |
return new DoctrineTransport($connection, $serializer); | |
} | |
private class Connection implements ResetInterface { | |
protected function __construct(array $configuration, DBALConnection $driverConnection, SchemaSynchronizer $schemaSynchronizer = null) {} | |
protected static function buildConfiguration(string $dsn, array $options = []): array {} | |
} | |
private class PostgreSqlConnection extends self/Connection {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment