1: <?php
2: /**
3: * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
4: * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
5: *
6: * Licensed under The MIT License
7: * Redistributions of files must retain the above copyright notice.
8: *
9: * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
10: * @since 3.3.1
11: * @license https://opensource.org/licenses/mit-license.php MIT License
12: */
13: namespace Cake\Routing\Exception;
14:
15: use Cake\Core\Exception\Exception;
16:
17: /**
18: * Exception raised when a route names used twice.
19: */
20: class DuplicateNamedRouteException extends Exception
21: {
22: /**
23: * {@inheritDoc}
24: */
25: protected $_messageTemplate = 'A route named "%s" has already been connected to "%s".';
26:
27: /**
28: * {@inheritDoc}
29: */
30: public function __construct($message, $code = 404, $previous = null)
31: {
32: if (is_array($message) && isset($message['message'])) {
33: $this->_messageTemplate = $message['message'];
34: }
35: parent::__construct($message, $code, $previous);
36: }
37: }
38: