Skip to content

Commit dfd3db3

Browse files
committed
Introduce PHP 8.1
1 parent 6370127 commit dfd3db3

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

Diff for: .travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ php:
88
- 7.3
99
- 7.4
1010
- 8.0
11+
- 8.1
1112
- nightly
1213
env:
1314
matrix:

Diff for: src/Html/Form.php

+15-15
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
namespace Ubirak\RestApiBehatExtension\Html;
44

5-
class Form
5+
class Form
66
{
77
private $body = [];
8-
8+
99
private $contentTypeHeaderValue = '';
1010

11-
public function __construct(array $body)
11+
public function __construct(array $body)
1212
{
1313
$this->body = $body;
1414
}
1515

16-
public function getBody()
16+
public function getBody()
1717
{
1818
if ($this->bodyHasFileObject()) {
1919
return $this->getMultipartStreamBody();
@@ -23,28 +23,28 @@ public function getBody()
2323
}
2424

2525
/**
26-
*
26+
*
2727
* @return string
2828
*/
29-
public function getContentTypeHeaderValue()
29+
public function getContentTypeHeaderValue()
3030
{
3131
return $this->contentTypeHeaderValue;
3232
}
3333

3434
/**
35-
*
35+
*
3636
* @param string $value
3737
*/
38-
private function setContentTypeHeaderValue($value)
38+
private function setContentTypeHeaderValue($value)
3939
{
4040
$this->contentTypeHeaderValue = $value;
4141
}
4242

4343
/**
44-
*
44+
*
4545
* @return boolean
4646
*/
47-
private function bodyHasFileObject()
47+
private function bodyHasFileObject()
4848
{
4949
foreach ($this->body as $element) {
5050
if ($element['object'] == 'file') {
@@ -56,10 +56,10 @@ private function bodyHasFileObject()
5656
}
5757

5858
/**
59-
*
59+
*
6060
* @return \GuzzleHttp\Psr7\MultipartStream
6161
*/
62-
private function getMultipartStreamBody()
62+
private function getMultipartStreamBody()
6363
{
6464
$multiparts = array_map(
6565
function ($element) {
@@ -80,10 +80,10 @@ function ($element) {
8080
}
8181

8282
/**
83-
*
83+
*
8484
* @return string
8585
*/
86-
private function getNameValuePairBody()
86+
private function getNameValuePairBody()
8787
{
8888
$body = [];
8989
foreach ($this->body as $element) {
@@ -92,7 +92,7 @@ private function getNameValuePairBody()
9292

9393
$this->setContentTypeHeaderValue('application/x-www-form-urlencoded');
9494

95-
return http_build_query($body, null, '&');
95+
return http_build_query($body);
9696
}
9797

9898
}

Diff for: src/Json/JsonContext.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ public function __construct(JsonInspector $jsonInspector, $jsonSchemaBaseUrl = n
1919
{
2020
$this->jsonInspector = $jsonInspector;
2121
$this->asserter = new asserter();
22-
$this->jsonSchemaBaseUrl = rtrim((string) $jsonSchemaBaseUrl, '/');
22+
23+
if (null !== $jsonSchemaBaseUrl) {
24+
$jsonSchemaBaseUrl = rtrim($jsonSchemaBaseUrl, '/');
25+
}
26+
$this->jsonSchemaBaseUrl = $jsonSchemaBaseUrl;
2327
}
2428

2529
/**

0 commit comments

Comments
 (0)