Skip to content

Commit 8028842

Browse files
committed
Updated dev dependencies and minimal php version
- refactored code to new code style rules - added language constructs allowed by php 7.4: - strict types directive, - covariant return types, - property type declarations - null coalescing operators
2 parents 840c304 + d0b46cb commit 8028842

37 files changed

+371
-329
lines changed

composer.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
"minimum-stability": "dev",
66
"prefer-stable": true,
77
"require": {
8-
"php": "^7.1",
8+
"php": "^7.4",
99
"ext-json": "*",
1010
"psr/http-message": "^1.0",
1111
"psr/http-factory": "^1.0"
1212
},
1313
"require-dev": {
14-
"polymorphine/cs": "1.0",
15-
"phpunit/phpunit": "^7.0",
16-
"php-coveralls/php-coveralls": "^2.0"
14+
"polymorphine/dev": "0.1.*"
1715
},
1816
"license": "MIT",
1917
"authors": [
@@ -31,8 +29,5 @@
3129
"psr-4": {
3230
"Polymorphine\\Message\\Tests\\": "tests/"
3331
}
34-
},
35-
"scripts": {
36-
"style-check": "polymorphine-cs"
3732
}
3833
}

cs-fixer.php.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
22

3-
use Polymorphine\CodeStandards\FixerFactory;
3+
use Polymorphine\Dev\FixerFactory;
44

55
return FixerFactory::createFor('Polymorphine/Message', __DIR__);

phpunit.xml.dist

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<phpunit
43
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.0/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
5+
cacheResultFile="temp/.phpunit.result.cache"
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
99
<php>
1010
<ini name="error_reporting" value="-1" />
1111
</php>
12-
1312
<testsuites>
14-
<testsuite name="Polymorphine Psr-7 Message tests">
13+
<testsuite name="Polymorphine/Message tests">
1514
<directory>./tests/</directory>
1615
</testsuite>
1716
</testsuites>
18-
19-
<filter>
20-
<whitelist>
17+
<coverage>
18+
<include>
2119
<directory>./src/</directory>
22-
</whitelist>
23-
</filter>
24-
<logging>
25-
<log type="coverage-clover" target="build/logs/clover.xml"/>
26-
<log type="coverage-text" target="php://stdout" showOnlySummary="true"/>
27-
</logging>
20+
</include>
21+
</coverage>
2822
</phpunit>

src/Exception/StreamResourceCallException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33
/*
44
* This file is part of Polymorphine/Message package.

src/Factory/RequestFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33
/*
44
* This file is part of Polymorphine/Message package.

src/Factory/ResponseFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33
/*
44
* This file is part of Polymorphine/Message package.

src/Factory/ServerRequestFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33
/*
44
* This file is part of Polymorphine/Message package.

src/Factory/StreamFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33
/*
44
* This file is part of Polymorphine/Message package.

src/Factory/UploadedFileFactory.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33
/*
44
* This file is part of Polymorphine/Message package.
@@ -20,8 +20,13 @@
2020

2121
class UploadedFileFactory implements UploadedFileFactoryInterface
2222
{
23-
private $serverAPI;
23+
private string $serverAPI;
2424

25+
/**
26+
* @see php_sapi_name()
27+
*
28+
* @param string $serverAPI interface type used by PHP
29+
*/
2530
public function __construct(string $serverAPI = 'server')
2631
{
2732
$this->serverAPI = $serverAPI;

src/Factory/UriFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33
/*
44
* This file is part of Polymorphine/Message package.

0 commit comments

Comments
 (0)