Skip to content

Commit b41d66d

Browse files
committed
Add property types for PHP 7.4.
1 parent a6c6a6a commit b41d66d

File tree

2 files changed

+8
-23
lines changed

2 files changed

+8
-23
lines changed

src/ApiProblem.php

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ class ApiProblem implements \ArrayAccess, \JsonSerializable
5252
*
5353
* It SHOULD NOT change from occurrence to occurrence of the problem,
5454
* except for purposes of localization.
55-
*
56-
* @var string
5755
*/
58-
protected $title;
56+
protected string $title;
5957

6058
/**
6159
* A URI reference (RFC3986) that identifies the problem type.
@@ -72,10 +70,8 @@ class ApiProblem implements \ArrayAccess, \JsonSerializable
7270
* resolved relative to the document's base URI, as per RFC3986, Section 5.
7371
*
7472
* @link http://tools.ietf.org/html/rfc3986
75-
*
76-
* @var string
7773
*/
78-
protected $type;
74+
protected string $type;
7975

8076
/**
8177
* The HTTP status code set by the origin server for this occurrence of the problem.
@@ -85,10 +81,8 @@ class ApiProblem implements \ArrayAccess, \JsonSerializable
8581
* use the same status code in the actual HTTP response, to assure that
8682
* generic HTTP software that does not understand this format still behaves
8783
* correctly.
88-
*
89-
* @var int
9084
*/
91-
protected $status = 0;
85+
protected int $status = 0;
9286

9387
/**
9488
* An human readable explanation specific to this occurrence of the problem.
@@ -98,10 +92,8 @@ class ApiProblem implements \ArrayAccess, \JsonSerializable
9892
*
9993
* Consumers SHOULD NOT parse the "detail" member for information; extensions
10094
* are more suitable and less error-prone ways to obtain such information.
101-
*
102-
* @var string
10395
*/
104-
protected $detail = '';
96+
protected string $detail = '';
10597

10698
/**
10799
* A URI reference that identifies the specific occurrence of the problem.
@@ -112,17 +104,15 @@ class ApiProblem implements \ArrayAccess, \JsonSerializable
112104
* resolved relative to the document's base URI, as per RFC3986, Section 5.
113105
*
114106
* @link http://tools.ietf.org/html/rfc3986
115-
*
116-
* @var string
117107
*/
118-
protected $instance = '';
108+
protected string $instance = '';
119109

120110
/**
121111
* Any arbitrary extension properties that have been assigned on this object.
122112
*
123113
* @var array<string, string>
124114
*/
125-
protected $extensions = [];
115+
protected array $extensions = [];
126116

127117
/**
128118
* Parses a JSON string into a Problem object.

src/HttpConverter.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,12 @@
1212
*/
1313
class HttpConverter
1414
{
15-
/**
16-
* @var ResponseFactoryInterface
17-
*/
18-
protected $responseFactory;
15+
protected ResponseFactoryInterface $responseFactory;
1916

2017
/**
2118
* Whether or not the response body should be "pretty-printed".
22-
*
23-
* @var bool
2419
*/
25-
protected $pretty;
20+
protected bool $pretty;
2621

2722
/**
2823
* HttpConverter constructor.

0 commit comments

Comments
 (0)