Skip to content

Commit 854d9e2

Browse files
authored
Minimal PHP version is 7.4 (#12)
1 parent 88b711e commit 854d9e2

10 files changed

+32
-40
lines changed

.github/workflows/main.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
JBZOO_COMPOSER_UPDATE_FLAGS: ${{ matrix.composer_flags }}
3636
strategy:
3737
matrix:
38-
php-version: [ 7.2, 7.3, 7.4, 8.0 ]
38+
php-version: [ 7.4, 8.0, 8.1 ]
3939
composer_flags: [ "--prefer-lowest", "" ]
4040
steps:
4141
- name: Checkout code
@@ -59,7 +59,7 @@ jobs:
5959
- name: Uploading coverage to coveralls
6060
env:
6161
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62-
run: make report-coveralls --no-print-directory
62+
run: make report-coveralls --no-print-directory || true
6363

6464
- name: Upload Artifacts
6565
uses: actions/upload-artifact@v2
@@ -74,7 +74,7 @@ jobs:
7474
runs-on: ubuntu-latest
7575
strategy:
7676
matrix:
77-
php-version: [ 7.2, 7.3, 7.4, 8.0 ]
77+
php-version: [ 7.4, 8.0, 8.1 ]
7878
steps:
7979
- name: Checkout code
8080
uses: actions/checkout@v2
@@ -86,6 +86,7 @@ jobs:
8686
with:
8787
php-version: ${{ matrix.php-version }}
8888
tools: composer
89+
extensions: ast
8990

9091
- name: Build the Project
9192
run: make update --no-print-directory
@@ -106,7 +107,7 @@ jobs:
106107
runs-on: ubuntu-latest
107108
strategy:
108109
matrix:
109-
php-version: [ 7.2, 7.3, 7.4, 8.0 ]
110+
php-version: [ 7.4, 8.0, 8.1 ]
110111
steps:
111112
- name: Checkout code
112113
uses: actions/checkout@v2

composer.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
}
1515
],
1616
"require" : {
17-
"php" : ">=7.2",
17+
"php" : ">=7.4",
1818
"ext-json" : "*",
1919

20-
"jbzoo/data" : "^4.3.0",
21-
"jbzoo/utils" : "^4.5.0",
22-
"guzzlehttp/promises" : ">=1.4.0"
20+
"jbzoo/data" : "^4.3|^5.0",
21+
"jbzoo/utils" : "^4.5|^5.0",
22+
"guzzlehttp/promises" : "^1.4.0"
2323
},
2424

2525
"require-dev" : {
26-
"jbzoo/toolbox-dev" : "^3.1.0",
27-
"jbzoo/event" : "^3.2.0",
26+
"jbzoo/toolbox-dev" : "^3.1|^4.0.1",
27+
"jbzoo/event" : "^3.2|^4.0.0",
2828
"rmccue/requests" : "^1.7.0",
2929
"guzzlehttp/guzzle" : ">=6.5.5"
3030
},

phpunit.xml.dist

+15-13
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
@copyright Copyright (C) JBZoo.com, All rights reserved.
1212
@link https://github.com/JBZoo/Http-Client
1313
-->
14-
<phpunit bootstrap="tests/autoload.php"
14+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
15+
bootstrap="tests/autoload.php"
1516
convertErrorsToExceptions="true"
1617
convertNoticesToExceptions="true"
1718
convertWarningsToExceptions="true"
@@ -23,25 +24,26 @@
2324
stopOnIncomplete="false"
2425
stopOnSkipped="false"
2526
stopOnRisky="false"
27+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
2628
>
29+
<coverage processUncoveredFiles="true">
30+
<include>
31+
<directory suffix=".php">src</directory>
32+
</include>
33+
<report>
34+
<clover outputFile="build/coverage_xml/main.xml"/>
35+
<php outputFile="build/coverage_cov/main.cov"/>
36+
<text outputFile="php://stdout" showUncoveredFiles="false" showOnlySummary="true"/>
37+
</report>
38+
</coverage>
39+
2740
<testsuites>
2841
<testsuite name="PHPUnit">
2942
<directory suffix="Test.php">tests</directory>
3043
</testsuite>
3144
</testsuites>
3245

33-
<filter>
34-
<whitelist processUncoveredFilesFromWhitelist="true">
35-
<directory suffix=".php">src</directory>
36-
</whitelist>
37-
</filter>
38-
3946
<logging>
40-
<log type="coverage-html" target="build/coverage_html" lowUpperBound="75" highLowerBound="95"/>
41-
<log type="coverage-clover" target="build/coverage_xml/main.xml"/>
42-
<log type="coverage-php" target="build/coverage_cov/main.cov"/>
43-
<log type="junit" target="build/coverage_junit/main.xml"/>
44-
<log type="coverage-text" target="php://stdout" showUncoveredFiles="false" showOnlySummary="true"/>
47+
<junit outputFile="build/coverage_junit/main.xml"/>
4548
</logging>
46-
4749
</phpunit>

tests/AbstractDriverTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ abstract class AbstractDriverTest extends PHPUnit
3232
/**
3333
* @var string
3434
*/
35-
protected $driver = 'Auto';
35+
protected string $driver = 'Auto';
3636

3737
/**
3838
* @var array
3939
*/
40-
protected $methods = ['GET', 'POST', 'PATCH', 'PUT', 'DELETE'];
40+
protected array $methods = ['GET', 'POST', 'PATCH', 'PUT', 'DELETE'];
4141

4242
/**
4343
* @param array $options

tests/DriverGuzzleTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
*/
2424
final class DriverGuzzleTest extends AbstractDriverTest
2525
{
26-
protected $driver = 'Guzzle';
26+
protected string $driver = 'Guzzle';
2727
}

tests/DriverRmccueTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
*/
2424
final class DriverRmccueTest extends AbstractDriverTest
2525
{
26-
protected $driver = 'Rmccue';
26+
protected string $driver = 'Rmccue';
2727
}

tests/HttpClientComposerTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@
2424
*/
2525
final class HttpClientComposerTest extends AbstractComposerTest
2626
{
27-
2827
}

tests/HttpClientCopyrightTest.php

-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
*/
2525
final class HttpClientCopyrightTest extends AbstractCopyrightTest
2626
{
27-
/**
28-
* @var string
29-
*/
3027
protected $packageName = 'Http-Client';
3128
protected $isPhpStrictType = true;
3229
}

tests/HttpClientOtherTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*/
3030
final class HttpClientOtherTest extends PHPUnit
3131
{
32-
protected $jsonFixture = '{"key-1":"value-1","key-2":"value-2"}';
32+
protected string $jsonFixture = '{"key-1":"value-1","key-2":"value-2"}';
3333

3434
public function testGetSameJSONFromResponse()
3535
{

tests/HttpClientReadmeTest.php

+1-8
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,5 @@
2424
*/
2525
final class HttpClientReadmeTest extends AbstractReadmeTest
2626
{
27-
protected $packageName = 'Http-Client';
28-
29-
protected function setUp(): void
30-
{
31-
parent::setUp();
32-
$this->params['strict_types'] = true;
33-
$this->params['travis'] = false;
34-
}
27+
protected string $packageName = 'Http-Client';
3528
}

0 commit comments

Comments
 (0)