Skip to content

Commit

Permalink
Merge pull request #20 from mary-shelley/feature/modules
Browse files Browse the repository at this point in the history
Removed app factory support in favor of DiC
  • Loading branch information
wdalmut authored Jul 16, 2017
2 parents f5fec48 + 40a615c commit 4802d8d
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 113 deletions.
3 changes: 0 additions & 3 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ public function __construct(UrlMatcher $router, AnnotExecutor $executor)

public function run(Request $request, Response $response)
{
$this->request = $request;
$this->response = $response;

try {
$matched = $this->getRouter()->matchRequest($request);
$response = $this->getExecutor()->execute($request, $response, $matched);
Expand Down
3 changes: 1 addition & 2 deletions src/Executor/AnnotExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@ public function execute(Request $request, Response $response, array $matched)
$controller = $matched["controller"];

try {
$this->limiter = [];
$this->executeActionsFor($controller, $action, Before::class, $matched, false);

$controller = $this->getContainer()->get($controller);
$data = array_diff_key($matched, array_flip(["annotation", "_route", "controller", "action"]));
$actionReturn = $this->call([$controller, $action], array_merge([$request, $response], $data));

$this->limiter = [];
$this->executeActionsFor($controller, $action, After::class, $actionReturn, true);
} catch (ShortcutException $e) {
$response = $e->getResponse();
Expand All @@ -51,6 +49,7 @@ public function execute(Request $request, Response $response, array $matched)

private function executeActionsFor($controller, $action, $filterClass, $data = null, $after = false)
{
$this->limiter = [];
$methodAnnotations = $this->getReader()->getMethodAnnotationsFor($controller, $action, $filterClass);
$this->executeSteps($methodAnnotations, [$this, __FUNCTION__], $filterClass, $data, $after);

Expand Down
87 changes: 0 additions & 87 deletions src/Factory/AppFactory.php

This file was deleted.

21 changes: 0 additions & 21 deletions tests/Factory/AppFactoryTest.php

This file was deleted.

0 comments on commit 4802d8d

Please sign in to comment.