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

Commit 14a1b51

Browse files
committed
Apply cs fixes
1 parent c342542 commit 14a1b51

File tree

7 files changed

+31
-13
lines changed

7 files changed

+31
-13
lines changed

src/Exception/DomainException.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)
55
* @license http://framework.zend.com/license/new-bsd New BSD License
66
*/
7+
78
declare(strict_types=1);
89

910
namespace Zend\Router\Exception;

src/PartialRouteInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (http://www.zend.com)
55
* @license https://github.com/zendframework/zend-router/blob/master/LICENSE.md New BSD License
66
*/
7+
78
declare(strict_types=1);
89

910
namespace Zend\Router;

src/RouteInterface.php

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

1010
namespace Zend\Router;
1111

12-
use Psr\Http\Message\UriInterface;
1312
use Psr\Http\Message\ServerRequestInterface as Request;
13+
use Psr\Http\Message\UriInterface;
1414

1515
/**
1616
* RouteInterface interface.

src/RouteMatch.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ public function __construct(array $params)
4242
$this->params = $params;
4343
}
4444

45+
/**
46+
* @throws RuntimeException
47+
*/
4548
public static function fromRouteResult(RouteResult $result) : self
4649
{
4750
if (! $result->isSuccess()) {
@@ -102,7 +105,7 @@ public function getParams()
102105
* Get a specific parameter.
103106
*
104107
* @param string $name
105-
* @param null|mixed $default
108+
* @param mixed $default
106109
* @return mixed
107110
*/
108111
public function getParam($name, $default = null)

src/RouteResult.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ public static function fromRouteFailure() : self
7474
/**
7575
* Create routing failure result where http method is not allowed for the
7676
* otherwise routable request
77+
*
78+
* @throws DomainException
7779
*/
7880
public static function fromMethodFailure(array $allowedMethods) : self
7981
{
@@ -121,6 +123,8 @@ public function isMethodFailure() : bool
121123
* - {@see RouteResult::NAME_REPLACE} replaces existing route name
122124
* - {@see RouteResult::NAME_PREPEND} prepends as a parent route part name.
123125
* - {@see RouteResult::NAME_APPEND} appends as a child route part name.
126+
* @throws DomainException
127+
* @throws RuntimeException
124128
*/
125129
public function withMatchedRouteName(string $routeName, $flag = self::NAME_REPLACE) : self
126130
{
@@ -153,6 +157,8 @@ public function withMatchedRouteName(string $routeName, $flag = self::NAME_REPLA
153157
/**
154158
* Produce a new route result with provided matched parameters. Can only be
155159
* used with successful result.
160+
*
161+
* @throws RuntimeException
156162
*/
157163
public function withMatchedParams(array $params) : self
158164
{

test/FactoryTester.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ class FactoryTester
2626

2727
/**
2828
* Create a new factory tester.
29-
*
30-
* @param TestCase $testCase
3129
*/
3230
public function __construct(TestCase $testCase)
3331
{
@@ -36,11 +34,8 @@ public function __construct(TestCase $testCase)
3634

3735
/**
3836
* Test a factory.
39-
*
40-
* @param string $className
41-
* @return void
4237
*/
43-
public function testFactory($classname, array $requiredOptions, array $options)
38+
public function testFactory(string $classname, array $requiredOptions, array $options) : void
4439
{
4540
// Test required options.
4641
foreach ($requiredOptions as $option => $exceptionMessage) {

test/Route/TestAsset/RouteTestDefinition.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ final class RouteTestDefinition
3535
private $matchRequest;
3636

3737
/**
38-
* @var ?RouteResult
38+
* @var null|RouteResult
3939
*/
4040
private $matchResult;
4141

4242
/**
43-
* @var ?PartialRouteResult
43+
* @var null|PartialRouteResult
4444
*/
4545
private $partialMatchResult;
4646

@@ -55,12 +55,12 @@ final class RouteTestDefinition
5555
private $matchOptions = [];
5656

5757
/**
58-
* @var ?UriInterface
58+
* @var null|UriInterface
5959
*/
6060
private $assembleWithUri;
6161

6262
/**
63-
* @var ?UriInterface
63+
* @var null|UriInterface
6464
*/
6565
private $assembleResult;
6666

@@ -74,6 +74,10 @@ final class RouteTestDefinition
7474
*/
7575
private $assembleOptions = [];
7676

77+
/**
78+
* @param ServerRequestInterface|UriInterface $requestOrUriToMatch
79+
* @throws Exception
80+
*/
7781
public function __construct(RouteInterface $route, $requestOrUriToMatch)
7882
{
7983
$this->route = $route;
@@ -102,6 +106,9 @@ public function expectMatchResult(RouteResult $result) : self
102106
return $this;
103107
}
104108

109+
/**
110+
* @throws Exception
111+
*/
105112
public function getExpectedMatchResult() : RouteResult
106113
{
107114
if (! $this->matchResult) {
@@ -112,7 +119,9 @@ public function getExpectedMatchResult() : RouteResult
112119
return $this->matchResult;
113120
}
114121

115-
122+
/**
123+
* @throws Exception
124+
*/
116125
public function expectPartialMatchResult(PartialRouteResult $result) : self
117126
{
118127
if (! $this->route instanceof PartialRouteInterface) {
@@ -123,6 +132,9 @@ public function expectPartialMatchResult(PartialRouteResult $result) : self
123132
return $this;
124133
}
125134

135+
/**
136+
* @throws Exception
137+
*/
126138
public function getExpectedPartialMatchResult() : PartialRouteResult
127139
{
128140
if (! $this->route instanceof PartialRouteInterface) {

0 commit comments

Comments
 (0)