Skip to content

Commit f457029

Browse files
committed
Add type declaration to (private) properties
1 parent 412e766 commit f457029

11 files changed

+29
-146
lines changed

src/Client.php

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,19 @@
1616

1717
class Client implements ClientInterface
1818
{
19-
/**
20-
* @var \Psr\Http\Client\ClientInterface
21-
*/
22-
private $client;
19+
private HttpClientInterface $client;
2320

24-
/**
25-
* @var \Psr\Http\Message\RequestFactoryInterface
26-
*/
27-
private $requestFactory;
21+
private RequestFactoryInterface $requestFactory;
2822

29-
/**
30-
* @var \Psr\Http\Message\StreamFactoryInterface
31-
*/
32-
private $streamFactory;
23+
private StreamFactoryInterface $streamFactory;
3324

34-
/**
35-
* @var string
36-
*/
37-
private $baseUri = '';
25+
private string $baseUri = '';
3826

39-
/**
40-
* @var array
41-
*/
42-
private $defaultHeaders = [
27+
private array $defaultHeaders = [
4328
'Accept' => 'application/vnd.api+json',
4429
'Content-Type' => 'application/vnd.api+json',
4530
];
4631

47-
/**
48-
* @param \Psr\Http\Client\ClientInterface|null $client
49-
* @param \Psr\Http\Message\RequestFactoryInterface|null $requestFactory
50-
* @param \Psr\Http\Message\StreamFactoryInterface|null $streamFactory
51-
*/
5232
public function __construct(
5333
HttpClientInterface $client = null,
5434
RequestFactoryInterface $requestFactory = null,

src/DocumentClient.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,10 @@
1616

1717
class DocumentClient implements DocumentClientInterface
1818
{
19-
/**
20-
* @var \Swis\JsonApi\Client\Interfaces\ClientInterface
21-
*/
22-
private $client;
19+
private ClientInterface $client;
2320

24-
/**
25-
* @var \Swis\JsonApi\Client\Interfaces\ResponseParserInterface
26-
*/
27-
private $parser;
21+
private ResponseParserInterface $parser;
2822

29-
/**
30-
* @param \Swis\JsonApi\Client\Interfaces\ClientInterface $client
31-
* @param \Swis\JsonApi\Client\Interfaces\ResponseParserInterface $parser
32-
*/
3323
public function __construct(ClientInterface $client, ResponseParserInterface $parser)
3424
{
3525
$this->client = $client;

src/Parsers/CollectionParser.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,8 @@
1212
*/
1313
class CollectionParser
1414
{
15-
/**
16-
* @var \Swis\JsonApi\Client\Parsers\ItemParser
17-
*/
18-
private $itemParser;
15+
private ItemParser $itemParser;
1916

20-
/**
21-
* @param \Swis\JsonApi\Client\Parsers\ItemParser $itemParser
22-
*/
2317
public function __construct(ItemParser $itemParser)
2418
{
2519
$this->itemParser = $itemParser;

src/Parsers/DocumentParser.php

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,44 +20,18 @@
2020

2121
class DocumentParser implements DocumentParserInterface
2222
{
23-
/**
24-
* @var \Swis\JsonApi\Client\Parsers\ItemParser
25-
*/
26-
private $itemParser;
23+
private ItemParser $itemParser;
2724

28-
/**
29-
* @var \Swis\JsonApi\Client\Parsers\CollectionParser
30-
*/
31-
private $collectionParser;
25+
private CollectionParser $collectionParser;
3226

33-
/**
34-
* @var \Swis\JsonApi\Client\Parsers\ErrorCollectionParser
35-
*/
36-
private $errorCollectionParser;
27+
private ErrorCollectionParser $errorCollectionParser;
3728

38-
/**
39-
* @var \Swis\JsonApi\Client\Parsers\LinksParser
40-
*/
41-
private $linksParser;
29+
private LinksParser $linksParser;
4230

43-
/**
44-
* @var \Swis\JsonApi\Client\Parsers\JsonapiParser
45-
*/
46-
private $jsonapiParser;
31+
private JsonapiParser $jsonapiParser;
4732

48-
/**
49-
* @var \Swis\JsonApi\Client\Parsers\MetaParser
50-
*/
51-
private $metaParser;
33+
private MetaParser $metaParser;
5234

53-
/**
54-
* @param \Swis\JsonApi\Client\Parsers\ItemParser $itemParser
55-
* @param \Swis\JsonApi\Client\Parsers\CollectionParser $collectionParser
56-
* @param \Swis\JsonApi\Client\Parsers\ErrorCollectionParser $errorCollectionParser
57-
* @param \Swis\JsonApi\Client\Parsers\LinksParser $linksParser
58-
* @param \Swis\JsonApi\Client\Parsers\JsonapiParser $jsonapiParser
59-
* @param \Swis\JsonApi\Client\Parsers\MetaParser $metaParser
60-
*/
6135
public function __construct(
6236
ItemParser $itemParser,
6337
CollectionParser $collectionParser,

src/Parsers/ErrorCollectionParser.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,8 @@
1212
*/
1313
class ErrorCollectionParser
1414
{
15-
/**
16-
* @var \Swis\JsonApi\Client\Parsers\ErrorParser
17-
*/
18-
private $errorParser;
15+
private ErrorParser $errorParser;
1916

20-
/**
21-
* @param \Swis\JsonApi\Client\Parsers\ErrorParser $errorParser
22-
*/
2317
public function __construct(ErrorParser $errorParser)
2418
{
2519
$this->errorParser = $errorParser;

src/Parsers/ErrorParser.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,10 @@
1313
*/
1414
class ErrorParser
1515
{
16-
/**
17-
* @var \Swis\JsonApi\Client\Parsers\LinksParser
18-
*/
19-
private $linksParser;
16+
private LinksParser $linksParser;
2017

21-
/**
22-
* @var \Swis\JsonApi\Client\Parsers\MetaParser
23-
*/
24-
private $metaParser;
18+
private MetaParser $metaParser;
2519

26-
/**
27-
* @param \Swis\JsonApi\Client\Parsers\LinksParser $linksParser
28-
* @param \Swis\JsonApi\Client\Parsers\MetaParser $metaParser
29-
*/
3020
public function __construct(LinksParser $linksParser, MetaParser $metaParser)
3121
{
3222
$this->linksParser = $linksParser;

src/Parsers/ItemParser.php

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,12 @@
1616
*/
1717
class ItemParser
1818
{
19-
/**
20-
* @var \Swis\JsonApi\Client\Interfaces\TypeMapperInterface
21-
*/
22-
private $typeMapper;
19+
private TypeMapperInterface $typeMapper;
2320

24-
/**
25-
* @var \Swis\JsonApi\Client\Parsers\LinksParser
26-
*/
27-
private $linksParser;
21+
private LinksParser $linksParser;
2822

29-
/**
30-
* @var \Swis\JsonApi\Client\Parsers\MetaParser
31-
*/
32-
private $metaParser;
23+
private MetaParser $metaParser;
3324

34-
/**
35-
* @param \Swis\JsonApi\Client\Interfaces\TypeMapperInterface $typeMapper
36-
* @param \Swis\JsonApi\Client\Parsers\LinksParser $linksParser
37-
* @param \Swis\JsonApi\Client\Parsers\MetaParser $metaParser
38-
*/
3925
public function __construct(TypeMapperInterface $typeMapper, LinksParser $linksParser, MetaParser $metaParser)
4026
{
4127
$this->typeMapper = $typeMapper;

src/Parsers/JsonapiParser.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,8 @@
1212
*/
1313
class JsonapiParser
1414
{
15-
/**
16-
* @var \Swis\JsonApi\Client\Parsers\MetaParser
17-
*/
18-
private $metaParser;
15+
private MetaParser $metaParser;
1916

20-
/**
21-
* @param \Swis\JsonApi\Client\Parsers\MetaParser $metaParser
22-
*/
2317
public function __construct(MetaParser $metaParser)
2418
{
2519
$this->metaParser = $metaParser;

src/Parsers/LinksParser.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,8 @@ class LinksParser
2727
'related',
2828
];
2929

30-
/**
31-
* @var \Swis\JsonApi\Client\Parsers\MetaParser
32-
*/
33-
private $metaParser;
30+
private MetaParser $metaParser;
3431

35-
/**
36-
* @param \Swis\JsonApi\Client\Parsers\MetaParser $metaParser
37-
*/
3832
public function __construct(MetaParser $metaParser)
3933
{
4034
$this->metaParser = $metaParser;

src/Parsers/ResponseParser.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,8 @@
1414

1515
class ResponseParser implements ResponseParserInterface
1616
{
17-
/**
18-
* @var \Swis\JsonApi\Client\Interfaces\DocumentParserInterface
19-
*/
20-
private $parser;
17+
private DocumentParserInterface $parser;
2118

22-
/**
23-
* @param \Swis\JsonApi\Client\Interfaces\DocumentParserInterface $parser
24-
*/
2519
public function __construct(DocumentParserInterface $parser)
2620
{
2721
$this->parser = $parser;

0 commit comments

Comments
 (0)