Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 1
<?php
2
 
3
/**
4
 * Slim Framework (https://slimframework.com)
5
 *
6
 * @license https://github.com/slimphp/Slim/blob/4.x/LICENSE.md (MIT License)
7
 */
8
 
9
declare(strict_types=1);
10
 
11
namespace Slim\Interfaces;
12
 
13
use InvalidArgumentException;
14
use Psr\Http\Message\UriInterface;
15
use RuntimeException;
16
 
17
interface RouteParserInterface
18
{
19
    /**
20
     * Build the path for a named route excluding the base path
21
     *
22
     * @param string                $routeName   Route name
23
     * @param array<string, string> $data        Named argument replacement data
24
     * @param array<string, string> $queryParams Optional query string parameters
25
     *
26
     * @throws RuntimeException         If named route does not exist
27
     * @throws InvalidArgumentException If required data not provided
28
     */
29
    public function relativeUrlFor(string $routeName, array $data = [], array $queryParams = []): string;
30
 
31
    /**
32
     * Build the path for a named route including the base path
33
     *
34
     * @param string                $routeName   Route name
35
     * @param array<string, string> $data        Named argument replacement data
36
     * @param array<string, string> $queryParams Optional query string parameters
37
     *
38
     * @throws RuntimeException         If named route does not exist
39
     * @throws InvalidArgumentException If required data not provided
40
     */
41
    public function urlFor(string $routeName, array $data = [], array $queryParams = []): string;
42
 
43
    /**
44
     * Get fully qualified URL for named route
45
     *
46
     * @param UriInterface              $uri
47
     * @param string                    $routeName   Route name
48
     * @param array<string, string>     $data        Named argument replacement data
49
     * @param array<string, string>     $queryParams Optional query string parameters
50
     */
51
    public function fullUrlFor(UriInterface $uri, string $routeName, array $data = [], array $queryParams = []): string;
52
}