Skip to content

Commit c819574

Browse files
committed
Updated conflict on Application class name
1 parent bf0f512 commit c819574

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/Statflo/HTTP/Main.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
require_once $vendor;
99
}
1010

11+
use Silex\Application as BaseApplication;
12+
1113
class Main
1214
{
1315
private $config = [];
@@ -19,12 +21,12 @@ private function __construct(array $config)
1921
}
2022
}
2123

22-
public static function run(\Silex\Application $app = null, array $config = [])
24+
public static function run(BaseApplication $app = null, array $config = [])
2325
{
2426
$nonExistentApp = is_null($app);
2527

2628
if ($nonExistentApp) {
27-
$app = new Application();
29+
$app = new \Statflo\HTTP\Application();
2830
$app['debug'] = $config['debug'];
2931
}
3032

@@ -37,7 +39,7 @@ public static function run(\Silex\Application $app = null, array $config = [])
3739
}
3840
}
3941

40-
public function start(\Silex\Application $app)
42+
public function start(BaseApplication $app)
4143
{
4244
$config = $this->config;
4345
$routes = $this->config['controllers'];

src/Statflo/HTTP/Router.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
namespace Statflo\HTTP;
44

5-
use Silex\Application;
5+
use Silex\Application as BaseApplication;
66

77
class Router
88
{
99
private function __construct(){}
1010

11-
public static function register(array $routes, Application $app)
11+
public static function register(array $routes, BaseApplication $app)
1212
{
1313
(new self())->run($routes, $app);
1414
}
1515

16-
public function run(array $routes, Application $app)
16+
public function run(array $routes, BaseApplication $app)
1717
{
1818
$this->defineServices($routes, $app);
1919

@@ -22,7 +22,7 @@ public function run(array $routes, Application $app)
2222
}
2323
}
2424

25-
private function defineServices($routes, Application $app)
25+
private function defineServices($routes, BaseApplication $app)
2626
{
2727
$classNames = [];
2828
foreach ($routes as $route => $configs) {
@@ -49,7 +49,7 @@ private function defineServices($routes, Application $app)
4949
}
5050
}
5151

52-
private function defineRoutes($route, array $configs, Application $app)
52+
private function defineRoutes($route, array $configs, BaseApplication $app)
5353
{
5454
$checkReference = array_values($configs);
5555
$check = array_pop($checkReference);
@@ -63,7 +63,7 @@ private function defineRoutes($route, array $configs, Application $app)
6363
}
6464
}
6565

66-
private function defineRoute($route, array $config, Application $app)
66+
private function defineRoute($route, array $config, BaseApplication $app)
6767
{
6868
if (substr($route, -1) !== "/") {
6969
$app->{$config['method']}($route . "/", $config['id']);

0 commit comments

Comments
 (0)