summaryrefslogtreecommitdiffstats
path: root/src/Router/Runner/RunnerFactory.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Router/Runner/RunnerFactory.php')
-rw-r--r--src/Router/Runner/RunnerFactory.php33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/Router/Runner/RunnerFactory.php b/src/Router/Runner/RunnerFactory.php
deleted file mode 100644
index e32d2cc..0000000
--- a/src/Router/Runner/RunnerFactory.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-namespace Jasny\Router\Runner;
-
-use Jasny\Router\Route;
-
-/**
- * Factory of Runner instances
- */
-class RunnerFactory
-{
- /**
- * Create Runner instance
- *
- * @param Route $route
- * @return Runner
- */
- public function __invoke(Route $route)
- {
- if (isset($route->controller)) {
- $class = Controller::class;
- } elseif (isset($route->fn)) {
- $class = Callback::class;
- } elseif (isset($route->file)) {
- $class = PhpScript::class;
- } else {
- throw new \InvalidArgumentException("Route has neither 'controller', 'fn' or 'file' defined");
- }
-
- return new $class();
- }
-}
-