Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commit 796375c

Browse files
committed
Merge branch 'hotfix/10'
Close #10
2 parents 825c952 + d8aa351 commit 796375c

File tree

8 files changed

+51
-34
lines changed

8 files changed

+51
-34
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ install:
2828
- composer info -i
2929

3030
script:
31-
- ./vendor/bin/phpunit
32-
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/phpcs ; fi
31+
- composer test
32+
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then composer cs ; fi
3333

3434
notifications:
3535
email: true

CHANGELOG.md

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

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

5-
## 0.3.0 - TBD
5+
## 0.3.0 - 2015-12-02
66

77
### Added
88

@@ -37,6 +37,10 @@ All notable changes to this project will be documented in this file, in reverse
3737

3838
- [#6](https://github.com/zendframework/zend-expressive-zendviewrenderer/pull/6)
3939
Merge route result params with those provided
40+
- [#10](https://github.com/zendframework/zend-expressive-zendviewrenderer/pull/10)
41+
updates the code to depend on [zendframework/zend-expressive-template](https://github.com/zendframework/zend-expressive-template)
42+
and [zendframework/zend-expressive-router](https://github.com/zendframework/zend-expressive-router)
43+
instead of zendframework/zend-expressive.
4044

4145
## 0.2.0 - 2015-10-20
4246

CONTRIBUTING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ To run tests:
5454

5555
If you don't have `curl` installed, you can also download `composer.phar` from https://getcomposer.org/
5656

57-
- Run the tests via `phpunit` and the provided PHPUnit config, like in this example:
57+
- Run the tests using the "test" command shipped in the `composer.json`:
5858

5959
```console
60-
$ ./vendor/bin/phpunit
60+
$ composer test
6161
```
6262

63-
You can turn on conditional tests with the phpunit.xml file.
63+
You can turn on conditional tests with the `phpunit.xml` file.
6464
To do so:
6565

6666
- Copy `phpunit.xml.dist` file to `phpunit.xml`
@@ -69,24 +69,23 @@ To do so:
6969

7070
## Running Coding Standards Checks
7171

72-
This component uses [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) for coding
73-
standards checks, and provides configuration for our selected checks.
74-
`phpcs` is installed by default via Composer.
72+
First, ensure you've installed dependencies via composer, per the previous
73+
section on running tests.
7574

76-
To run checks only:
75+
To run CS checks only:
7776

7877
```console
79-
$ ./vendor/bin/phpcs
78+
$ composer cs
8079
```
8180

82-
`phpcs` also includes a tool for fixing most CS violations, `phpcbf`:
81+
To attempt to automatically fix common CS issues:
8382

8483

8584
```console
86-
$ ./vendor/bin/phpcbf
85+
$ composer cs-fix
8786
```
8887

89-
If you allow `phpcbf` to fix CS issues, please re-run the tests to ensure
88+
If the above fixes any CS issues, please re-run the tests to ensure
9089
they pass, and make sure you add and commit the changes after verification.
9190

9291
## Recommended Workflow for Contributions
@@ -219,3 +218,4 @@ repository, we suggest doing some cleanup of these branches.
219218
```console
220219
$ git push {username} :<branchname>
221220
```
221+

composer.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,19 @@
1919
"require": {
2020
"php": ">=5.5",
2121
"container-interop/container-interop": "^1.1",
22-
"zendframework/zend-expressive": "~1.0.0-dev@dev",
22+
"psr/http-message": "^1.0",
23+
"zendframework/zend-expressive-router": "^1.0",
24+
"zendframework/zend-expressive-template": "^1.0.1",
2325
"zendframework/zend-filter": "^2.5",
2426
"zendframework/zend-i18n": "^2.5",
2527
"zendframework/zend-servicemanager": "^2.5",
2628
"zendframework/zend-view": "^2.5"
2729
},
2830
"require-dev": {
2931
"phpunit/phpunit": "^4.7",
30-
"squizlabs/php_codesniffer": "^2.3"
32+
"squizlabs/php_codesniffer": "^2.3",
33+
"zendframework/zend-diactoros": "^1.2",
34+
"zendframework/zend-expressive": "~1.0.0-dev@dev"
3135
},
3236
"autoload": {
3337
"psr-4": {
@@ -41,6 +45,16 @@
4145
},
4246
"suggest": {
4347
"mouf/pimple-interop": "^1.0 to use Pimple for dependency injection",
44-
"aura/di": "3.0.*@beta to make use of Aura.Di dependency injection container"
48+
"aura/di": "3.0.*@beta to make use of Aura.Di dependency injection container",
49+
"zendframework/zend-expressive": "^1.0 if you wish to use the ApplicationUrlDelegatorFactory"
50+
},
51+
"scripts": {
52+
"check": [
53+
"@cs",
54+
"@test"
55+
],
56+
"cs": "phpcs",
57+
"cs-fix": "phpcbf",
58+
"test": "phpunit"
4559
}
4660
}

src/UrlHelper.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77

88
namespace Zend\Expressive\ZendView;
99

10-
use Zend\Expressive\Exception;
10+
use Zend\Expressive\Router\Exception\RuntimeException;
1111
use Zend\Expressive\Router\RouterInterface;
1212
use Zend\Expressive\Router\RouteResult;
1313
use Zend\Expressive\Router\RouteResultObserverInterface;
14+
use Zend\Expressive\Template\Exception\RenderingException;
1415
use Zend\View\Helper\AbstractHelper;
1516

1617
class UrlHelper extends AbstractHelper implements RouteResultObserverInterface
@@ -37,17 +38,16 @@ public function __construct(RouterInterface $router)
3738
* @param string $route
3839
* @param array $params
3940
* @return string
40-
* @throws Exception\RenderingException if no route provided, and no result
41-
* match present.
42-
* @throws Exception\RenderingException if no route provided, and result
43-
* match is a routing failure.
44-
* @throws Exception\RuntimeException if router cannot generate URI for
45-
* given route.
41+
* @throws RenderingException if no route provided, and no result match
42+
* present.
43+
* @throws RenderingException if no route provided, and result match is a
44+
* routing failure.
45+
* @throws RuntimeException if router cannot generate URI for given route.
4646
*/
4747
public function __invoke($route = null, $params = [])
4848
{
4949
if ($route === null && $this->result === null) {
50-
throw new Exception\RenderingException(
50+
throw new RenderingException(
5151
'Attempting to use matched result when none was injected; aborting'
5252
);
5353
}
@@ -82,13 +82,12 @@ public function setRouteResult(RouteResult $result)
8282
/**
8383
* @param array $params
8484
* @return string
85-
* @throws Exception\RenderingException if current result is a routing
86-
* failure.
85+
* @throws RenderingException if current result is a routing failure.
8786
*/
8887
private function generateUriFromResult(array $params)
8988
{
9089
if ($this->result->isFailure()) {
91-
throw new Exception\RenderingException(
90+
throw new RenderingException(
9291
'Attempting to use matched result when routing failed; aborting'
9392
);
9493
}

src/ZendViewRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
namespace Zend\Expressive\ZendView;
1111

12-
use Zend\Expressive\Exception;
1312
use Zend\Expressive\Template\ArrayParametersTrait;
1413
use Zend\Expressive\Template\DefaultParamsTrait;
14+
use Zend\Expressive\Template\Exception;
1515
use Zend\Expressive\Template\TemplatePath;
1616
use Zend\Expressive\Template\TemplateRendererInterface;
1717
use Zend\View\Model\ModelInterface;

test/UrlHelperTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111

1212
use ArrayObject;
1313
use PHPUnit_Framework_TestCase as TestCase;
14-
use Zend\Expressive\Exception;
14+
use Zend\Expressive\Router\Exception\RuntimeException;
1515
use Zend\Expressive\Router\RouterInterface;
1616
use Zend\Expressive\Router\RouteResult;
1717
use Zend\Expressive\Router\RouteResultObserverInterface;
18+
use Zend\Expressive\Template\Exception;
1819
use Zend\Expressive\ZendView\UrlHelper;
1920

2021
class UrlHelperTest extends TestCase
@@ -48,9 +49,9 @@ public function testRaisesExceptionOnInvocationIfNoRouteProvidedAndResultIndicat
4849

4950
public function testRaisesExceptionOnInvocationIfRouterCannotGenerateUriForRouteProvided()
5051
{
51-
$this->router->generateUri('foo', [])->willThrow(Exception\RuntimeException::class);
52+
$this->router->generateUri('foo', [])->willThrow(RuntimeException::class);
5253
$helper = $this->createHelper();
53-
$this->setExpectedException(Exception\RuntimeException::class);
54+
$this->setExpectedException(RuntimeException::class);
5455
$helper('foo');
5556
}
5657

test/ZendViewRendererTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212
use ArrayObject;
1313
use PHPUnit_Framework_TestCase as TestCase;
14-
use Zend\Expressive\Exception;
15-
use Zend\Expressive\Exception\InvalidArgumentException;
14+
use Zend\Expressive\Template\Exception\InvalidArgumentException;
1615
use Zend\Expressive\Template\TemplatePath;
1716
use Zend\Expressive\ZendView\ZendViewRenderer;
1817
use Zend\View\Model\ViewModel;

0 commit comments

Comments
 (0)