MultipleRoutesException::multipleRoutesFound()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
/**
3
 * This file is part of the Drest package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @author Lee Davis
9
 * @copyright Copyright (c) Lee Davis <@leedavis81>
10
 * @link https://github.com/leedavis81/drest/blob/master/LICENSE
11
 * @license http://opensource.org/licenses/MIT The MIT X License (MIT)
12
 */
13
namespace Drest\Route;
14
15
class MultipleRoutesException extends \Exception
16
{
17
    public static function multipleRoutesFound($routes)
18
    {
19
        $helperText = '';
20
        foreach ($routes as $route) {
21
            /* @var \Drest\Mapping\RouteMetaData $route */
22
            $helperText .= '"' . $route->getName() . '"';
23
        }
24
25
        return new self('Multiple routes have matched to this request. See route definitions for: ' . $helperText);
26
    }
27
}
28