Skip to content

Commit

Permalink
#2 in work
Browse files Browse the repository at this point in the history
  • Loading branch information
v-dem committed Jul 20, 2022
1 parent d63aa08 commit ae68f03
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/MiddlewareHandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace queasy\framework;

use Psr\Http\Message\ServerRequestInterface;

use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;

class MiddlewareHandler implements LoggerAwareInterface
{
private $config;

private $app;

private $logger;

public function __construct($config, App $app)
{
$this->config = $config;

$this->app = $app;

$this->logger = new NullLogger();
}

public function handle(ServerRequestInterface $request, $controller)
{

}

public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;
}
}

13 changes: 13 additions & 0 deletions src/MiddlewareInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace queasy\framework;

use Closure;

use Psr\Http\Message\ServerRequestInterface;

interface MiddlewareInterface
{
public function handle(ServerRequestInterface $request, Closure $next);
}

0 comments on commit ae68f03

Please sign in to comment.