Skip to content

Commit 55528eb

Browse files
samizdamn.gnato
andauthored
Http message dep (#5)
* Use http-message 1 * Configure local test coverage * Add phpstan * Fix phpunit config ingore * Remove unsupported attributes * Remove cs fixer var * Revert "Remove cs fixer var" This reverts commit 4531ca9. * Up changelog * v0.0.4 --------- Co-authored-by: n.gnato <[email protected]>
1 parent 373f3d8 commit 55528eb

File tree

7 files changed

+61
-27
lines changed

7 files changed

+61
-27
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,6 @@ jobs:
5959
env:
6060
PHP_CS_FIXER_IGNORE_ENV: true
6161
run: vendor/bin/php-cs-fixer fix --dry-run
62+
63+
- name: Static analyze
64+
run: vendor/bin/phpstan

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
.php-cs-fixer.cache
1212

1313
# PHPUnit
14+
.phpunit.cache/
1415
.phpunit.result.cache
1516
phpunit.xml
1617
tests/_coverage

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.4] - 2025-06-22
11+
12+
### Changed
13+
- Allow psr/http-messages v1 usage
14+
15+
### Internal
16+
- Use phpstan, configure test coverage
17+
1018
## [0.0.3] - 2025-06-22
1119

1220
### Removed
@@ -32,7 +40,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3240
### Added
3341
- Router, RequestHandlerFactory and FastRoute backed implementation of basics
3442

35-
[Unreleased]: https://github.com/FreeElephants/psr-router/compare/0.0.3...HEAD
43+
[Unreleased]: https://github.com/FreeElephants/psr-router/compare/0.0.4...HEAD
44+
[0.0.4]: https://github.com/FreeElephants/psr-router/releases/tag/0.0.4
3645
[0.0.3]: https://github.com/FreeElephants/psr-router/releases/tag/0.0.3
3746
[0.0.2]: https://github.com/FreeElephants/psr-router/releases/tag/0.0.2
3847
[0.0.1]: https://github.com/FreeElephants/psr-router/releases/tag/0.0.1

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
1414

1515
# Composer requirements end
1616

17+
# Xdebug extention and configuration
18+
RUN pecl channel-update pecl.php.net \
19+
&& pecl install xdebug \
20+
&& docker-php-ext-enable xdebug
21+
22+
RUN echo "xdebug.mode=coverage\n" \
23+
>> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
24+
25+
1726
# Prepare image filesystem begin
1827
WORKDIR /var/www
1928
# Prepare image filesystem end

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"require-dev": {
1313
"free-elephants/php-cs-fixer-ruleset": "^1.0.1",
1414
"nyholm/psr7": "^1.8",
15+
"phpstan/phpstan": "^2.1",
1516
"phpunit/phpunit": "^9|^10|^11|^12.1"
1617
},
1718
"autoload": {
@@ -27,7 +28,7 @@
2728
"require": {
2829
"nikic/fast-route": "^1.3",
2930
"psr/container": "^2.0",
30-
"psr/http-message": "^2.0",
31+
"psr/http-message": "^1.0|^2.0",
3132
"psr/http-server-handler": "^1.0"
3233
},
3334
"suggest": {

phpstan.neon.dist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
level: 5
3+
paths:
4+
- src/
5+
- tests/

phpunit.xml.dist

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
bootstrap="vendor/autoload.php"
5-
backupGlobals="false"
6-
processIsolation="false"
7-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
8-
>
9-
<testsuites>
10-
<testsuite name="unit">
11-
<directory>tests</directory>
12-
</testsuite>
13-
</testsuites>
14-
15-
<coverage processUncoveredFiles="true">
16-
<include>
17-
<directory suffix=".php">src/</directory>
18-
</include>
19-
<!--
20-
<report>
21-
<html outputDirectory="tests/_coverage" lowUpperBound="35" highLowerBound="70"/>
22-
</report>
23-
-->
24-
</coverage>
25-
</phpunit>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
cacheDirectory=".phpunit.cache"
6+
executionOrder="depends,defects"
7+
requireCoverageMetadata="false"
8+
beStrictAboutCoverageMetadata="true"
9+
beStrictAboutOutputDuringTests="true"
10+
displayDetailsOnPhpunitDeprecations="true"
11+
failOnPhpunitDeprecation="true"
12+
failOnRisky="true"
13+
failOnWarning="true">
14+
<testsuites>
15+
<testsuite name="default">
16+
<directory>tests</directory>
17+
</testsuite>
18+
</testsuites>
19+
20+
<source restrictNotices="true" restrictWarnings="true">
21+
<include>
22+
<directory>src</directory>
23+
</include>
24+
</source>
25+
26+
<!-- <coverage>-->
27+
<!-- <report>-->
28+
<!-- <html outputDirectory="tests/_coverage" lowUpperBound="35" highLowerBound="70"/>-->
29+
<!-- </report>-->
30+
<!-- </coverage>-->
31+
</phpunit>

0 commit comments

Comments
 (0)