Skip to content

Commit 6d489c1

Browse files
authored
Merge pull request #63 from Art4/phpstan-level-2
Fix errors for PHPStan level 2
2 parents 54b5611 + 57a39c9 commit 6d489c1

File tree

10 files changed

+17
-17
lines changed

10 files changed

+17
-17
lines changed

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ jobs:
4949
run: composer install --no-progress --prefer-dist --optimize-autoloader
5050

5151
- name: Run PHPStan
52-
run: vendor/bin/phpstan.phar analyze src --level 1
52+
run: vendor/bin/phpstan.phar analyze src --level 2
5353

5454
- run: echo "🍏 This job's status is ${{ job.status }}."

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Latest Version](https://img.shields.io/github/release/Art4/json-api-client.svg)](https://github.com/Art4/json-api-client/releases)
44
[![Software License](https://img.shields.io/badge/license-GPL3-brightgreen.svg)](LICENSE)
5-
[![Build Status](https://github.com/art4/json-api-client/actions/workflows/unit-tests.yml/badge.svg?branch=v1.x)](https://github.com/Art4/json-api-client/actionst)
5+
[![Build Status](https://github.com/art4/json-api-client/actions/workflows/unit-tests.yml/badge.svg?branch=v1.x)](https://github.com/Art4/json-api-client/actions)
66
[![Total Downloads](https://img.shields.io/packagist/dt/art4/json-api-client.svg)](https://packagist.org/packages/art4/json-api-client)
77

88
JsonApiClient :construction_worker_woman: is a PHP Library to validate and handle the response body from a [JSON API](http://jsonapi.org) Server.

src/Helper/Parser.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ final class Parser
3333
/**
3434
* @param string $jsonString
3535
*
36-
* @throws \Art4\JsonApiClient\Exception\Exception
36+
* @throws \Art4\JsonApiClient\Exception\ValidationException If $jsonString contains invalid JSON API
37+
* @throws \Art4\JsonApiClient\Exception\InputException if something went wrong with the input
3738
*
3839
* @return \Art4\JsonApiClient\Accessable
3940
*/
@@ -47,7 +48,8 @@ public static function parseResponseString($jsonString)
4748
/**
4849
* @param string $jsonString
4950
*
50-
* @throws \Art4\JsonApiClient\Exception\Exception
51+
* @throws \Art4\JsonApiClient\Exception\ValidationException If $jsonString contains invalid JSON API
52+
* @throws \Art4\JsonApiClient\Exception\InputException if something went wrong with the input
5153
*
5254
* @return \Art4\JsonApiClient\Accessable
5355
*/

src/Input/Input.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ interface Input
3030
* This should be a native PH stdClass object, so Manager could
3131
* iterate over all public attributes
3232
*
33-
* @throws InputException if somethin went wrong with the input
33+
* @throws \Art4\JsonApiClient\Exception\InputException if something went wrong with the input
3434
*
35-
* @return stdClass
35+
* @return \stdClass
3636
*/
3737
public function getAsObject();
3838
}

src/Input/RequestStringInput.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class RequestStringInput implements Input, RequestInput
3333
*
3434
* @param string $string
3535
*
36-
* @throws InputException if $string is not a string
36+
* @throws \Art4\JsonApiClient\Exception\InputException if $string is not a string
3737
*/
3838
public function __construct($string)
3939
{
@@ -46,9 +46,9 @@ public function __construct($string)
4646
* This should be a native PH stdClass object, so Manager could
4747
* iterate over all public attributes
4848
*
49-
* @throws InputException if somethin went wrong with the input
49+
* @throws \Art4\JsonApiClient\Exception\InputException if something went wrong with the input
5050
*
51-
* @return stdClass
51+
* @return \stdClass
5252
*/
5353
public function getAsObject()
5454
{

src/Input/ResponseStringInput.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class ResponseStringInput implements Input
3333
*
3434
* @param string $string
3535
*
36-
* @throws InputException if $string is not a string
36+
* @throws \Art4\JsonApiClient\Exception\InputException if $string is not a string
3737
*/
3838
public function __construct($string)
3939
{
@@ -46,9 +46,9 @@ public function __construct($string)
4646
* This should be a native PH stdClass object, so Manager could
4747
* iterate over all public attributes
4848
*
49-
* @throws InputException if somethin went wrong with the input
49+
* @throws \Art4\JsonApiClient\Exception\InputException if something went wrong with the input
5050
*
51-
* @return stdClass
51+
* @return \stdClass
5252
*/
5353
public function getAsObject()
5454
{

src/Input/StringInputTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function prepareString($string)
5252
*
5353
* @param string $jsonString
5454
*
55-
* @throws InputException if somethin went wrong with the input
55+
* @throws InputException if something went wrong with the input
5656
*
5757
* @return object
5858
*/

src/Manager/ErrorAbortManager.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ final class ErrorAbortManager implements Manager
4343
* Create a Manager
4444
*
4545
* @param \Art4\JsonApiClient\Factory $factory
46-
* @param mixed $params A config array
4746
*
4847
* @return object
4948
*/

src/Serializer/ArraySerializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function serialize(Accessable $data)
7575
/**
7676
* Transforms objects to arrays
7777
*
78-
* @param $val
78+
* @param mixed $val
7979
*
8080
* @return mixed
8181
*/

src/V1/Document.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,11 @@ public function get($key)
9999
/**
100100
* Parse the data value
101101
*
102-
*
103102
* @param null|object $data Data value
104103
*
105104
* @throws ValidationException If $data isn't null or an object
106105
*
107-
* @return Accessable The parsed data
106+
* @return \Art4\JsonApiClient\Accessable The parsed data
108107
*/
109108
private function parseData($data)
110109
{

0 commit comments

Comments
 (0)