Skip to content

Commit

Permalink
Fix PSR-12 conformance
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Oct 20, 2019
1 parent c656a1c commit 40e6a21
Show file tree
Hide file tree
Showing 65 changed files with 104 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ REMOVED:

FIXED:

## 2.2.1 - 2019-10-19
## 2.2.1 - 2019-10-20

FIXED:

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"phpstan/phpstan-phpunit": "^0.11.2",
"phpstan/phpstan-strict-rules": "^0.11.0",
"phpunit/phpunit": "^7.0.0||^8.2.0",
"squizlabs/php_codesniffer": "^3.4.0",
"squizlabs/php_codesniffer": "^3.5.1",
"woohoolabs/coding-standard": "^1.0.0",
"woohoolabs/releaser": "^1.1.0"
},
Expand Down
17 changes: 17 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,21 @@
<file>tests/</file>

<rule ref="WoohooLabs"/>

<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing">
<properties>
<property name="linesCountAfterLastUse" value="1"/>
<property name="linesCountBeforeFirstUse" value="1"/>
<property name="linesCountBetweenUseTypes" value="1"/>
</properties>
</rule>

<!-- Require presence of declare(strict_types=1) -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="newlinesCountBetweenOpenTagAndDeclare" value="2"/>
<property name="spacesCountAroundEqualsSign" value="0"/>
<property name="newlinesCountAfterDeclare" value="2"/>
</properties>
</rule>
</ruleset>
1 change: 1 addition & 0 deletions src/JsonApi/Client/JsonApiAsyncClient.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Client;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Client/JsonApiClient.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Client;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Exception/DocumentException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Exception;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Exception/JsonApiExceptionInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Exception;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Exception/ResponseException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Exception;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Exception/SerializationException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Exception;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Hydrator/AbstractClassDocumentHydrator.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Hydrator;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Hydrator/ClassDocumentHydrator.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Hydrator;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Hydrator/ClassHydrator.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Hydrator;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Hydrator/DocumentHydratorInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Hydrator;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Hydrator/HydratorInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Hydrator;
Expand Down
2 changes: 2 additions & 0 deletions src/JsonApi/Request/JsonApiRequestBuilder.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Request;

use Psr\Http\Message\RequestInterface;
use WoohooLabs\Yang\JsonApi\Serializer\JsonSerializer;
use WoohooLabs\Yang\JsonApi\Serializer\SerializerInterface;

use function array_key_exists;
use function http_build_query;
use function implode;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Request/RelationshipInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Request;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Request/ResourceObject.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Request;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Request/ToManyRelationship.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Request;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Request/ToOneRelationship.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Request;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Response/AbstractResponse.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Response;
Expand Down
2 changes: 2 additions & 0 deletions src/JsonApi/Response/JsonApiResponse.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Response;
Expand All @@ -8,6 +9,7 @@
use WoohooLabs\Yang\JsonApi\Schema\Document;
use WoohooLabs\Yang\JsonApi\Serializer\DeserializerInterface;
use WoohooLabs\Yang\JsonApi\Serializer\JsonDeserializer;

use function in_array;
use function is_array;

Expand Down
2 changes: 2 additions & 0 deletions src/JsonApi/Schema/Document.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Schema;
Expand All @@ -8,6 +9,7 @@
use WoohooLabs\Yang\JsonApi\Schema\Link\DocumentLinks;
use WoohooLabs\Yang\JsonApi\Schema\Resource\ResourceObject;
use WoohooLabs\Yang\JsonApi\Schema\Resource\ResourceObjects;

use function array_filter;
use function array_keys;
use function count;
Expand Down
2 changes: 2 additions & 0 deletions src/JsonApi/Schema/Error/Error.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Schema\Error;

use WoohooLabs\Yang\JsonApi\Schema\Link\ErrorLinks;

use function is_array;
use function is_scalar;
use function is_string;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Schema/Error/ErrorSource.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Schema\Error;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Schema/JsonApiObject.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Schema;
Expand Down
4 changes: 1 addition & 3 deletions src/JsonApi/Schema/Link/AbstractLink.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Schema\Link;

use function is_array;
use function is_string;

