Code Duplication    Length = 12-14 lines in 2 locations

src/Model/Blog.php 1 location

@@ 248-259 (lines=12) @@
245
     *
246
     * @return bool
247
     */
248
    protected function isMemberOf($member, $relation)
249
    {
250
        if (!$member || !$member->exists()) {
251
            return false;
252
        }
253
254
        if ($relation instanceof UnsavedRelationList) {
255
            return in_array($member->ID, $relation->getIDList());
256
        }
257
258
        return $relation->byID($member->ID) !== null;
259
    }
260
261
    /**
262
     * Determine the role of the given member.

src/Model/BlogPost.php 1 location

@@ 182-195 (lines=14) @@
179
     *
180
     * @return bool
181
     */
182
    public function isAuthor($member = null)
183
    {
184
        if (!$member || !$member->exists()) {
185
            return false;
186
        }
187
188
        $list = $this->Authors();
189
190
        if ($list instanceof UnsavedRelationList) {
191
            return in_array($member->ID, $list->getIDList());
192
        }
193
194
        return $list->byID($member->ID) !== null;
195
    }
196
197
    /**
198
     * {@inheritdoc}