Fixup
This commit is contained in:
parent
c51d9b1cf6
commit
9e30fbec8c
4 changed files with 18 additions and 3 deletions
|
|
@ -123,4 +123,5 @@ abstract class AbstractCrudController extends AbstractController
|
|||
$response
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,9 +27,11 @@ class JsonResponseExecTimeMiddleware implements MiddlewareInterface{
|
|||
|
||||
return $response;
|
||||
}
|
||||
$memoryUsageBytes = memory_get_peak_usage();
|
||||
$responseJson['Exec'] = [
|
||||
'TimeSeconds' => microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'],
|
||||
'MemoryBytes' => memory_get_peak_usage(),
|
||||
'TimeSeconds' => (float) number_format(microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'],5),
|
||||
'MemoryBytes' => $memoryUsageBytes,
|
||||
'MemoryMegaBytes' => (float) number_format($memoryUsageBytes/1024/1024,3),
|
||||
];
|
||||
|
||||
$replacementResponse = new Response();
|
||||
|
|
|
|||
|
|
@ -55,10 +55,15 @@ class Router
|
|||
continue;
|
||||
}
|
||||
|
||||
|
||||
$rc = new \ReflectionClass($expectedClass);
|
||||
if ($rc->isAbstract()) {
|
||||
continue;
|
||||
}
|
||||
#\Kint::dump(
|
||||
# $expectedClass,
|
||||
# $rc
|
||||
#);
|
||||
|
||||
foreach ($rc->getMethods() as $method) {
|
||||
if (!$method->isPublic()) {
|
||||
|
|
@ -73,10 +78,13 @@ class Router
|
|||
foreach ($routeAnnotation->methods as $httpMethod) {
|
||||
$newRoute = new Route();
|
||||
|
||||
#\Kint::dump($method);
|
||||
#exit;
|
||||
|
||||
$newRoute
|
||||
->setHttpMethod($httpMethod)
|
||||
->setRouterPattern('/'.ltrim($routeAnnotation->path, '/'))
|
||||
->setCallback($method->class.':'.$method->name)
|
||||
->setCallback($expectedClass.':'.$method->name)
|
||||
->setWeight($routeAnnotation->weight)
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,10 @@ abstract class AbstractRoutesTestCase extends AbstractBaseTestCase
|
|||
parent::setUp();
|
||||
}
|
||||
|
||||
public function getApp(){
|
||||
return $this->slimApp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated this has been deprecated in favour of the calls inside AppTestTrait
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue