-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
80 changed files
with
538 additions
and
826 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ composer.phar | |
/vendor/ | ||
/composer.lock | ||
/.php_cs.cache | ||
.php-cs-fixer.cache | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->exclude('somedir') | ||
->notPath('src/Symfony/Component/Translation/Tests/fixtures/resources.php') | ||
->in(__DIR__); | ||
|
||
$config = new PhpCsFixer\Config(); | ||
return $config->setRules([ | ||
'@PSR12' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'braces' => [ | ||
'allow_single_line_closure' => true, | ||
'position_after_functions_and_oop_constructs' => 'same'], | ||
]) | ||
->setFinder($finder); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<phpunit | ||
bootstrap="vendor/autoload.php" | ||
stopOnFailure="false" | ||
verbose="true" | ||
colors="true"> | ||
<testsuites> | ||
<testsuite name="Main"> | ||
<directory>./test</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">./src/</directory> | ||
</whitelist> | ||
</filter> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" stopOnFailure="false" verbose="true" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> | ||
<coverage> | ||
<include> | ||
<directory suffix=".php">./src/</directory> | ||
</include> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="Main"> | ||
<directory>./test</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
<?php declare(strict_types=1); | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace JsonApiPhp\JsonApi; | ||
|
||
use JsonApiPhp\JsonApi\Internal\DataDocumentMember; | ||
use JsonApiPhp\JsonApi\Internal\PrimaryData; | ||
use JsonSerializable; | ||
|
||
/** | ||
* A Document with the "included" member | ||
* @see http://jsonapi.org/format/#document-compound-documents | ||
*/ | ||
final class CompoundDocument implements \JsonSerializable | ||
{ | ||
private $doc; | ||
final class CompoundDocument implements JsonSerializable { | ||
private object $doc; | ||
|
||
public function __construct(PrimaryData $data, Included $included, DataDocumentMember ...$members) | ||
{ | ||
$included->validateLinkage($data); | ||
public function __construct(PrimaryData $data, Included $included, DataDocumentMember ...$members) { | ||
$this->doc = combine($data, $included, ...$members); | ||
} | ||
|
||
#[\ReturnTypeWillChange] | ||
public function jsonSerialize() | ||
{ | ||
public function jsonSerialize(): object { | ||
return $this->doc; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
<?php declare(strict_types=1); | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace JsonApiPhp\JsonApi; | ||
|
||
use JsonApiPhp\JsonApi\Internal\DataDocumentMember; | ||
use JsonApiPhp\JsonApi\Internal\PrimaryData; | ||
use JsonSerializable; | ||
|
||
/** | ||
* A Document containing the "data" member | ||
* @see http://jsonapi.org/format/#document-top-level | ||
*/ | ||
final class DataDocument implements \JsonSerializable | ||
{ | ||
private $value; | ||
final class DataDocument implements JsonSerializable { | ||
private object $value; | ||
|
||
public function __construct(PrimaryData $data, DataDocumentMember ...$members) | ||
{ | ||
public function __construct(PrimaryData $data, DataDocumentMember ...$members) { | ||
$this->value = combine($data, ...$members); | ||
} | ||
|
||
#[\ReturnTypeWillChange] | ||
public function jsonSerialize() | ||
{ | ||
public function jsonSerialize(): object { | ||
return $this->value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.