Skip to content

Commit

Permalink
Merge remote-tracking branch 'phly/master' (#3)
Browse files Browse the repository at this point in the history
* Merge remote-tracking branch 'phly/master'
* Fixing location of coverage.xml
  • Loading branch information
jaydiablo authored and aripringle committed Jan 26, 2018
1 parent c2f1753 commit f375bde
Show file tree
Hide file tree
Showing 75 changed files with 1,540 additions and 1,104 deletions.
16 changes: 16 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__ . '/src')
->in(__DIR__ . '/test')
;

return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'no_whitespace_in_blank_line' => true,
'array_syntax' => ['syntax' => 'short'],
])
->setFinder($finder)
;
17 changes: 13 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
sudo: false

language: php

cache:
directories:
- $HOME/.composer/cache
- vendor

php:
- 5.6
- 7.0
- 7.1
- 7.2
- nightly

before_script:
before_install:
- travis_retry composer self-update
- travis_retry composer install --no-interaction --prefer-source

install:
- travis_retry composer install --no-interaction

branches:
only:
master

script:
- php -n -d memory_limit=768M ./vendor/bin/php-cs-fixer fix --dry-run -vv --rules=@PSR2 .
- (cd test ; ../vendor/bin/phpunit -c phpunit.xml --coverage-clover=../clover.xml)
- php -n -d memory_limit=768M ./vendor/bin/php-cs-fixer fix --dry-run -vv
- ./vendor/bin/phpunit --coverage-clover=./clover.xml

