Code Duplication    Length = 12-13 lines in 2 locations

eZ/Publish/Core/Persistence/Cache/UserHandler.php 2 locations

@@ 123-135 (lines=13) @@
120
    /**
121
     * {@inheritdoc}
122
     */
123
    public function loadByLogin($login)
124
    {
125
        return $this->getCacheValue(
126
            str_replace('@', '§', $login),
127
            'ez-user-',
128
            function ($escapedLogin) use ($login) {
129
                return $this->persistenceHandler->userHandler()->loadByLogin($login);
130
            },
131
            $this->getUserTags,
132
            $this->getUserKeys,
133
            '-by-login'
134
        );
135
    }
136
137
    /**
138
     * {@inheritdoc}
@@ 140-151 (lines=12) @@
137
    /**
138
     * {@inheritdoc}
139
     */
140
    public function loadByEmail($email)
141
    {
142
        // As load by email can return several items we threat it like a list here.
143
        return $this->getListCacheValue(
144
            'ez-user-' . str_replace('@', '§', $email) . '-by-email',
145
            function () use ($email) {
146
                return $this->persistenceHandler->userHandler()->loadByEmail($email);
147
            },
148
            $this->getUserTags,
149
            $this->getUserKeys
150
        );
151
    }
152
153
    /**
154
     * {@inheritdoc}