Skip to content

Commit

Permalink
Merge branch 'hotfix/tooling'
Browse files Browse the repository at this point in the history
Close #1
Close #4
Close #5
Close #6
Close #7
  • Loading branch information
weierophinney committed Oct 2, 2017
2 parents 8bbf765 + 16c0ac2 commit b97e804
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 286 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/docs export-ignore
/test export-ignore
/.coveralls.yml export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/composer.lock export-ignore
/mkdocs.yml export-ignore
/phpcs.xml export-ignore
/phpunit.xml.dist export-ignore
43 changes: 0 additions & 43 deletions CONDUCT.md

This file was deleted.

218 changes: 0 additions & 218 deletions CONTRIBUTING.md

This file was deleted.

4 changes: 2 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="zend-expressive-cache">
<testsuite name="zend-expressive-authorization">
<directory>./test</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
Expand Down
6 changes: 1 addition & 5 deletions src/AuthorizationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ interface AuthorizationInterface
{
/**
* Check if a role is granted for the request
*
* @param string $role
* @param ServerRequestInterface $request
* @return bool
*/
public function isGranted(string $role, ServerRequestInterface $request): bool;
public function isGranted(string $role, ServerRequestInterface $request) : bool;
}
7 changes: 0 additions & 7 deletions src/AuthorizationMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ class AuthorizationMiddleware implements ServerMiddlewareInterface
*/
private $responsePrototype;

/**
* Constructor
*
* @param Rbac $rbac
* @param MiddlewareAssertionInterface $assertion
* @return void
*/
public function __construct(AuthorizationInterface $authorization, ResponseInterface $responsePrototype)
{
$this->authorization = $authorization;
Expand Down
1 change: 0 additions & 1 deletion src/AuthorizationMiddlewareFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseInterface;
use Zend\Diactoros\Response;
use Zend\Expressive\Authorization\AuthorizationInterface;

class AuthorizationMiddlewareFactory
{
Expand Down
2 changes: 0 additions & 2 deletions src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

namespace Zend\Expressive\Authorization;

use Zend\Permission\Rbac\Rbac;

class ConfigProvider
{
/**
Expand Down
4 changes: 2 additions & 2 deletions src/Exception/InvalidConfigException.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* @see https://github.com/zendframework/zend-expressive-cache for the canonical source repository
* @see https://github.com/zendframework/zend-expressive-authorization for the canonical source repository
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)
* @license https://github.com/zendframework/zend-expressive-cache/blob/master/LICENSE.md New BSD License
* @license https://github.com/zendframework/zend-expressive-authorization/blob/master/LICENSE.md New BSD License
*/

namespace Zend\Expressive\Authorization\Exception;
Expand Down
9 changes: 3 additions & 6 deletions test/AuthorizationMiddlewareFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Zend\Expressive\Authorization\AuthorizationInterface;
use Zend\Expressive\Authorization\AuthorizationMiddleware;
use Zend\Expressive\Authorization\AuthorizationMiddlewareFactory;
use Zend\Expressive\Authorization\Exception;

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

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

$this->expectException(Exception\InvalidConfigException::class);
$middleware = ($this->factory)($this->container->reveal());
}

/**
* @expectedException Zend\Expressive\Authorization\Exception\InvalidConfigException
*/
public function testFactoryWithoutResponsePrototype()
{
$this->container->has(AuthorizationInterface::class)->willReturn(true);
$this->container->has(ResponseInterface::class)->willReturn(false);

$this->expectException(Exception\InvalidConfigException::class);
$middleware = ($this->factory)($this->container->reveal());
}

Expand Down

0 comments on commit b97e804

Please sign in to comment.