Code Duplication    Length = 17-17 lines in 3 locations

src/Bundle/ResourceBundle/Routing/ParameterResolver.php 3 locations

@@ 146-162 (lines=17) @@
143
    /**
144
     * {@inheritdoc}
145
     */
146
    public function resolveLocationRoute()
147
    {
148
        if (($request = $this->resolveRequest()) === null) {
149
            throw new RequestNotFoundException();
150
        }
151
152
        $locationRoute = $this->resolveParameter('location_route');
153
154
        if (empty($locationRoute)) {
155
            throw new RuntimeException(sprintf(
156
                'The location route could not be found for the route "%s".',
157
                $request->attributes->get('_route')
158
            ));
159
        }
160
161
        return $locationRoute;
162
    }
163
164
    /**
165
     * {@inheritdoc}
@@ 183-199 (lines=17) @@
180
    /**
181
     * {@inheritdoc}
182
     */
183
    public function resolveRedirectRoute()
184
    {
185
        if (($request = $this->resolveRequest()) === null) {
186
            throw new RequestNotFoundException();
187
        }
188
189
        $redirectRoute = $this->resolveParameter('redirect_route');
190
191
        if (empty($redirectRoute)) {
192
            throw new RuntimeException(sprintf(
193
                'The redirect route could not be found for the route "%s".',
194
                $request->attributes->get('_route')
195
            ));
196
        }
197
198
        return $redirectRoute;
199
    }
200
201
    /**
202
     * {@inheritdoc}
@@ 258-274 (lines=17) @@
255
    /**
256
     * {@inheritdoc}
257
     */
258
    public function resolveTemplate()
259
    {
260
        if (($request = $this->resolveRequest()) === null) {
261
            throw new RequestNotFoundException();
262
        }
263
264
        $template = $this->resolveParameter('template');
265
266
        if (empty($template)) {
267
            throw new RuntimeException(sprintf(
268
                'The template could not be found for the route "%s".',
269
                $request->attributes->get('_route')
270
            ));
271
        }
272
273
        return $template;
274
    }
275
276
    /**
277
     * {@inheritdoc}