Danny van Kooten
c28df65f42
adhere to (mostly) PSR12, check codestyle in CI
2025-01-11 20:21:41 +01:00
Petter
5159909a81
Update AltoRouter.php
...
fix for php 8.4 and keep php 7.3 support
2024-12-16 14:13:20 +01:00
Petter
71389237e5
Update AltoRouter.php for php 8.4
...
Fix for php8.4
AltoRouter::map(): Implicitly marking parameter $name as nullable is deprecated.
AltoRouter::match(): Implicitly marking parameter $requestUrl as nullable is deprecated.
AltoRouter::match(): Implicitly marking parameter $requestMethod as nullable is deprecated.
2024-12-16 10:00:57 +01:00
Danny van Kooten
4270bb5ca2
bump php version requirement to 7.0 and add types on all methods
2023-10-09 20:54:04 +02:00
Danny van Kooten
77a2e14681
fix phpcs issues
2023-10-09 20:49:37 +02:00
Ali Akbar Azizi
4efac02fad
Update AltoRouter.php
...
Check $request is empty string or not
2020-02-22 15:57:56 +03:30
Danny van Kooten
127f6e9699
fix #241
2019-11-23 12:01:41 +01:00
Danny van Kooten
7e2b48db00
type-hint array in constructor parameter too
2019-11-10 20:33:12 +01:00
Félix Dorn
2360f527b0
add type hinting, removed array long syntax
2019-07-03 21:40:17 +02:00
Danny van Kooten
9bdfc55eb3
fix tests by making compileRoute protected instead
2019-02-07 09:16:13 +01:00
Danny van Kooten
281c5631db
add license to main php file too
2018-08-19 11:47:59 +02:00
Koen Punt
72dd5199bd
multi optional
2017-04-02 20:41:58 +02:00
Koen Punt
be64536dcb
prevent strip of preceding slash at base
2017-04-02 20:41:10 +02:00
Koen Punt
693752b77a
simplify loop for non-param substring ( #131 )
...
optimize comparison using strcmp functions
2016-06-21 23:27:25 +02:00
Danny van Kooten
6fe6f4b196
Use stripos
to compare request method, instead of explode
+ in_array
.
2015-11-03 08:13:51 +07:00
Danny van Kooten
97b2ba7daf
Add PHPDocs for class properties.
2015-11-03 07:37:53 +07:00
Danny van Kooten
c3f7a669a8
Add @throws
declaration to method that can throw an Exception.
2015-11-03 07:37:36 +07:00
Danny van Kooten
c9ce952af1
Remove unused alteration of $_REQUEST
superglobal. Closes #104
2015-11-03 07:37:04 +07:00
Sebastian Pöll
40adf80fd2
Update AltoRouter.php
2014-12-19 16:20:11 +01:00
Sebastian Pöll
3de8ea70d5
Update AltoRouter.php
...
Added @return to getRoutes. Removed unnecessary whitespaces.
2014-12-19 16:13:03 +01:00
Sebastian Pöll
009f163c3d
Update AltoRouter.php
...
Added function getRoutes(). Often it's nice to process routes or display them without extending AltoRouter.
2014-12-19 15:26:51 +01:00
Koen Punt
99f75c28e6
escape dash to fix tests
2014-05-10 14:56:15 +02:00
Koen Punt
55da8fcbda
Add PATCH to comment as valid method.
...
In frameworks like Rails the PATCH method is preferred over PUT. More on this: http://weblog.rubyonrails.org/2012/2/25/edge-rails-patch-is-the-new-primary-http-method-for-updates/
2014-05-07 13:39:15 +02:00
Danny van Kooten
09d9d946c5
Merge pull request #69 from koenpunt/unicode-regex
...
Add support for unicode regular expressions
2014-04-16 11:44:40 +02:00
Koen Punt
b29440e117
Allow instance of iterator in addRoutes
2014-04-16 11:39:57 +02:00
Koen Punt
dbe416b9b9
Add addRoutes method for bulk adding routes
2014-04-16 11:17:42 +02:00
Koen Punt
fc6d743e0a
Add support for unicode regular expressions
2014-04-16 11:09:59 +02:00
Koen Punt
7c53090c1e
Use instance methods to set basePath and matchTypes
...
renamed addMatchType to addMatchTypes
2014-01-08 14:39:18 +01:00
Oskar Adin
8a19056553
Added method for setting new and modifying existing named match types.
...
It's also possible to set these from the constructor.
$router->generate() is now possible with custom regex matches.
2014-01-08 12:28:13 +01:00
sergey-nagaytsev
93e4e4f07e
CHG: no Hungarian notation, $arRoute -> $routes
2014-01-07 13:15:53 +03:00
sergey-nagaytsev
62e1d6fa75
ADD: AltoRouter::__construct
...
Can create in one call from config
2014-01-05 16:08:34 +03:00
Danny van Kooten
01258d15ef
Stripping basePath from route url, only adding it when appropriate. Fixes #38 and #20 .
...
Fixes #38 and #20 .
2013-11-08 15:58:39 +01:00
Koen Punt
4d0f9afa24
fix tests by treating . as part separator (Thank you @joegreen88, closing #26 )
2013-10-07 18:06:32 +02:00
Danny van Kooten
f8a92a9695
Merge pull request #20 from Adduc/patch-7
...
Don't add base path when route is '*' , fixes #18 . Thank you @Adduc !
2013-09-12 12:04:58 -07:00
Koen Punt
77dba7b120
Fixed issue with optional params
...
added tests
2013-07-14 23:36:51 +02:00
John Long
750864290f
Don't add base path when route is '*'
2013-05-23 00:07:59 -05:00
niahoo
8724fc28cb
bugifx stripping the query string
2013-03-26 19:38:53 +01:00
Danny van Kooten
b2794396d2
fixes #4
2013-03-19 11:35:50 +07:00
Danny van Kooten
533c426c6b
Removal of strstr usage, for older PHP versions.
2013-03-19 11:31:26 +07:00
Danny van Kooten
be3d35f937
Merge branch 'master' of https://github.com/dannyvankooten/AltoRouter
2013-03-19 11:29:26 +07:00
Danny van Kooten
b9c79f1d0d
fix for older PHP versions
2013-03-19 11:29:19 +07:00
Danny van Kooten
1fb2f87a57
Merge pull request #3 from koenpunt/fix-indentation
...
fixed indentation on comment blocks
2013-03-18 21:26:35 -07:00
niahoo
fe4d390f0c
added composer.json and newlines in end of files
2013-03-06 11:09:46 +01:00
Koen Punt
5328b4d73f
fixed indentation on comment blocks (they need 1 space to be nicely aligned)
2012-09-07 21:40:41 +02:00
Koen Punt
65933f5a4d
Fixed indentation, all tabs now
2012-09-07 20:38:52 +02:00
dansmith
2125019ed3
Fixed generate() replacing leaving [s, made empty optional parameters blank
2012-08-16 11:56:13 +01:00
Danny van Kooten
4d8dedb9f5
Updated readme, added more inline documentation.
2012-08-01 11:05:42 +02:00
Danny van Kooten
c22b42912a
Changed the way routes are named (last parameter of map method is no longer an array). Also AltoRouter is now throwing an Exception when you're trying to map two routes with the same name.
2012-08-01 10:57:44 +02:00
Danny van Kooten
ebbfe7804a
first commit
2012-07-31 20:50:36 +02:00