Code Duplication    Length = 12-13 lines in 2 locations

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

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