Skip to content

Commit

Permalink
Add property types for PHP 7.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
Crell committed Sep 30, 2024
1 parent a6c6a6a commit b41d66d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 deletions.
22 changes: 6 additions & 16 deletions src/ApiProblem.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ class ApiProblem implements \ArrayAccess, \JsonSerializable
*
* It SHOULD NOT change from occurrence to occurrence of the problem,
* except for purposes of localization.
*
* @var string
*/
protected $title;
protected string $title;

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

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

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

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

/**
* Any arbitrary extension properties that have been assigned on this object.
*
* @var array<string, string>
*/
protected $extensions = [];
protected array $extensions = [];

/**
* Parses a JSON string into a Problem object.
Expand Down
9 changes: 2 additions & 7 deletions src/HttpConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,12 @@
*/
class HttpConverter
{
/**
* @var ResponseFactoryInterface
*/
protected $responseFactory;
protected ResponseFactoryInterface $responseFactory;

/**
* Whether or not the response body should be "pretty-printed".
*
* @var bool
*/
protected $pretty;
protected bool $pretty;

/**
* HttpConverter constructor.
Expand Down

0 comments on commit b41d66d

Please sign in to comment.