• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mpyw / laravel-pdo-emulation-control / 13647856871

04 Mar 2025 06:44AM UTC coverage: 100.0%. Remained the same
13647856871

push

github

web-flow
Remove Scrutinizer

19 of 19 relevant lines covered (100.0%)

26.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/ConnectionServiceProvider.php
1
<?php
2

3
namespace Mpyw\LaravelPdoEmulationControl;
4

5
use Closure;
6
use Illuminate\Database\Connection;
7
use Illuminate\Support\ServiceProvider;
8
use Mpyw\LaravelPdoEmulationControl\Connections\MySqlConnection;
9
use Mpyw\LaravelPdoEmulationControl\Connections\PostgresConnection;
10
use Mpyw\LaravelPdoEmulationControl\Connections\SQLiteConnection;
11
use Mpyw\LaravelPdoEmulationControl\Connections\SqlServerConnection;
12

13
class ConnectionServiceProvider extends ServiceProvider
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function register(): void
19
    {
20
        Connection::resolverFor('mysql', $this->resolverFor(MySqlConnection::class));
32✔
21
        Connection::resolverFor('pgsql', $this->resolverFor(PostgresConnection::class));
32✔
22
        Connection::resolverFor('sqlite', $this->resolverFor(SQLiteConnection::class));
32✔
23
        Connection::resolverFor('sqlsrv', $this->resolverFor(SqlServerConnection::class));
32✔
24
    }
25

26
    /**
27
     * Create resolver for the connection.
28
     *
29
     * @param  string   $class
30
     * @return \Closure
31
     */
32
    protected function resolverFor(string $class): Closure
33
    {
34
        return static function (...$args) use ($class) {
32✔
35
            return new $class(...$args);
32✔
36
        };
32✔
37
    }
38
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc