Skip to content

Commit 373f3d8

Browse files
samizdamn.gnato
andauthored
Dependencies and dev env (#4)
* Remove di as required * Add author * Add lib type * Add cs fixer * Configure php-cs-fixer * cs fix * Try set PHP_CS_FIXER_IGNORE_ENV * run cs on lowest version * try change cs fixer version * Up dep * Up dep * v0.0.3 --------- Co-authored-by: n.gnato <[email protected]>
1 parent ffbc510 commit 373f3d8

16 files changed

+69
-36
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,8 @@ jobs:
5454
env:
5555
XDEBUG_MODE: coverage
5656
run: vendor/bin/phpunit
57+
58+
- name: Code style
59+
env:
60+
PHP_CS_FIXER_IGNORE_ENV: true
61+
run: vendor/bin/php-cs-fixer fix --dry-run

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
# Local
88
.env
99

10+
# PHP-CS
11+
.php-cs-fixer.cache
12+
1013
# PHPUnit
1114
.phpunit.result.cache
1215
phpunit.xml

.php-cs-fixer.dist.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
$finder = PhpCsFixer\Finder::create()
5+
->in([
6+
'./src/',
7+
'./tests/',
8+
]);
9+
10+
return \FreeElephants\PhpCsFixer\build_config($finder);

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.0.3] - 2025-06-22
11+
12+
### Removed
13+
- Not required dependencies move to suggested and replaced with psr interfaces
14+
15+
### Internal
16+
- Use php-cs-fixer
17+
1018
## [0.0.2] - 2025-06-17
1119

1220
### Added
@@ -24,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2432
### Added
2533
- Router, RequestHandlerFactory and FastRoute backed implementation of basics
2634

27-
[Unreleased]: https://github.com/FreeElephants/psr-router/compare/0.0.2...HEAD
35+
[Unreleased]: https://github.com/FreeElephants/psr-router/compare/0.0.3...HEAD
36+
[0.0.3]: https://github.com/FreeElephants/psr-router/releases/tag/0.0.3
2837
[0.0.2]: https://github.com/FreeElephants/psr-router/releases/tag/0.0.2
2938
[0.0.1]: https://github.com/FreeElephants/psr-router/releases/tag/0.0.1

composer.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22
"name": "free-elephants/psr-router",
33
"description": "Framework Agnostic PSR Router",
44
"license": "BSD-2-Clause",
5-
"authors": [],
5+
"authors": [
6+
{
7+
"email": "[email protected]",
8+
"name": "samizdam"
9+
}
10+
],
11+
"type": "library",
612
"require-dev": {
13+
"free-elephants/php-cs-fixer-ruleset": "^1.0.1",
714
"nyholm/psr7": "^1.8",
815
"phpunit/phpunit": "^9|^10|^11|^12.1"
916
},
@@ -18,11 +25,14 @@
1825
}
1926
},
2027
"require": {
21-
"free-elephants/di": "^4.1",
2228
"nikic/fast-route": "^1.3",
29+
"psr/container": "^2.0",
2330
"psr/http-message": "^2.0",
2431
"psr/http-server-handler": "^1.0"
2532
},
33+
"suggest": {
34+
"free-elephants/di": "*"
35+
},
2636
"config": {
2737
"sort-packages": true
2838
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace FreeElephants\PsrRouter\Exception;
56

6-
interface ExceptionInterface
7-
{
8-
9-
}
7+
interface ExceptionInterface {}

src/FreeElephants/PsrRouter/Exception/MethodNotAllowed.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace FreeElephants\PsrRouter\Exception;
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace FreeElephants\PsrRouter\Exception;
56

6-
class NotFound extends \RuntimeException implements ExceptionInterface
7-
{
8-
9-
}
7+
class NotFound extends \RuntimeException implements ExceptionInterface {}

src/FreeElephants/PsrRouter/FastRoute/DispatcherBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace FreeElephants\PsrRouter\FastRoute;
@@ -17,9 +18,8 @@ class DispatcherBuilder
1718
private OptionsHandlerInterface $optionsHandlerPrototype;
1819

1920
public function __construct(
20-
PathNormalizerInterface $pathNormalizer = null
21-
)
22-
{
21+
?PathNormalizerInterface $pathNormalizer = null
22+
) {
2323
$this->pathNormalizer = $pathNormalizer ?? new Dummy();
2424
}
2525

src/FreeElephants/PsrRouter/HandlerAndRequestWithArgsContainer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ class HandlerAndRequestWithArgsContainer
1313
public function __construct(
1414
ServerRequestInterface $request,
1515
RequestHandlerInterface $handler
16-
)
17-
{
18-
16+
) {
1917
$this->request = $request;
2018
$this->handler = $handler;
2119
}

0 commit comments

Comments
 (0)