abstract class AbstractLink
{
/**
Expand Down
3 changes: 1 addition & 2 deletions src/JsonApi/Schema/Link/AbstractLinks.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Schema\Link;

use WoohooLabs\Yang\JsonApi\Exception\DocumentException;
use function is_array;
use function is_string;

abstract class AbstractLinks
{
Expand Down
2 changes: 2 additions & 0 deletions src/JsonApi/Schema/Link/DocumentLinks.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Schema\Link;

use WoohooLabs\Yang\JsonApi\Exception\DocumentException;

use function array_values;
use function is_array;
use function is_string;
Expand Down
2 changes: 2 additions & 0 deletions src/JsonApi/Schema/Link/ErrorLinks.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Schema\Link;

use WoohooLabs\Yang\JsonApi\Exception\DocumentException;

use function array_values;
use function is_array;
use function is_string;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Schema/Link/Link.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Schema\Link;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Schema/Link/ProfileLink.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Schema\Link;
Expand Down
4 changes: 4 additions & 0 deletions src/JsonApi/Schema/Link/RelationshipLinks.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Schema\Link;

use WoohooLabs\Yang\JsonApi\Exception\DocumentException;

use function is_array;
use function is_string;

final class RelationshipLinks extends AbstractLinks
{
public function hasSelf(): bool
Expand Down
4 changes: 4 additions & 0 deletions src/JsonApi/Schema/Link/ResourceLinks.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Schema\Link;

use WoohooLabs\Yang\JsonApi\Exception\DocumentException;

use function is_array;
use function is_string;

final class ResourceLinks extends AbstractLinks
{
public function hasSelf(): bool
Expand Down
2 changes: 2 additions & 0 deletions src/JsonApi/Schema/Relationship.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Schema;
Expand All @@ -7,6 +8,7 @@
use WoohooLabs\Yang\JsonApi\Schema\Link\RelationshipLinks;
use WoohooLabs\Yang\JsonApi\Schema\Resource\ResourceObject;
use WoohooLabs\Yang\JsonApi\Schema\Resource\ResourceObjects;

use function array_filter;
use function array_key_exists;
use function array_keys;
Expand Down
2 changes: 2 additions & 0 deletions src/JsonApi/Schema/Resource/ResourceObject.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Schema\Resource;

use WoohooLabs\Yang\JsonApi\Exception\DocumentException;
use WoohooLabs\Yang\JsonApi\Schema\Link\ResourceLinks;
use WoohooLabs\Yang\JsonApi\Schema\Relationship;

use function array_key_exists;
use function array_merge;
use function is_array;
Expand Down
2 changes: 2 additions & 0 deletions src/JsonApi/Schema/Resource/ResourceObjects.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Schema\Resource;

use WoohooLabs\Yang\JsonApi\Exception\DocumentException;

use function array_values;
use function key;
use function reset;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Serializer/DeserializerInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Serializer;
Expand Down
2 changes: 2 additions & 0 deletions src/JsonApi/Serializer/JsonDeserializer.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Serializer;

use Psr\Http\Message\ResponseInterface;

use function json_decode;

final class JsonDeserializer implements DeserializerInterface
Expand Down
2 changes: 2 additions & 0 deletions src/JsonApi/Serializer/JsonSerializer.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Serializer;

use Psr\Http\Message\RequestInterface;
use WoohooLabs\Yang\JsonApi\Exception\SerializationException;

use function is_array;
use function is_string;
use function json_encode;
Expand Down
1 change: 1 addition & 0 deletions src/JsonApi/Serializer/SerializerInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Serializer;
Expand Down
2 changes: 2 additions & 0 deletions tests/JsonApi/Hydrator/ClassDocumentHydratorTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\Tests\JsonApi\Hydrator;
Expand All @@ -8,6 +9,7 @@
use WoohooLabs\Yang\JsonApi\Exception\DocumentException;
use WoohooLabs\Yang\JsonApi\Hydrator\ClassDocumentHydrator;
use WoohooLabs\Yang\JsonApi\Schema\Document;

use function end;
use function reset;

Expand Down
1 change: 1 addition & 0 deletions tests/JsonApi/Hydrator/ClassHydratorTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\Tests\JsonApi\Hydrator;
Expand Down
1 change: 1 addition & 0 deletions tests/JsonApi/Hydrator/CustomHydratorTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace WoohooLabs\Yang\Tests\JsonApi\Hydrator;
Expand Down
Loading

0 comments on commit 40e6a21

Please sign in to comment.