5
5
use Hyde \Framework \Contracts \PageContract ;
6
6
use Illuminate \Support \Collection ;
7
7
8
+ /**
9
+ * This contract defines the static facade methods for the Route class.
10
+ *
11
+ * @see \Hyde\Framework\Modules\Routing\RouteContract for the interface that each route model must implement.
12
+ */
8
13
interface RouteFacadeContract
9
14
{
10
15
/**
@@ -13,33 +18,41 @@ interface RouteFacadeContract
13
18
* Alias for static::getFromKey().
14
19
*
15
20
* @param string $routeKey Example: posts/foo.md
16
- * @return \Hyde\Framework\Modules\Routing\RouteContract|null
21
+ * @return \Hyde\Framework\Modules\Routing\RouteContract
22
+ *
23
+ * @throws \Hyde\Framework\Modules\Routing\RouteNotFoundException
17
24
*/
18
- public static function get (string $ routeKey ): ? RouteContract ;
25
+ public static function get (string $ routeKey ): RouteContract ;
19
26
20
27
/**
21
28
* Get a route from the Router index for the specified route key.
22
29
*
23
30
* @param string $routeKey Example: posts/foo.md
24
- * @return \Hyde\Framework\Modules\Routing\RouteContract|null
31
+ * @return \Hyde\Framework\Modules\Routing\RouteContract
32
+ *
33
+ * @throws \Hyde\Framework\Modules\Routing\RouteNotFoundException
25
34
*/
26
- public static function getFromKey (string $ routeKey ): ? RouteContract ;
35
+ public static function getFromKey (string $ routeKey ): RouteContract ;
27
36
28
37
/**
29
38
* Get a route from the Router index for the specified source file path.
30
39
*
31
40
* @param string $sourceFilePath Example: _posts/foo.md
32
- * @return \Hyde\Framework\Modules\Routing\RouteContract|null
41
+ * @return \Hyde\Framework\Modules\Routing\RouteContract
42
+ *
43
+ * @throws \Hyde\Framework\Modules\Routing\RouteNotFoundException
33
44
*/
34
- public static function getFromSource (string $ sourceFilePath ): ? RouteContract ;
45
+ public static function getFromSource (string $ sourceFilePath ): RouteContract ;
35
46
36
47
/**
37
48
* Get a route from the Router index for the supplied page model.
38
49
*
39
50
* @param \Hyde\Framework\Contracts\PageContract $page
40
- * @return \Hyde\Framework\Modules\Routing\RouteContract|null
51
+ * @return \Hyde\Framework\Modules\Routing\RouteContract
52
+ *
53
+ * @throws \Hyde\Framework\Modules\Routing\RouteNotFoundException
41
54
*/
42
- public static function getFromModel (PageContract $ page ): ? RouteContract ;
55
+ public static function getFromModel (PageContract $ page ): RouteContract ;
43
56
44
57
/**
45
58
* Get all routes from the Router index.
0 commit comments