Skip to content

Commit

Permalink
Merge pull request #10 from nazg-hack/feature/psr15-implementation
Browse files Browse the repository at this point in the history
Feature/psr15 implementation
  • Loading branch information
ytake authored Jan 23, 2018
2 parents 850aea9 + 190fbcc commit a68c066
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 27 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Nazg Micro Framework Core Repository

[![Build Status](https://travis-ci.org/nazg-hack/framework.svg?branch=master)](https://travis-ci.org/nazg-hack/framework)
[![Packagist](https://img.shields.io/badge/HHVM-%3E=3.24-orange.svg?style=flat-square)](https://packagist.org/packages/nazg/framework)
[![Packagist](https://img.shields.io/packagist/l/nazg/framework.svg?style=flat-square)](https://packagist.org/packages/nazg/framework)
[![Build Status](http://img.shields.io/travis/nazg-hack/framework/master.svg?style=flat-square)](https://travis-ci.org/nazg-hack/framework)

Http Application / Microframework for HHVM/Hack

Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@
"hack-psr/psr7-http-message-hhi": "^1.0.0",
"ytake/hh-container": "^0.5",
"ytake/hh-config-aggregator": "^0.1.1",
"nazg/heredity": "^0.2.0",
"nazg/heredity": "^0.2.1",
"facebook/hack-router": "^0.11",
"zendframework/zend-diactoros": "^1.6.1",
"monolog/monolog": "^1.23.0",
"libreworks/psr3-log-hhi": "^1.0.1"
"libreworks/psr3-log-hhi": "^1.0.1",
"ytake/psr-http-handlers-hhi": "^1.1.0",
"ytake/psr-container-hhi": "^1.1.0"
},
"require-dev": {
"phpunit/phpunit": "^5.1",
Expand Down
4 changes: 2 additions & 2 deletions src/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
use Nazg\Foundation\Middleware\Dispatcher;
use Nazg\Foundation\Bootstrap\BootstrapRegister;
use Nazg\Foundation\Dependency\DependencyInterface;
use Interop\Http\Server\RequestHandlerInterface;
use Interop\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Container\ContainerInterface;
Expand Down
4 changes: 2 additions & 2 deletions src/Foundation/Middleware/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use Nazg\Foundation\Validation\Attribute;
use Nazg\Foundation\Validation\Validator;
use Nazg\Foundation\Validation\ValidatorFactory;
use Interop\Http\Server\MiddlewareInterface;
use Interop\Http\Server\RequestHandlerInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
Expand Down
4 changes: 2 additions & 2 deletions src/Middleware/LogExceptionMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
use Psr\Log\LoggerInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Interop\Http\Server\MiddlewareInterface;
use Interop\Http\Server\RequestHandlerInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;

class LogExceptionMiddleware implements MiddlewareInterface {

Expand Down
4 changes: 2 additions & 2 deletions src/Middleware/SimpleCorsMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
use Psr\Log\LoggerInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Interop\Http\Server\MiddlewareInterface;
use Interop\Http\Server\RequestHandlerInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;

type CorsSetting = shape(
'origin' => string,
Expand Down
4 changes: 2 additions & 2 deletions src/RequestHandler/FallbackHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
*/
namespace Nazg\RequestHandler;

use Interop\Http\Server\RequestHandlerInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Diactoros\Response\JsonResponse;

class FallbackHandler implements RequestHandlerInterface {
Expand Down
2 changes: 1 addition & 1 deletion src/Routing/RouteServiceModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use Nazg\Exceptions\NotFoundHttpException;
use Facebook\HackRouter\BaseRouter;
use Facebook\HackRouter\HttpMethod as HackRouterHttpMethod;
use Interop\Http\Server\MiddlewareInterface;
use Psr\Http\Server\MiddlewareInterface;

class RouteServiceModule extends ServiceModule {
<<__Override>>
Expand Down
2 changes: 1 addition & 1 deletion src/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use Nazg\Http\HttpMethod;
use Facebook\HackRouter\BaseRouter;
use Facebook\HackRouter\HttpMethod as HackRouterHttpMethod;
use Interop\Http\Server\MiddlewareInterface;
use Psr\Http\Server\MiddlewareInterface;

type TResponder = ImmVector<classname<MiddlewareInterface>>;
type ImmRouteMap = ImmMap<HttpMethod, ImmMap<string, TResponder>>;
Expand Down
2 changes: 1 addition & 1 deletion src/types.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
*/
namespace Nazg\Types;

type TMiddlewareClass = classname<\Interop\Http\Server\MiddlewareInterface>;
type TMiddlewareClass = classname<\Psr\Http\Server\MiddlewareInterface>;
type TServiceModule = classname<\Ytake\HHContainer\ServiceModule>;
4 changes: 2 additions & 2 deletions tests/Action/IndexAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use NazgTest\Responder\IndexResponder;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Interop\Http\Server\MiddlewareInterface;
use Interop\Http\Server\RequestHandlerInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;

final class IndexAction implements MiddlewareInterface {
public function process(
Expand Down
4 changes: 2 additions & 2 deletions tests/Action/ParameterAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Interop\Http\Server\MiddlewareInterface;
use Interop\Http\Server\RequestHandlerInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Diactoros\Response\JsonResponse;

final class ParameterAction implements MiddlewareInterface {
Expand Down
4 changes: 2 additions & 2 deletions tests/Action/ValidateAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use Nazg\Foundation\Validation\Attribute;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Interop\Http\Server\MiddlewareInterface;
use Interop\Http\Server\RequestHandlerInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Diactoros\Response\JsonResponse;
use NazgTest\Validation\MockValidateActionFaild;

Expand Down
4 changes: 2 additions & 2 deletions tests/Middleware/FakeAttributeMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace NazgTest\Middleware;

use Interop\Http\Server\MiddlewareInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Interop\Http\Server\RequestHandlerInterface;
use Psr\Http\Server\RequestHandlerInterface;

class FakeAttributeMiddleware implements MiddlewareInterface {
public function process(
Expand Down
4 changes: 2 additions & 2 deletions tests/Middleware/FakeThrowExceptionMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace NazgTest\Middleware;

use Interop\Http\Server\MiddlewareInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Interop\Http\Server\RequestHandlerInterface;
use Psr\Http\Server\RequestHandlerInterface;

class FakeThrowExceptionMiddleware implements MiddlewareInterface {
public function process(
Expand Down
2 changes: 1 addition & 1 deletion tests/StubRequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace NazgTest;

use Interop\Http\Server\RequestHandlerInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use Zend\Diactoros\Response\JsonResponse;
Expand Down

0 comments on commit a68c066

Please sign in to comment.