Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 6d4f049

Browse files
authored
Upgrade minimum of PHPUnit version up to 7.0 (#25)
* Upgrade PhpUnit to 7.0 * Fix codebase * Update CHANGELOG * Upgrade minimum of PHP version up to 7.1
1 parent b043dc7 commit 6d4f049

8 files changed

Lines changed: 29 additions & 22 deletions

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ language: php
55
matrix:
66
fast_finish: true
77
include:
8-
- php: 7.0
8+
- php: 7.1
99
env:
1010
- EXECUTE_COVERAGE=true
11-
- php: 7.1
11+
- php: 7.2
1212
allow_failures:
13-
- php: 7.1
13+
- php: 7.2
1414

1515
notifications:
1616
email: false

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file
33
using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6+
## [0.3.0] 2018-02-17
7+
8+
### Changed
9+
10+
- Upgrade minimum of PHP version up to 7.1
11+
- Upgrade minimum of PHPUnit version up to 7.0
12+
613
## [0.2.0] 2017-10-29
714

815
### Changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
],
1414
"minimum-stability": "stable",
1515
"require": {
16-
"php": "~7.0",
17-
"psr/http-message": "~1.0",
18-
"phpunit/phpunit": "~6.0",
16+
"php": "^7.1",
17+
"psr/http-message": "^1.0",
18+
"phpunit/phpunit": "^7.0",
1919
"justinrainbow/json-schema": "~2.0"
2020
},
2121
"autoload": {

src/PhpUnit/ContentTypeConstraint.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ public function __construct(array $allowedTypes)
3737
/**
3838
* {@inheritdoc}
3939
*/
40-
protected function matches($other)
40+
protected function matches($other): bool
4141
{
4242
return in_array($this->stripParams($other), $this->allowedTypes, true);
4343
}
4444

4545
/**
4646
* {@inheritdoc}
4747
*/
48-
public function toString()
48+
public function toString(): string
4949
{
5050
return 'is an allowed content-type (' . implode(', ', $this->allowedTypes) . ')';
5151
}

src/PhpUnit/HeadersConstraint.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(array $expectedHeadersSchemas)
4848
/**
4949
* {@inheritdoc}
5050
*/
51-
protected function matches($actualHeaders)
51+
protected function matches($actualHeaders): bool
5252
{
5353
if (!is_array($actualHeaders)) {
5454
throw new UnexpectedValueException('Array expected');
@@ -76,23 +76,23 @@ protected function matches($actualHeaders)
7676
/**
7777
* {@inheritdoc}
7878
*/
79-
protected function failureDescription($other)
79+
protected function failureDescription($other): string
8080
{
8181
return json_encode($other) . ' ' . $this->toString();
8282
}
8383

8484
/**
8585
* {@inheritdoc}
8686
*/
87-
protected function additionalFailureDescription($other)
87+
protected function additionalFailureDescription($other): string
8888
{
8989
return $this->validator->serializeErrors($this->errors);
9090
}
9191

9292
/**
9393
* {@inheritdoc}
9494
*/
95-
public function toString()
95+
public function toString(): string
9696
{
9797
return 'matches an specified headers schemas';
9898
}

src/PhpUnit/JsonSchemaConstraint.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __construct($schema, $context = null)
5454
/**
5555
* {@inheritdoc}
5656
*/
57-
protected function matches($other)
57+
protected function matches($other): bool
5858
{
5959
$this->errors = $this->validator->validate($other, $this->schema);
6060

@@ -64,23 +64,23 @@ protected function matches($other)
6464
/**
6565
* {@inheritdoc}
6666
*/
67-
protected function failureDescription($other)
67+
protected function failureDescription($other): string
6868
{
6969
return json_encode($other) . ' ' . $this->toString();
7070
}
7171

7272
/**
7373
* {@inheritdoc}
7474
*/
75-
protected function additionalFailureDescription($other)
75+
protected function additionalFailureDescription($other): string
7676
{
7777
return $this->validator->serializeErrors($this->errors);
7878
}
7979

8080
/**
8181
* {@inheritdoc}
8282
*/
83-
public function toString()
83+
public function toString(): string
8484
{
8585
return "matches defined {$this->context}";
8686
}

src/PhpUnit/MethodsAllowedConstraint.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(array $allowedMethods)
3535
/**
3636
* {@inheritdoc}
3737
*/
38-
protected function matches($other)
38+
protected function matches($other): bool
3939
{
4040
if (is_string($other)) {
4141
return in_array(strtoupper($other), $this->allowedMethods);
@@ -47,7 +47,7 @@ protected function matches($other)
4747
/**
4848
* {@inheritdoc}
4949
*/
50-
public function toString()
50+
public function toString(): string
5151
{
5252
return 'matches an allowed methods (' . implode(', ', $this->allowedMethods) . ')';
5353
}

src/PhpUnit/UriConstraint.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function __construct(
9191
/**
9292
* {@inheritdoc}
9393
*/
94-
protected function matches($uri)
94+
protected function matches($uri): bool
9595
{
9696
if (!$uri instanceof UriInterface) {
9797
throw new UnexpectedValueException('The object should implements UriInterface');
@@ -182,23 +182,23 @@ protected function matches($uri)
182182
/**
183183
* {@inheritdoc}
184184
*/
185-
protected function failureDescription($other)
185+
protected function failureDescription($other): string
186186
{
187187
return json_encode((object) $this->normalizeUri($other)) . ' ' . $this->toString();
188188
}
189189

190190
/**
191191
* {@inheritdoc}
192192
*/
193-
protected function additionalFailureDescription($other)
193+
protected function additionalFailureDescription($other): string
194194
{
195195
return $this->validator->serializeErrors($this->errors);
196196
}
197197

198198
/**
199199
* {@inheritdoc}
200200
*/
201-
public function toString()
201+
public function toString(): string
202202
{
203203
return 'matches an specified URI parts';
204204
}

0 commit comments

Comments
 (0)