Code Duplication    Length = 37-37 lines in 2 locations

src/Adaptors/MySql/ClientRepository.php 1 location

@@ 25-61 (lines=37) @@
22
/**
23
 * @package Limoncello\Passport
24
 */
25
class ClientRepository extends \Limoncello\Passport\Repositories\ClientRepository
26
{
27
    /**
28
     * @var string
29
     */
30
    private $modelClass;
31
32
    /**
33
     * @param Connection              $connection
34
     * @param DatabaseSchemaInterface $databaseSchema
35
     * @param string                  $modelClass
36
     */
37
    public function __construct(
38
        Connection $connection,
39
        DatabaseSchemaInterface $databaseSchema,
40
        string $modelClass = Client::class
41
    ) {
42
        $this->setConnection($connection)->setDatabaseSchema($databaseSchema);
43
        $this->modelClass = $modelClass;
44
    }
45
46
    /**
47
     * @inheritdoc
48
     */
49
    protected function getClassName(): string
50
    {
51
        return $this->modelClass;
52
    }
53
54
    /**
55
     * @inheritdoc
56
     */
57
    protected function getTableNameForReading(): string
58
    {
59
        return $this->getDatabaseSchema()->getClientsView();
60
    }
61
}
62

src/Adaptors/PostgreSql/ClientRepository.php 1 location

@@ 25-61 (lines=37) @@
22
/**
23
 * @package Limoncello\Passport
24
 */
25
class ClientRepository extends \Limoncello\Passport\Repositories\ClientRepository
26
{
27
    /**
28
     * @var string
29
     */
30
    private $modelClass;
31
32
    /**
33
     * @param Connection              $connection
34
     * @param DatabaseSchemaInterface $databaseSchema
35
     * @param string                  $modelClass
36
     */
37
    public function __construct(
38
        Connection $connection,
39
        DatabaseSchemaInterface $databaseSchema,
40
        string $modelClass = Client::class
41
    ) {
42
        $this->setConnection($connection)->setDatabaseSchema($databaseSchema);
43
        $this->modelClass = $modelClass;
44
    }
45
46
    /**
47
     * @inheritdoc
48
     */
49
    protected function getClassName(): string
50
    {
51
        return $this->modelClass;
52
    }
53
54
    /**
55
     * @inheritdoc
56
     */
57
    protected function getTableNameForReading(): string
58
    {
59
        return $this->getDatabaseSchema()->getClientsView();
60
    }
61
}
62