Skip to content

Commit 7c5cf55

Browse files
committed
Update
1 parent 0cdb941 commit 7c5cf55

13 files changed

+61
-32
lines changed

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
composer.phar
22
/vendor/
3-
4-
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
5-
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
6-
# composer.lock
3+
*.bak.php

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "floatphp/interfaces",
3-
"version" : "1.1.3",
3+
"version" : "1.2.0",
44
"type": "library",
55
"description": "FloatPHP Interfaces Components",
66
"keywords": ["php","micro-framework","framework","PSR","ORM","jakiboy"],

src/Classes/LoggerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author : Jakiboy
44
* @package : FloatPHP
55
* @subpackage : Interfaces Classes Component
6-
* @version : 1.1.0
6+
* @version : 1.2.x
77
* @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected]>
88
* @link : https://floatphp.com
99
* @license : MIT

src/Classes/RouterInterface.php

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author : Jakiboy
44
* @package : FloatPHP
55
* @subpackage : Interfaces Classes Component
6-
* @version : 1.1.0
6+
* @version : 1.2.x
77
* @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected]>
88
* @link : https://floatphp.com
99
* @license : MIT
@@ -16,47 +16,79 @@
1616
interface RouterInterface
1717
{
1818
/**
19+
* Create router from config.
20+
*
1921
* @param array $routes
20-
* @param string $basePath
21-
* @param array $matchTypes
22+
* @param string $base
23+
* @param array $types
2224
*/
23-
function __construct($routes = [], $basePath = '', $matchTypes = []);
25+
function __construct(array $routes = [], string $base = '', array $types = []);
2426

2527
/**
28+
* Retrieves all routes,
29+
* Useful if you want to process or display routes.
30+
*
2631
* @return array
2732
*/
28-
function getRoutes();
33+
function getRoutes() : array;
2934

3035
/**
36+
* Add multiple routes at once from array in the following format,
37+
* [[method, route, controller, name, permission]].
38+
*
3139
* @param array $routes
3240
* @return void
3341
*/
34-
function addRoutes($routes);
42+
function addRoutes(array $routes);
3543

3644
/**
37-
* @param string $basePath
45+
* Set the base path.
46+
*
47+
* @param string $base
3848
* @return void
3949
*/
40-
function setBasePath($basePath);
50+
function setBase(string $base);
4151

4252
/**
43-
* @param array $matchTypes
53+
* Add named match types.
54+
*
55+
* @param array $types
4456
* @return void
4557
*/
46-
function addMatchTypes($matchTypes);
58+
function addTypes(array $types);
4759

4860
/**
49-
* @param string $routeName
61+
* Map route to target (controller),
62+
* (GET|POST|PATCH|PUT|DELETE),
63+
* Custom regex must start with an '@'.
64+
*
65+
* @param string $method
66+
* @param string $route
67+
* @param callable $controller
68+
* @param string $name
69+
* @param mixed $permission
70+
* @return void
71+
* @throws RouterException
72+
*/
73+
function map(string $method, string $route, $controller, ?string $name = null, $permission = null);
74+
75+
/**
76+
* Reversed routing,
77+
* Generate the URL for a named route.
78+
*
79+
* @param string $name
5080
* @param array @params
5181
* @return string
52-
* @throws Exception
82+
* @throws RouterException
5383
*/
54-
function generate($routeName, $params = []);
84+
function generate(string $name, array $params = []) : string;
5585

5686
/**
57-
* @param string $requestUrl
58-
* @param string $requestMethod
59-
* @return array|boolean
87+
* Match given request URL against stored routes.
88+
*
89+
* @param string $url
90+
* @param string $method
91+
* @return mixed
6092
*/
61-
function match($requestUrl = null, $requestMethod = null);
93+
function match(?string $url = null, ?string $method = null);
6294
}

src/Helpers/CacheInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author : Jakiboy
44
* @package : FloatPHP
55
* @subpackage : Interfaces Helpers Component
6-
* @version : 1.1.0
6+
* @version : 1.2.x
77
* @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected]>
88
* @link : https://floatphp.com
99
* @license : MIT

src/Kernel/ApiInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author : Jakiboy
44
* @package : FloatPHP
55
* @subpackage : Interfaces Kernel Component
6-
* @version : 1.1.0
6+
* @version : 1.2.x
77
* @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected]>
88
* @link : https://floatphp.com
99
* @license : MIT

src/Kernel/AuthMiddlewareInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author : Jakiboy
44
* @package : FloatPHP
55
* @subpackage : Interfaces Kernel Component
6-
* @version : 1.1.0
6+
* @version : 1.2.x
77
* @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected]>
88
* @link : https://floatphp.com
99
* @license : MIT

src/Kernel/AuthenticationInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author : Jakiboy
44
* @package : FloatPHP
55
* @subpackage : Interfaces Kernel Component
6-
* @version : 1.1.0
6+
* @version : 1.2.x
77
* @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected]>
88
* @link : https://floatphp.com
99
* @license : MIT

src/Kernel/BackendInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author : Jakiboy
44
* @package : FloatPHP
55
* @subpackage : Interfaces Kernel Component
6-
* @version : 1.1.0
6+
* @version : 1.2.x
77
* @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected]>
88
* @link : https://floatphp.com
99
* @license : MIT

src/Kernel/CallableInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author : Jakiboy
44
* @package : FloatPHP
55
* @subpackage : Interfaces Kernel Component
6-
* @version : 1.1.0
6+
* @version : 1.2.x
77
* @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected]>
88
* @link : https://floatphp.com
99
* @license : MIT

0 commit comments

Comments
 (0)