Skip to content

Commit 9b75c52

Browse files
authored
Merge pull request #3 from designcise/3.6x
PHP 8.1 update
2 parents 6adee70 + 2dac4e7 commit 9b75c52

14 files changed

+26
-27
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
dist: bionic
2+
13
cache:
24
apt: true
35
directories:
@@ -6,7 +8,7 @@ cache:
68
language: php
79

810
php:
9-
- 8.0.0
11+
- 8.1.0
1012

1113
env:
1214
- XDEBUG_MODE=coverage

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# License
22

3-
### Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com)
3+
### Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Install using composer:
1313
$ composer require designcise/bitframe-fastroute
1414
```
1515

16-
Please note that this package requires PHP 8.0 or newer.
16+
Please note that this package requires PHP 8.1.0 or newer.
1717

1818
## Usage Example
1919

@@ -56,10 +56,6 @@ To run the tests you can use the following commands:
5656
* File issues at https://github.com/designcise/bitframe-fastroute/issues
5757
* Issue patches to https://github.com/designcise/bitframe-fastroute/pulls
5858

59-
## Documentation
60-
61-
Complete documentation for v3 will be available soon.
62-
6359
## License
6460

6561
Please see [License File](LICENSE.md) for licensing information.

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=8.0",
13+
"php": ">=8.1",
14+
"psr/http-message": "^1.0",
1415
"psr/http-server-middleware": "~1.0",
15-
"designcise/bitframe": "^3.5"
16+
"designcise/bitframe": "^3.6"
1617
},
1718
"require-dev": {
1819
"phpunit/phpunit": "^9.5",

src/ControllerFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* BitFrame Framework (https://www.bitframephp.com)
55
*
66
* @author Daniyal Hamid
7-
* @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com)
7+
* @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com)
88
* @license https://bitframephp.com/about/license MIT License
99
*/
1010

src/Exception/BadRouteException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* BitFrame Framework (https://www.bitframephp.com)
55
*
66
* @author Daniyal Hamid
7-
* @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com)
7+
* @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com)
88
* @license https://bitframephp.com/about/license MIT License
99
*/
1010

src/Exception/HttpException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* BitFrame Framework (https://www.bitframephp.com)
55
*
66
* @author Daniyal Hamid
7-
* @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com)
7+
* @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com)
88
* @license https://bitframephp.com/about/license MIT License
99
*/
1010

src/Exception/MethodNotAllowedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* BitFrame Framework (https://www.bitframephp.com)
55
*
66
* @author Daniyal Hamid
7-
* @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com)
7+
* @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com)
88
* @license https://bitframephp.com/about/license MIT License
99
*/
1010

src/Exception/RouteNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* BitFrame Framework (https://www.bitframephp.com)
55
*
66
* @author Daniyal Hamid
7-
* @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com)
7+
* @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com)
88
* @license https://bitframephp.com/about/license MIT License
99
*/
1010

src/RouteCollection.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* BitFrame Framework (https://www.bitframephp.com)
55
*
66
* @author Daniyal Hamid
7-
* @copyright Copyright (c) 2017-2021 Daniyal Hamid (https://designcise.com)
7+
* @copyright Copyright (c) 2017-2022 Daniyal Hamid (https://designcise.com)
88
* @license https://bitframephp.com/about/license MIT License
99
*/
1010

@@ -19,7 +19,7 @@
1919
};
2020

2121
use function strlen;
22-
use function strpos;
22+
use function str_contains;
2323
use function trim;
2424
use function rtrim;
2525
use function is_string;
@@ -68,7 +68,7 @@ class RouteCollection
6868
* @param string $routePath
6969
* @param mixed $handler
7070
*/
71-
public function add(array $methods, string $routePath, $handler): void
71+
public function add(array $methods, string $routePath, mixed $handler): void
7272
{
7373
$routePathTokens = $this->parsePath($routePath);
7474

@@ -89,7 +89,7 @@ public function add(array $methods, string $routePath, $handler): void
8989
*
9090
* @param string $route Route string to parse
9191
*
92-
* @return mixed[][] Array of route data arrays
92+
* @return array[] Array of route data arrays
9393
*/
9494
public function parsePath(string $route): array
9595
{
@@ -197,7 +197,7 @@ public function getAllowedMethods(string $uri): array
197197
*
198198
* @throws BadRouteException
199199
*/
200-
private function addStaticRoute(string $method, string $path, $handler): void
200+
private function addStaticRoute(string $method, string $path, mixed $handler): void
201201
{
202202
if (isset($this->staticRoutes[$method][$path])) {
203203
throw new BadRouteException(sprintf(
@@ -233,7 +233,7 @@ private function addStaticRoute(string $method, string $path, $handler): void
233233
*
234234
* @throws BadRouteException
235235
*/
236-
private function addVariableRoute(string $method, array $pathData, $handler): void
236+
private function addVariableRoute(string $method, array $pathData, mixed $handler): void
237237
{
238238
[$regex, $vars] = self::buildRegexForRoute($pathData);
239239

@@ -256,9 +256,9 @@ private function addVariableRoute(string $method, array $pathData, $handler): vo
256256
private static function regexHasCapturingGroups(string $regex): bool
257257
{
258258
// needs to have at least a ( to contain a capturing group
259-
return strpos($regex, '(') !== false
259+
return str_contains($regex, '(')
260260
// semi-accurate detection for capturing groups
261-
&& (bool) preg_match(
261+
&& preg_match(
262262
'~
263263
(?:
264264
\(\?\(

0 commit comments

Comments
 (0)