after_success:
- bash <(curl -s https://codecov.io/bash) -f ./clover.xml
Expand Down
69 changes: 69 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Changelog

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 2.3.1 - 2016-05-31

Final release. Please use [Apigility](https://apigility.org) instead.

### Added

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- [#136](https://github.com/phly/PhlyRestfully/pull/136) fixes autoloading and
configuration paths in the `Module` class, due to having moved into the source
tree.

## 2.3.0 - 2016-05-26

Final release. Please use [Apigility](https://apigility.org) instead.

### Added

- [#135](https://github.com/phly/PhlyRestfully/pull/135) adds an optional
`$data = []` parameter to `ResourceController::deleteList()` for consistency
with other methods.
- [#135](https://github.com/phly/PhlyRestfully/pull/135) adds support for PHP 7
and HHVM.
- [#107](https://github.com/phly/PhlyRestfully/pull/107) suggests using
zfr/zfr-cors to provide CORS support for your API.
- [#126](https://github.com/phly/PhlyRestfully/pull/126) adds an `__isset()`
method to `HalResource`, ensuring you can test for the identifier and/or
resource (e.g., via `isset($halResource->id)`).

### Deprecated

- Nothing.

### Removed

- [#135](https://github.com/phly/PhlyRestfully/pull/135) removes support for PHP
versions less than 5.5.

### Fixed

- [#135](https://github.com/phly/PhlyRestfully/pull/135) updates all references
to `Zend\Stdlib\Hydrator` to instead use `Zend\Hydrator`.
- [#135](https://github.com/phly/PhlyRestfully/pull/135) updates all
`trigger()` and `triggerUntil()` usage with forwards-compatible variants.
- [#97](https://github.com/phly/PhlyRestfully/pull/97) fixes the identifier
comparison in `ResourceController::getIdentifier()` to use a strict comparison
to boolean false, and thus allow identifiers of `0`.
- [#104](https://github.com/phly/PhlyRestfully/pull/104) corrects the logic in
`ResourceParametersListener::detachShared` to pass the identifier.
- [#108](https://github.com/phly/PhlyRestfully/pull/108) fixes identifier
detection in `HalLinks::createResourceFromMetadata()`, ensuring that if no
identifier name is present in the metadata, a null identifier is used.
- [#124](https://github.com/phly/PhlyRestfully/pull/124) fixes how HalLinks
retrieves the identifier from an object when it is not in an `id` field,
allowing for custom identifiers per entity.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@ PhlyRestfully: ZF2 Module for JSON REST Services
================================================
[![Build Status](https://travis-ci.org/diablomedia/PhlyRestfully.svg?branch=master)](https://travis-ci.org/diablomedia/PhlyRestfully) [![codecov](https://codecov.io/gh/diablomedia/PhlyRestfully/branch/master/graph/badge.svg)](https://codecov.io/gh/diablomedia/PhlyRestfully)

> ## ABANDONED
>
> As of the 2.3.0 release, I have marked this module as abandoned.
>
> The module very quickly proved that the approach was worthwhile and useful,
> and became the seed for [Apigility](https://apigility.org/). That project has
> far surpassed its origins in this module, and added a ton of functionality
> this module never managed to create, such as content negotiation, file upload
> handling, entity and collection hydration, and more.
>
> As such, I recommend using Apigility in favor of PhlyRestfully for new
> projects, and that existing projects migrate to Apigility when possible.
This module provides structure and code for quickly implementing RESTful APIs
that use JSON as a transport.

Expand Down
43 changes: 24 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,36 @@
}
],
"require": {
"php": ">=5.3.3",
"zendframework/zend-eventmanager": ">=2.2.0,<3.0.0",
"zendframework/zend-json": ">=2.2.0",
"zendframework/zend-loader": ">=2.2.0",
"zendframework/zend-mvc": ">=2.2.0,<3.0.0",
"zendframework/zend-paginator": ">=2.2.0",
"zendframework/zend-uri": ">=2.2.0",
"zendframework/zend-view": ">=2.2.0",
"zendframework/zend-stdlib": ">=2.7.0"
"php": ">=5.6",
"zendframework/zend-eventmanager": "^2.5,<3.0.0",
"zendframework/zend-json": "^2.5.0",
"zendframework/zend-loader": "^2.5.0",
"zendframework/zend-mvc": "^2.5.0,<3.0.0",
"zendframework/zend-paginator": "^2.5.0",
"zendframework/zend-uri": "^2.5.0",
"zendframework/zend-view": "^2.5.0",
"zendframework/zend-stdlib": "^2.5.0",
"zendframework/zend-hydrator": "^1.1"
},
"require-dev": {
"phpunit/PHPUnit": "^5.0",
"zendframework/zend-console": ">=2.2.0",
"zendframework/zend-http": ">=2.2.0",
"zendframework/zend-navigation": ">=2.2.0",
"zendframework/zend-servicemanager": ">=2.2.0,<3.0.0",
"zendframework/zend-console": "^2.5",
"zendframework/zend-http": "^2.5",
"zendframework/zend-navigation": "^2.5",
"zendframework/zend-servicemanager": "^2.5,<3.0.0",
"friendsofphp/php-cs-fixer": "^2.10"
},
"suggest": {
"zfr/zfr-cors": "zfr/zfr-cors provides CORS support"
},
"autoload": {
"psr-0": {
"PhlyRestfully\\": "src/",
"psr-4": {
"PhlyRestfully\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"PhlyRestfullyTest\\": "test/"
},
"classmap": [
"./"
]
}
}
}
8 changes: 4 additions & 4 deletions docs/api/phpdoc/classes/PhlyRestfully.Metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ <h3>Returns</h3>
</div>
<a id="method_getHydrator"></a><div class="element clickable method public method_getHydrator" data-toggle="collapse" data-target=".method_getHydrator .collapse">
<h2>Retrieve the hydrator to associate with this class, if any</h2>
<pre>getHydrator() : null | \Zend\Stdlib\Hydrator\HydratorInterface</pre>
<pre>getHydrator() : null | \Zend\Hydrator\HydratorInterface</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Returns</h3>
<div class="subelement response">
<code>null</code><code>\Zend\Stdlib\Hydrator\HydratorInterface</code>
<code>null</code><code>\Zend\Hydrator\HydratorInterface</code>
</div>
</div></div>
</div>
Expand Down Expand Up @@ -253,7 +253,7 @@ <h3>Returns</h3>
</div>
<a id="method_setHydrator"></a><div class="element clickable method public method_setHydrator" data-toggle="collapse" data-target=".method_setHydrator .collapse">
<h2>Set the hydrator to use with this class</h2>
<pre>setHydrator(string | \Zend\Stdlib\Hydrator\HydratorInterface $hydrator) : <a href="../classes/PhlyRestfully.Metadata.html">\PhlyRestfully\Metadata</a></pre>
<pre>setHydrator(string | \Zend\Hydrator\HydratorInterface $hydrator) : <a href="../classes/PhlyRestfully.Metadata.html">\PhlyRestfully\Metadata</a></pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
Expand All @@ -264,7 +264,7 @@ <h2>Set the hydrator to use with this class</h2>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$hydrator</h4>
<code>string</code><code>\Zend\Stdlib\Hydrator\HydratorInterface</code>
<code>string</code><code>\Zend\Hydrator\HydratorInterface</code>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
Expand Down
12 changes: 6 additions & 6 deletions docs/api/phpdoc/classes/PhlyRestfully.Plugin.HalLinks.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ <h3>
<i class="icon-custom icon-method"></i> Methods</h3>
<a id="method_addHydrator"></a><div class="element clickable method public method_addHydrator" data-toggle="collapse" data-target=".method_addHydrator .collapse">
<h2>Map a resource class to a specific hydrator instance</h2>
<pre>addHydrator(string $class, \Zend\Stdlib\Hydrator\HydratorInterface $hydrator) : \PhlyRestfully\Plugin\RestfulJsonRenderer</pre>
<pre>addHydrator(string $class, \Zend\Hydrator\HydratorInterface $hydrator) : \PhlyRestfully\Plugin\RestfulJsonRenderer</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
Expand All @@ -121,7 +121,7 @@ <h4>$class</h4>
</div>
<div class="subelement argument">
<h4>$hydrator</h4>
<code>\Zend\Stdlib\Hydrator\HydratorInterface</code>
<code>\Zend\Hydrator\HydratorInterface</code>
</div>
<h3>Returns</h3>
<div class="subelement response"><code>\PhlyRestfully\Plugin\RestfulJsonRenderer</code></div>
Expand Down Expand Up @@ -288,7 +288,7 @@ <h3>Returns</h3>
</div>
<a id="method_getHydratorForResource"></a><div class="element clickable method public method_getHydratorForResource" data-toggle="collapse" data-target=".method_getHydratorForResource .collapse">
<h2>Retrieve a hydrator for a given resource</h2>
<pre>getHydratorForResource(object $resource) : \Zend\Stdlib\Hydrator\HydratorInterface | false</pre>
<pre>getHydratorForResource(object $resource) : \Zend\Hydrator\HydratorInterface | false</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>If the resource has a mapped hydrator, returns that hydrator. If not, and
Expand All @@ -301,7 +301,7 @@ <h4>$resource</h4>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>\Zend\Stdlib\Hydrator\HydratorInterface</code><code>false</code>
<code>\Zend\Hydrator\HydratorInterface</code><code>false</code>
</div>
</div></div>
</div>
Expand Down Expand Up @@ -410,14 +410,14 @@ <h4>$controller</h4>
</div>
<a id="method_setDefaultHydrator"></a><div class="element clickable method public method_setDefaultHydrator" data-toggle="collapse" data-target=".method_setDefaultHydrator .collapse">
<h2>Set the default hydrator to use if none specified for a class.</h2>
<pre>setDefaultHydrator(\Zend\Stdlib\Hydrator\HydratorInterface $hydrator) : \PhlyRestfully\Plugin\RestfulJsonRenderer</pre>
<pre>setDefaultHydrator(\Zend\Hydrator\HydratorInterface $hydrator) : \PhlyRestfully\Plugin\RestfulJsonRenderer</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$hydrator</h4>
<code>\Zend\Stdlib\Hydrator\HydratorInterface</code>
<code>\Zend\Hydrator\HydratorInterface</code>
</div>
<h3>Returns</h3>
<div class="subelement response"><code>\PhlyRestfully\Plugin\RestfulJsonRenderer</code></div>
Expand Down
24 changes: 12 additions & 12 deletions docs/api/phpdoc/structure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1327,9 +1327,9 @@ underscores.&lt;/p&gt;
<docblock line="127">
<description>Retrieve the hydrator to associate with this class, if any</description>
<long-description></long-description>
<tag line="127" name="return" description="" type="null|\Zend\Stdlib\Hydrator\HydratorInterface">
<tag line="127" name="return" description="" type="null|\Zend\Hydrator\HydratorInterface">
<type by_reference="false">null</type>
<type by_reference="false">\Zend\Stdlib\Hydrator\HydratorInterface</type>
<type by_reference="false">\Zend\Hydrator\HydratorInterface</type>
</tag>
</docblock>
</method>
Expand Down Expand Up @@ -1452,9 +1452,9 @@ underscores.&lt;/p&gt;
<docblock line="246">
<description>Set the hydrator to use with this class</description>
<long-description></long-description>
<tag line="246" name="param" description="" type="string|\Zend\Stdlib\Hydrator\HydratorInterface" variable="$hydrator">
<tag line="246" name="param" description="" type="string|\Zend\Hydrator\HydratorInterface" variable="$hydrator">
<type by_reference="false">string</type>
<type by_reference="false">\Zend\Stdlib\Hydrator\HydratorInterface</type>
<type by_reference="false">\Zend\Hydrator\HydratorInterface</type>
</tag>
<tag line="246" name="return" description="" type="self">
<type by_reference="false">self</type>
Expand Down Expand Up @@ -3691,8 +3691,8 @@ replaced with a RestfulJsonModel containing an API-Problem payload.&lt;/p&gt;</l
<tag line="194" name="param" description="" type="string" variable="$class">
<type by_reference="false">string</type>
</tag>
<tag line="194" name="param" description="" type="\Zend\Stdlib\Hydrator\HydratorInterface" variable="$hydrator">
<type by_reference="false">\Zend\Stdlib\Hydrator\HydratorInterface</type>
<tag line="194" name="param" description="" type="\Zend\Hydrator\HydratorInterface" variable="$hydrator">
<type by_reference="false">\Zend\Hydrator\HydratorInterface</type>
</tag>
<tag line="194" name="return" description="" type="\PhlyRestfully\Plugin\RestfulJsonRenderer">
<type by_reference="false">\PhlyRestfully\Plugin\RestfulJsonRenderer</type>
Expand All @@ -3706,7 +3706,7 @@ replaced with a RestfulJsonModel containing an API-Problem payload.&lt;/p&gt;</l
<argument line="201">
<name>$hydrator</name>
<default></default>
<type>\Zend\Stdlib\Hydrator\HydratorInterface</type>
<type>\Zend\Hydrator\HydratorInterface</type>
</argument>
</method>
<method final="false" abstract="false" static="false" visibility="public" namespace="PhlyRestfully\Plugin" line="213" package="Default">
Expand All @@ -3715,8 +3715,8 @@ replaced with a RestfulJsonModel containing an API-Problem payload.&lt;/p&gt;</l
<docblock line="207">
<description>Set the default hydrator to use if none specified for a class.</description>
<long-description></long-description>
<tag line="207" name="param" description="" type="\Zend\Stdlib\Hydrator\HydratorInterface" variable="$hydrator">
<type by_reference="false">\Zend\Stdlib\Hydrator\HydratorInterface</type>
<tag line="207" name="param" description="" type="\Zend\Hydrator\HydratorInterface" variable="$hydrator">
<type by_reference="false">\Zend\Hydrator\HydratorInterface</type>
</tag>
<tag line="207" name="return" description="" type="\PhlyRestfully\Plugin\RestfulJsonRenderer">
<type by_reference="false">\PhlyRestfully\Plugin\RestfulJsonRenderer</type>
Expand All @@ -3725,7 +3725,7 @@ replaced with a RestfulJsonModel containing an API-Problem payload.&lt;/p&gt;</l
<argument line="213">
<name>$hydrator</name>
<default></default>
<type>\Zend\Stdlib\Hydrator\HydratorInterface</type>
<type>\Zend\Hydrator\HydratorInterface</type>
</argument>
</method>
<method final="false" abstract="false" static="false" visibility="public" namespace="PhlyRestfully\Plugin" line="229" package="Default">
Expand All @@ -3739,8 +3739,8 @@ Otherwise, a boolean false is returned.&lt;/p&gt;</long-description>
<tag line="219" name="param" description="" type="object" variable="$resource">
<type by_reference="false">object</type>
</tag>
<tag line="219" name="return" description="" type="\Zend\Stdlib\Hydrator\HydratorInterface|false">
<type by_reference="false">\Zend\Stdlib\Hydrator\HydratorInterface</type>
<tag line="219" name="return" description="" type="\Zend\Hydrator\HydratorInterface|false">
<type by_reference="false">\Zend\Hydrator\HydratorInterface</type>
<type by_reference="false">false</type>
</tag>
</docblock>
Expand Down
4 changes: 2 additions & 2 deletions docs/basics/controllers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ following:
$persistence = $services->get('PastePersistenceListener');
$events = $services->get('EventManager');
$events->setIdentifiers('PasteResource`);
$events->setIdentifiers('PasteResource');
$events->attach($persistence);
$resource = new PhlyRestfully\Resource();
$resource->setEventManager($events);
$controller = new PhlyRestfully\ResourceController('PasteController`);
$controller = new PhlyRestfully\ResourceController('PasteController');
$controller->setResource($resource);
$controller->setRoute('paste/api');
$controller->setCollectionName('pastes');
Expand Down
Loading

0 comments on commit f375bde

Please sign in to comment.