From 27785bff1a2ca21e2c28a841413b442ff954329f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Tue, 22 Dec 2020 01:02:59 +0200 Subject: [PATCH] Use config() from AbstractController --- src/Controller/CustomController.php | 2 +- src/Controller/RunController.php | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Controller/CustomController.php b/src/Controller/CustomController.php index 3016829fa..845ac9204 100644 --- a/src/Controller/CustomController.php +++ b/src/Controller/CustomController.php @@ -60,7 +60,7 @@ public function query(Request $request, Response $response) return $response->body($json); } - $perPage = $this->app->config('page.limit'); + $perPage = $this->config('page.limit'); $res = $this->searcher->query($query, $perPage, $retrieve); diff --git a/src/Controller/RunController.php b/src/Controller/RunController.php index 288ee7989..60d87a1b8 100644 --- a/src/Controller/RunController.php +++ b/src/Controller/RunController.php @@ -49,7 +49,7 @@ public function index(Request $request, Response $response) 'sort' => $sort, 'page' => (int)$request->get('page', SearcherInterface::DEFAULT_PAGE), 'direction' => $request->get('direction'), - 'perPage' => (int)$this->app->config('page.limit'), + 'perPage' => (int)$this->config('page.limit'), 'conditions' => $search, 'projection' => true, ])); @@ -76,7 +76,7 @@ public function index(Request $request, Response $response) 'paging' => $paging, 'base_url' => 'home', 'runs' => $result['results'], - 'date_format' => $this->app->config('date.format'), + 'date_format' => $this->config('date.format'), 'search' => $search, 'has_search' => strlen(implode('', $search)) > 0, 'title' => $title, @@ -94,7 +94,7 @@ public function view(Request $request, Response $response) // https://github.com/perftools/xhgui/issues/261 $response->headers->set('Cache-Control', 'public, max-age=60, must-revalidate'); - $detailCount = $this->app->config('detail.count'); + $detailCount = $this->config('detail.count'); $result = $this->searcher->get($request->get('id')); $result->calculateSelf(); @@ -127,7 +127,7 @@ public function view(Request $request, Response $response) 'wall_time' => $timeChart, 'memory' => $memoryChart, 'watches' => $watchedFunctions, - 'date_format' => $this->app->config('date.format'), + 'date_format' => $this->config('date.format'), ]); } @@ -141,7 +141,7 @@ protected function getFilters() if (strlen($filterString) > 1 && $filterString !== 'true') { $filters = array_map('trim', explode(',', $filterString)); } else { - $filters = $this->app->config('run.view.filter.names'); + $filters = $this->config('run.view.filter.names'); } return $filters; @@ -204,7 +204,7 @@ public function url(Request $request) 'sort' => $request->get('sort'), 'direction' => $request->get('direction'), 'page' => $request->get('page'), - 'perPage' => $this->app->config('page.limit'), + 'perPage' => $this->config('page.limit'), ]; $search = []; @@ -246,7 +246,7 @@ public function url(Request $request) 'runs' => $runs['results'], 'url' => $request->get('url'), 'chart_data' => $chartData, - 'date_format' => $this->app->config('date.format'), + 'date_format' => $this->config('date.format'), 'search' => array_merge($search, ['url' => $request->get('url')]), ]); } @@ -265,7 +265,7 @@ public function compare(Request $request) 'direction' => $request->get('direction'), 'sort' => $request->get('sort'), 'page' => $request->get('page'), - 'perPage' => $this->app->config('page.limit'), + 'perPage' => $this->config('page.limit'), ]; $candidates = $this->searcher->getForUrl( $baseRun->getMeta('simple_url'), @@ -295,7 +295,7 @@ public function compare(Request $request) 'head_run' => $headRun, 'candidates' => $candidates, 'url_params' => $request->get(), - 'date_format' => $this->app->config('date.format'), + 'date_format' => $this->config('date.format'), 'comparison' => $comparison, 'paging' => $paging, 'search' => [ @@ -354,7 +354,7 @@ public function callgraph(Request $request) $this->_template = 'runs/callgraph.twig'; $this->set([ 'profile' => $profile, - 'date_format' => $this->app->config('date.format'), + 'date_format' => $this->config('date.format'), ]); }