Code Duplication    Length = 16-16 lines in 2 locations

src/Charcoal/Object/RoutableTrait.php 2 locations

@@ 128-143 (lines=16) @@
125
     *
126
     * @return TranslationString|null
127
     */
128
    public function slugPrefix()
129
    {
130
        if (!$this->slugPrefix) {
131
            $metadata = $this->metadata();
132
133
            if (isset($metadata['routable']['prefix'])) {
134
                $affix = $metadata['routable']['prefix'];
135
136
                if (TranslationString::isTranslatable($affix)) {
137
                    $this->slugPrefix = new TranslationString($affix);
138
                }
139
            }
140
        }
141
142
        return $this->slugPrefix;
143
    }
144
145
    /**
146
     * Retrieve route suffix for the object's URL slug pattern.
@@ 150-165 (lines=16) @@
147
     *
148
     * @return TranslationString|null
149
     */
150
    public function slugSuffix()
151
    {
152
        if (!$this->slugSuffix) {
153
            $metadata = $this->metadata();
154
155
            if (isset($metadata['routable']['suffix'])) {
156
                $affix = $metadata['routable']['suffix'];
157
158
                if (TranslationString::isTranslatable($affix)) {
159
                    $this->slugSuffix = new TranslationString($affix);
160
                }
161
            }
162
        }
163
164
        return $this->slugSuffix;
165
    }
166
167
    /**
168
     * Determine if the slug is editable.