Code Duplication    Length = 37-37 lines in 6 locations

src/Adaptors/Generic/RedirectUriRepository.php 1 location

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

src/Adaptors/Generic/ScopeRepository.php 1 location

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

src/Adaptors/MySql/RedirectUriRepository.php 1 location

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

src/Adaptors/MySql/ScopeRepository.php 1 location

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

src/Adaptors/PostgreSql/RedirectUriRepository.php 1 location

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

src/Adaptors/PostgreSql/ScopeRepository.php 1 location

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