Skip to content
This repository was archived by the owner on Oct 20, 2025. It is now read-only.

Commit 88c27cf

Browse files
authored
Merge pull request #47 from PhpSlides/dev
From Dev - updated to v1.4.3
2 parents a9484a3 + 1bdf0e7 commit 88c27cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2028
-1353
lines changed

Router/Interface/MapInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace PhpSlides\Interface;
3+
namespace PhpSlides\Router\Interface;
44

55
/**
66
* undocumented class

Router/Interface/RouteInterface.php

Lines changed: 22 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace PhpSlides\Interface;
3+
namespace PhpSlides\Router\Interface;
44

55
use Closure;
66

@@ -24,31 +24,6 @@
2424
*/
2525
interface RouteInterface
2626
{
27-
/**
28-
* ------------------------------------------------------
29-
* |
30-
* Get the file extension content-type with mime
31-
*
32-
* @param string $filename File path or file resources
33-
* @return bool|string Returns the MIME content type for a file as determined by using information from the magic.mime file.
34-
* |
35-
* ------------------------------------------------------
36-
*/
37-
public static function file_type(string $filename): bool|string;
38-
39-
/**
40-
* ---------------------------------------------------------------------------------------------------------
41-
*
42-
* This function handles getting files request and describe the type of request to handle according to `phpslides.config.json` file in the root of the project,
43-
* for more security, it disallow users in navigating to wrong paths or files of the project.
44-
*
45-
*
46-
* This config method must be called before writing any other Route method or codes.
47-
*
48-
* ---------------------------------------------------------------------------------------------------------
49-
*/
50-
public static function config(): void;
51-
5227
/**
5328
* ------------------------------------------------------------------------
5429
*
@@ -64,10 +39,10 @@ public static function config(): void;
6439
*
6540
* ------------------------------------------------------------------------
6641
*/
67-
public static function any(
68-
array|string $route,
69-
mixed $callback,
70-
string $method = '*'
42+
public static function any (
43+
array|string $route,
44+
mixed $callback,
45+
string $method = '*',
7146
): self;
7247

7348
/**
@@ -78,23 +53,23 @@ public static function any(
7853
* @param string $method Can also be used as `$route` param if the `$route` param is not specified
7954
* @param string|array $route Route parameter
8055
*/
81-
public static function map(string $method, string|array $route): self;
56+
public static function map (string $method, string|array $route): self;
8257

8358
/**
8459
* name METHOD
8560
* Give a route a name for later use
8661
*
8762
* @param string $name
8863
*/
89-
public function name(string $name): self;
64+
public function name (string $name): self;
9065

9166
/**
9267
* Action method
9368
* In outputting information to the client area
9469
*
9570
* @param mixed $callback
9671
*/
97-
public function action(mixed $callback): self;
72+
public function action (mixed $callback): self;
9873

9974
/**
10075
* Controller method
@@ -111,15 +86,15 @@ public function use(string $controller): self;
11186
*
11287
* @param string $file
11388
*/
114-
public function file(string $file): self;
89+
public function file (string $file): self;
11590

11691
/**
11792
* Applies Authentication Guard to the current route.
11893
*
11994
* @param string ...$guards String parameters of registered guards.
12095
* @return self
12196
*/
122-
public function withGuard(string ...$guards): self;
97+
public function withGuard (string ...$guards): self;
12398

12499
/**
125100
* ---------------------------------------------------------------------------
@@ -136,7 +111,7 @@ public function withGuard(string ...$guards): self;
136111
*
137112
* ---------------------------------------------------------------------------
138113
*/
139-
public static function view(array|string $route, string $view): self;
114+
public static function view (array|string $route, string $view): self;
140115

141116
/**
142117
* --------------------------------------------------------------
@@ -151,10 +126,10 @@ public static function view(array|string $route, string $view): self;
151126
*
152127
* ---------------------------------------------------------------
153128
*/
154-
public static function redirect(
155-
string $route,
156-
string $new_url,
157-
int $code = 302
129+
public static function redirect (
130+
string $route,
131+
string $new_url,
132+
int $code = 302,
158133
): self;
159134

160135
/**
@@ -166,7 +141,7 @@ public static function redirect(
166141
*
167142
* --------------------------------------------------------------
168143
*/
169-
public static function get(array|string $route, $callback): self;
144+
public static function get (array|string $route, $callback): self;
170145

171146
/**
172147
* --------------------------------------------------------------
@@ -177,7 +152,7 @@ public static function get(array|string $route, $callback): self;
177152
*
178153
* --------------------------------------------------------------
179154
*/
180-
public static function post(array|string $route, $callback): self;
155+
public static function post (array|string $route, $callback): self;
181156

182157
/**
183158
* --------------------------------------------------------------
@@ -188,7 +163,7 @@ public static function post(array|string $route, $callback): self;
188163
*
189164
* --------------------------------------------------------------
190165
*/
191-
public static function put(array|string $route, $callback): self;
166+
public static function put (array|string $route, $callback): self;
192167

193168
/**
194169
* --------------------------------------------------------------
@@ -199,7 +174,7 @@ public static function put(array|string $route, $callback): self;
199174
*
200175
* --------------------------------------------------------------
201176
*/
202-
public static function patch(array|string $route, $callback): self;
177+
public static function patch (array|string $route, $callback): self;
203178

204179
/**
205180
* --------------------------------------------------------------
@@ -210,7 +185,7 @@ public static function patch(array|string $route, $callback): self;
210185
*
211186
* --------------------------------------------------------------
212187
*/
213-
public static function delete(array|string $route, $callback): self;
188+
public static function delete (array|string $route, $callback): self;
214189

215-
public function __destruct();
216-
}
190+
public function __destruct ();
191+
}

0 commit comments

Comments
 (0)