Skip to content

Commit c2a41bb

Browse files
committed
Close #178
1 parent 1f16cac commit c2a41bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+306
-76
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
language: php
22
php:
3-
- 5.5
43
- 5.6
5-
- hhvm
64
- 7
75
- 7.1
86
matrix:
97
include:
8+
- php: hhvm
9+
dist: trusty
1010
- php: 5.5
1111
script:
1212
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ High code quality and **100% test coverage** with **250+ tests**. Production rea
3333

3434
## Full-stack Integration
3535

36-
This package is framework agnostic and if you are looking for practical usage sample you might be interested in Quick start JSON API server application [Limoncello Flute](https://github.com/neomerx/limoncello-flute).
36+
This package is framework agnostic and if you are looking for practical usage sample you might be interested in Quick start JSON API server application [Limoncello App](https://github.com/limoncello-php/app).
3737

3838
The server supports
3939
- CRUD operations for a few sample data models and Users.
@@ -42,7 +42,7 @@ The server supports
4242
- Support for such JSON API features as resource inclusion, pagination and etc.
4343

4444
<p align="center">
45-
<a href="https://github.com/neomerx/limoncello-flute" target="_blank"><img src="https://github.com/neomerx/limoncello-flute/blob/master/resources/img/screen-shot.png" alt="Demo app screen-shot" title="Limoncello Flute" align="middle" width="330" height="252" /></a>
45+
<a href="https://github.com/limoncello-php/app" target="_blank"><img src="https://github.com/limoncello-php/app/raw/master/resources/img/screen-shot.png" alt="Demo app screen-shot" title="Limoncello App" align="middle" width="330" height="252" /></a>
4646
</p>
4747

4848
## Sample usage
@@ -107,7 +107,7 @@ The second ```EncoderOptions``` parameter ```http://example.com/api/v1``` is a U
107107

108108
## Questions?
109109

110-
Do not hesitate to contact us on [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/neomerx/json-api) or post an [issue](https://github.com/neomerx/json-api/issues).
110+
Do not hesitate to check [issues](https://github.com/neomerx/json-api/issues) or post a new one.
111111

112112
## Need help?
113113

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"scripts": {
4949
"test": ["@test-unit", "@test-cs", "@test-md"],
5050
"test-unit": "./vendor/phpunit/phpunit/phpunit --coverage-text",
51+
"test-unit-with-coverage": "phpdbg -qrr ./vendor/bin/phpunit --coverage-text",
5152
"test-cs": "./vendor/bin/phpcs -p -s --standard=PSR2 ./src ./tests",
5253
"test-md": "./vendor/bin/phpmd ./src text codesize,controversial,cleancode,design,unusedcode,naming",
5354

sample/composer.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,7 @@
1313
"Neomerx\\Samples\\JsonApi\\": "./"
1414
}
1515
},
16-
"minimum-stability": "dev",
17-
"repositories": [
18-
{
19-
"type": "vcs",
20-
"url": "https://github.com/neomerx/json-api"
21-
}
22-
],
2316
"require": {
24-
"neomerx/json-api": "^0.8.8"
17+
"neomerx/json-api": "dev-develop"
2518
}
2619
}

src/Contracts/Encoder/EncoderInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ public function withJsonApiVersion($meta = null);
6969
* @see http://jsonapi.org/format/#fetching-relationships
7070
*
7171
* @return EncoderInterface
72+
*
73+
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
7274
*/
7375
public function withRelationshipSelfLink($resource, $relationshipName, $meta = null, $treatAsHref = false);
7476

@@ -83,6 +85,8 @@ public function withRelationshipSelfLink($resource, $relationshipName, $meta = n
8385
* @see http://jsonapi.org/format/#fetching-relationships
8486
*
8587
* @return EncoderInterface
88+
*
89+
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
8690
*/
8791
public function withRelationshipRelatedLink($resource, $relationshipName, $meta = null, $treatAsHref = false);
8892

src/Contracts/Http/Headers/HeaderParametersInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ interface HeaderParametersInterface
2929
public function getMethod();
3030

3131
/**
32-
* Get get 'Content-Type' header.
32+
* Get get 'Content-Type' header if request has body and `null` otherwise.
3333
*
34-
* @return HeaderInterface
34+
* @return HeaderInterface|null
3535
*/
3636
public function getContentTypeHeader();
3737

src/Contracts/Http/Headers/HeaderParametersParserInterface.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ interface HeaderParametersParserInterface
2727
* Parse input parameters from request.
2828
*
2929
* @param ServerRequestInterface $request
30+
* @param bool $checkContentType
3031
*
3132
* @return HeaderParametersInterface
33+
*
34+
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
3235
*/
33-
public function parse(ServerRequestInterface $request);
36+
public function parse(ServerRequestInterface $request, $checkContentType = true);
3437
}

src/Contracts/Http/HttpFactoryInterface.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ public function createQueryParameters(
8888
*/
8989
public function createHeaderParameters($method, AcceptHeaderInterface $accept, HeaderInterface $contentType);
9090

91+
/**
92+
* @param string $method
93+
* @param AcceptHeaderInterface $accept
94+
*
95+
* @return HeaderParametersInterface
96+
*/
97+
public function createNoContentHeaderParameters($method, AcceptHeaderInterface $accept);
98+
9199
/**
92100
* Create parameters parser.
93101
*
@@ -171,6 +179,8 @@ public function createHeadersChecker(CodecMatcherInterface $codecMatcher);
171179
* @param array|null $filteringParameters
172180
*
173181
* @return QueryCheckerInterface
182+
*
183+
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
174184
*/
175185
public function createQueryChecker(
176186
$allowUnrecognized = false,

src/Contracts/Schema/SchemaFactoryInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ public function createResourceObject(
7070
* @param bool $isRoot
7171
*
7272
* @return RelationshipObjectInterface
73+
*
74+
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
7375
*/
7476
public function createRelationshipObject($name, $data, $links, $meta, $isShowData, $isRoot);
7577

@@ -81,6 +83,8 @@ public function createRelationshipObject($name, $data, $links, $meta, $isShowDat
8183
* @param bool $treatAsHref If $subHref is a full URL and must not be concatenated with other URLs.
8284
*
8385
* @return LinkInterface
86+
*
87+
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
8488
*/
8589
public function createLink($subHref, $meta = null, $treatAsHref = false);
8690

src/Contracts/Schema/SchemaProviderInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ public function getSelfSubLink($resource);
6767
* @param bool $treatAsHref
6868
*
6969
* @return LinkInterface
70+
*
71+
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
7072
*/
7173
public function getRelationshipSelfLink($resource, $name, $meta = null, $treatAsHref = false);
7274

@@ -79,6 +81,8 @@ public function getRelationshipSelfLink($resource, $name, $meta = null, $treatAs
7981
* @param bool $treatAsHref
8082
*
8183
* @return LinkInterface
84+
*
85+
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
8286
*/
8387
public function getRelationshipRelatedLink($resource, $name, $meta = null, $treatAsHref = false);
8488

0 commit comments

Comments
 (0)