Code Duplication    Length = 12-12 lines in 2 locations

controllers/Series.php 1 location

@@ 54-65 (lines=12) @@
51
     * @param string $context Form context
52
     * @return void
53
     */
54
    public function update($recordId = null, $context = null)
55
    {
56
        $series = SeriesModel::whereId($recordId)->first();
57
58
        if ($series !== null) {
59
            $this->pageTitle = trans(Plugin::LOCALIZATION_KEY . 'form.series.edit_title', ['series' => $series->title]);
60
        } else {
61
            $this->pageTitle = trans(Plugin::LOCALIZATION_KEY . 'form.series.series_does_not_exist');
62
        }
63
64
        return $this->asExtension('FormController')->update($recordId, $context);
65
    }
66
}
67

controllers/Tags.php 1 location

@@ 106-117 (lines=12) @@
103
     * @param string $context Form context
104
     * @return void
105
     */
106
    public function update($recordId = null, $context = null)
107
    {
108
        $tag = Tag::whereId($recordId)->first();
109
110
        if ($tag !== null) {
111
            $this->pageTitle = trans(Plugin::LOCALIZATION_KEY . 'form.tags.edit_title', ['tag' => $tag->name]);
112
        } else {
113
            $this->pageTitle = trans(Plugin::LOCALIZATION_KEY . 'form.tags.tag_does_not_exist');
114
        }
115
116
        return $this->asExtension('FormController')->update($recordId, $context);
117
    }
118
}
119