Skip to content

Commit e4643e7

Browse files
authored
Release/3.2.0 (#32)
1 parent bbebb56 commit e4643e7

29 files changed

+451
-228
lines changed

.gitattributes

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/tests export-ignore
2+
/vendor export-ignore
3+
4+
/LICENSE export-ignore
5+
/Makefile export-ignore
6+
/README.md export-ignore
7+
/phpmd.xml export-ignore
8+
/phpunit.xml export-ignore
9+
/phpstan.neon.dist export-ignore
10+
/infection.json.dist export-ignore
11+
12+
/.github export-ignore
13+
/.gitignore export-ignore
14+
/.gitattributes export-ignore

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
DOCKER_RUN = docker run --rm -it --net=host -v ${PWD}:/app -w /app gustavofreze/php:8.2
22

3-
.PHONY: configure test test-no-coverage review show-reports clean
3+
.PHONY: configure test test-file test-no-coverage review show-reports clean
44

55
configure:
66
@${DOCKER_RUN} composer update --optimize-autoloader
77

8-
test: review
8+
test:
99
@${DOCKER_RUN} composer tests
1010

11-
test-no-coverage: review
11+
test-file:
12+
@${DOCKER_RUN} composer tests-file-no-coverage ${FILE}
13+
14+
test-no-coverage:
1215
@${DOCKER_RUN} composer tests-no-coverage
1316

1417
review:
@@ -19,4 +22,4 @@ show-reports:
1922

2023
clean:
2124
@sudo chown -R ${USER}:${USER} ${PWD}
22-
@rm -rf report vendor
25+
@rm -rf report vendor .phpunit.cache

composer.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
"minimum-stability": "stable",
99
"keywords": [
1010
"psr",
11-
"psr-4",
12-
"psr-7",
13-
"psr-12",
1411
"http",
1512
"http-code",
1613
"tiny-blocks",
@@ -24,6 +21,10 @@
2421
"homepage": "https://github.com/gustavofreze"
2522
}
2623
],
24+
"support": {
25+
"issues": "https://github.com/tiny-blocks/http/issues",
26+
"source": "https://github.com/tiny-blocks/http"
27+
},
2728
"config": {
2829
"sort-packages": true,
2930
"allow-plugins": {
@@ -42,29 +43,32 @@
4243
},
4344
"require": {
4445
"php": "^8.2",
45-
"tiny-blocks/serializer": "^3.0",
46+
"tiny-blocks/serializer": "^3",
4647
"psr/http-message": "^1.1",
4748
"ext-mbstring": "*"
4849
},
4950
"require-dev": {
50-
"infection/infection": "^0.27",
5151
"phpmd/phpmd": "^2.15",
52-
"phpunit/phpunit": "^10.5",
53-
"squizlabs/php_codesniffer": "^3.8"
52+
"phpunit/phpunit": "^11",
53+
"phpstan/phpstan": "^1",
54+
"infection/infection": "^0.29",
55+
"squizlabs/php_codesniffer": "^3.10"
5456
},
5557
"suggest": {
5658
"ext-mbstring": "Provides multibyte-specific string functions that help us deal with multibyte encodings in PHP."
5759
},
5860
"scripts": {
5961
"phpcs": "phpcs --standard=PSR12 --extensions=php ./src",
6062
"phpmd": "phpmd ./src text phpmd.xml --suffixes php --exclude /src/HttpCode.php --exclude /src/Internal/Response --ignore-violations-on-exit",
63+
"phpstan": "phpstan analyse -c phpstan.neon.dist --quiet --no-progress",
6164
"test": "phpunit --log-junit=report/coverage/junit.xml --coverage-xml=report/coverage/coverage-xml --coverage-html=report/coverage/coverage-html tests",
6265
"test-mutation": "infection --only-covered --logger-html=report/coverage/mutation-report.html --coverage=report/coverage --min-msi=100 --min-covered-msi=100 --threads=4",
6366
"test-no-coverage": "phpunit --no-coverage",
6467
"test-mutation-no-coverage": "infection --only-covered --min-msi=100 --threads=4",
6568
"review": [
6669
"@phpcs",
67-
"@phpmd"
70+
"@phpmd",
71+
"@phpstan"
6872
],
6973
"tests": [
7074
"@test",
@@ -73,6 +77,9 @@
7377
"tests-no-coverage": [
7478
"@test-no-coverage",
7579
"@test-mutation-no-coverage"
80+
],
81+
"tests-file-no-coverage": [
82+
"@test-no-coverage"
7683
]
7784
}
7885
}

infection.json.dist

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
{
2-
"$schema": "vendor/infection/infection/resources/schema.json",
3-
"tmpDir": "report/",
4-
"logs": {
5-
"text": "report/logs/infection-text.log",
6-
"summary": "report/logs/infection-summary.log"
7-
},
2+
"timeout": 10,
3+
"testFramework": "phpunit",
4+
"tmpDir": "report/infection/",
85
"source": {
96
"directories": [
107
"src"
118
]
129
},
13-
"timeout": 10,
10+
"logs": {
11+
"text": "report/infection/logs/infection-text.log",
12+
"summary": "report/infection/logs/infection-summary.log"
13+
},
1414
"mutators": {
1515
"@default": true,
16-
"LogicalOr": false,
17-
"InstanceOf_": false,
18-
"UnwrapArrayMap": false,
16+
"CastInt": false,
17+
"CastString": false,
18+
"MatchArmRemoval": false,
1919
"MethodCallRemoval": false
2020
},
21-
"testFramework": "phpunit"
21+
"phpUnit": {
22+
"configDir": "",
23+
"customPath": "./vendor/bin/phpunit"
24+
}
2225
}

phpstan.neon.dist

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
parameters:
2+
paths:
3+
- src
4+
level: 9
5+
tmpDir: report/phpstan
6+
ignoreErrors:
7+
- '#function fread expects#'
8+
- '#expects object, mixed given#'
9+
- '#expects resource, resource#'
10+
- '#value type specified in iterable#'
11+
reportUnmatchedIgnoredErrors: false

phpunit.xml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
4+
colors="true"
35
bootstrap="vendor/autoload.php"
4-
backupGlobals="false"
5-
colors="true" processIsolation="false"
6-
stopOnFailure="false"
7-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
6+
failOnRisky="true"
7+
failOnWarning="true"
88
cacheDirectory=".phpunit.cache"
9-
backupStaticProperties="false">
9+
beStrictAboutOutputDuringTests="true">
1010

11-
<coverage>
12-
<report>
13-
<clover outputFile="report/coverage-clover.xml"/>
14-
<html outputDirectory="report/html/"/>
15-
<text outputFile="report/coverage.txt"/>
16-
</report>
17-
</coverage>
11+
<source>
12+
<include>
13+
<directory>src</directory>
14+
</include>
15+
</source>
1816

1917
<testsuites>
2018
<testsuite name="default">
21-
<directory suffix="Test.php">tests</directory>
19+
<directory>tests</directory>
2220
</testsuite>
2321
</testsuites>
2422

23+
<coverage>
24+
<report>
25+
<text outputFile="report/coverage.txt"/>
26+
<html outputDirectory="report/html/"/>
27+
<clover outputFile="report/coverage-clover.xml"/>
28+
</report>
29+
</coverage>
30+
2531
<logging>
2632
<junit outputFile="report/execution-result.xml"/>
2733
</logging>
2834

29-
<source>
30-
<include>
31-
<directory suffix=".php">src</directory>
32-
</include>
33-
</source>
34-
3535
</phpunit>

src/HttpCode.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace TinyBlocks\Http;
46

57
use BackedEnum;

src/HttpContentType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace TinyBlocks\Http;
46

57
use TinyBlocks\Http\Internal\Header;

src/HttpHeaders.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace TinyBlocks\Http;
46

57
use TinyBlocks\Http\Internal\Header;

src/HttpMethod.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace TinyBlocks\Http;
46

57
/**

0 commit comments

Comments
 (0)