Code Duplication    Length = 9-11 lines in 3 locations

eZ/Publish/Core/Persistence/Cache/LocationHandler.php 1 location

@@ 227-237 (lines=11) @@
224
    /**
225
     * {@inheritdoc}
226
     */
227
    public function create(CreateStruct $locationStruct)
228
    {
229
        $this->logger->logCall(__METHOD__, array('struct' => $locationStruct));
230
        $location = $this->persistenceHandler->locationHandler()->create($locationStruct);
231
232
        // need to clear loadLocationsByContent and similar collections involving locations data
233
        // also need to clear content info on main location changes
234
        $this->cache->invalidateTags(['content-' . $locationStruct->contentId, 'role-assignment-group-list-' . $locationStruct->contentId]);
235
236
        return $location;
237
    }
238
239
    /**
240
     * {@inheritdoc}

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

@@ 106-115 (lines=10) @@
103
    /**
104
     * {@inheritdoc}
105
     */
106
    public function update(User $user)
107
    {
108
        $this->logger->logCall(__METHOD__, array('struct' => $user));
109
        $return = $this->persistenceHandler->userHandler()->update($user);
110
111
        // Clear corresponding content cache as update of the User changes it's external data
112
        $this->cache->invalidateTags(['content-fields-' . $user->id, 'user-' . $user->id]);
113
114
        return $return;
115
    }
116
117
    /**
118
     * {@inheritdoc}
@@ 376-384 (lines=9) @@
373
    /**
374
     * {@inheritdoc}
375
     */
376
    public function updatePolicy(Policy $policy)
377
    {
378
        $this->logger->logCall(__METHOD__, array('struct' => $policy));
379
        $return = $this->persistenceHandler->userHandler()->updatePolicy($policy);
380
381
        $this->cache->invalidateTags(['policy-' . $policy->id, 'role-' . $policy->roleId]);
382
383
        return $return;
384
    }
385
386
    /**
387
     * {@inheritdoc}