Code Duplication    Length = 7-9 lines in 4 locations

src/BenGorUser/User/Infrastructure/Persistence/SqlUserRepository.php 4 locations

@@ 85-91 (lines=7) @@
82
    /**
83
     * {@inheritdoc}
84
     */
85
    public function userOfEmail(UserEmail $anEmail)
86
    {
87
        $statement = $this->execute('SELECT * FROM user WHERE email = :email', ['email' => $anEmail->email()]);
88
        if ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
89
            return $this->buildUser($row);
90
        }
91
    }
92
93
    /**
94
     * {@inheritdoc}
@@ 96-104 (lines=9) @@
93
    /**
94
     * {@inheritdoc}
95
     */
96
    public function userOfConfirmationToken(UserToken $aConfirmationToken)
97
    {
98
        $statement = $this->execute('SELECT * FROM user WHERE confirmation_token_token = :confirmationToken', [
99
            'confirmationToken' => $aConfirmationToken->token(),
100
        ]);
101
        if ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
102
            return $this->buildUser($row);
103
        }
104
    }
105
106
    /**
107
     * {@inheritdoc}
@@ 109-117 (lines=9) @@
106
    /**
107
     * {@inheritdoc}
108
     */
109
    public function userOfInvitationToken(UserToken $anInvitationToken)
110
    {
111
        $statement = $this->execute('SELECT * FROM user WHERE invitation_token_token = :invitationToken', [
112
            'invitationToken' => $anInvitationToken->token(),
113
        ]);
114
        if ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
115
            return $this->buildUser($row);
116
        }
117
    }
118
119
    /**
120
     * {@inheritdoc}
@@ 122-130 (lines=9) @@
119
    /**
120
     * {@inheritdoc}
121
     */
122
    public function userOfRememberPasswordToken(UserToken $aRememberPasswordToken)
123
    {
124
        $statement = $this->execute('SELECT * FROM user WHERE remember_password_token_token = :rememberPasswordToken', [
125
            'rememberPasswordToken' => $aRememberPasswordToken->token(),
126
        ]);
127
        if ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
128
            return $this->buildUser($row);
129
        }
130
    }
131
132
    /**
133
     * {@inheritdoc}