Skip to content

Commit b97e804

Browse files
committed
Merge branch 'hotfix/tooling'
Close #1 Close #4 Close #5 Close #6 Close #7
2 parents 8bbf765 + 16c0ac2 commit b97e804

10 files changed

+10
-286
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/docs export-ignore
22
/test export-ignore
3+
/.coveralls.yml export-ignore
34
/.gitattributes export-ignore
45
/.gitignore export-ignore
56
/.travis.yml export-ignore
7+
/composer.lock export-ignore
68
/mkdocs.yml export-ignore
79
/phpcs.xml export-ignore
810
/phpunit.xml.dist export-ignore

CONDUCT.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 0 additions & 218 deletions
This file was deleted.

phpunit.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
bootstrap="vendor/autoload.php"
55
colors="true">
66
<testsuites>
7-
<testsuite name="zend-expressive-cache">
7+
<testsuite name="zend-expressive-authorization">
88
<directory>./test</directory>
99
</testsuite>
1010
</testsuites>
1111

1212
<filter>
13-
<whitelist>
13+
<whitelist processUncoveredFilesFromWhitelist="true">
1414
<directory suffix=".php">./src</directory>
1515
</whitelist>
1616
</filter>

src/AuthorizationInterface.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ interface AuthorizationInterface
1313
{
1414
/**
1515
* Check if a role is granted for the request
16-
*
17-
* @param string $role
18-
* @param ServerRequestInterface $request
19-
* @return bool
2016
*/
21-
public function isGranted(string $role, ServerRequestInterface $request): bool;
17+
public function isGranted(string $role, ServerRequestInterface $request) : bool;
2218
}

src/AuthorizationMiddleware.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ class AuthorizationMiddleware implements ServerMiddlewareInterface
2424
*/
2525
private $responsePrototype;
2626

27-
/**
28-
* Constructor
29-
*
30-
* @param Rbac $rbac
31-
* @param MiddlewareAssertionInterface $assertion
32-
* @return void
33-
*/
3427
public function __construct(AuthorizationInterface $authorization, ResponseInterface $responsePrototype)
3528
{
3629
$this->authorization = $authorization;

src/AuthorizationMiddlewareFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Psr\Container\ContainerInterface;
1111
use Psr\Http\Message\ResponseInterface;
1212
use Zend\Diactoros\Response;
13-
use Zend\Expressive\Authorization\AuthorizationInterface;
1413

1514
class AuthorizationMiddlewareFactory
1615
{

src/ConfigProvider.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
namespace Zend\Expressive\Authorization;
99

10-
use Zend\Permission\Rbac\Rbac;
11-
1210
class ConfigProvider
1311
{
1412
/**

src/Exception/InvalidConfigException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22
/**
3-
* @see https://github.com/zendframework/zend-expressive-cache for the canonical source repository
3+
* @see https://github.com/zendframework/zend-expressive-authorization for the canonical source repository
44
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)
5-
* @license https://github.com/zendframework/zend-expressive-cache/blob/master/LICENSE.md New BSD License
5+
* @license https://github.com/zendframework/zend-expressive-authorization/blob/master/LICENSE.md New BSD License
66
*/
77

88
namespace Zend\Expressive\Authorization\Exception;

test/AuthorizationMiddlewareFactoryTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Zend\Expressive\Authorization\AuthorizationInterface;
1414
use Zend\Expressive\Authorization\AuthorizationMiddleware;
1515
use Zend\Expressive\Authorization\AuthorizationMiddlewareFactory;
16+
use Zend\Expressive\Authorization\Exception;
1617

1718
class AuthorizationMiddlewareFactoryTest extends TestCase
1819
{
@@ -31,24 +32,20 @@ protected function setUp()
3132
->will([$this->response, 'reveal']);
3233
}
3334

34-
/**
35-
* @expectedException Zend\Expressive\Authorization\Exception\InvalidConfigException
36-
*/
3735
public function testFactoryWithoutAuthorization()
3836
{
3937
$this->container->has(AuthorizationInterface::class)->willReturn(false);
4038

39+
$this->expectException(Exception\InvalidConfigException::class);
4140
$middleware = ($this->factory)($this->container->reveal());
4241
}
4342

44-
/**
45-
* @expectedException Zend\Expressive\Authorization\Exception\InvalidConfigException
46-
*/
4743
public function testFactoryWithoutResponsePrototype()
4844
{
4945
$this->container->has(AuthorizationInterface::class)->willReturn(true);
5046
$this->container->has(ResponseInterface::class)->willReturn(false);
5147

48+
$this->expectException(Exception\InvalidConfigException::class);
5249
$middleware = ($this->factory)($this->container->reveal());
5350
}
5451

0 commit comments

Comments
 (0)