[Refactoring] removed debugger als callback parameter in measureTime as it is already injected in the container

This commit is contained in:
Tobias Braner
2016-03-24 09:09:45 +01:00
parent 1f49bee5f2
commit 7051dad34c
16 changed files with 20 additions and 20 deletions

View File

@@ -118,8 +118,8 @@ class Grav extends Container
// process all processors (e.g. config, initialize, assets, ..., render)
foreach ($this->processors as $processor) {
$processor = $this[$processor];
$this->measureTime($processor->id, $processor->title, function($debugger) use ($processor) {
$processor->process($debugger);
$this->measureTime($processor->id, $processor->title, function() use ($processor) {
$processor->process();
});
}
@@ -381,7 +381,7 @@ class Grav extends Container
// then to get it from the container all time.
$container->measureTime = function($timerId, $timerTitle, $callback) use ($debugger) {
$debugger->startTimer($timerId, $timerTitle);
$callback($debugger);
$callback();
$debugger->stopTimer($timerId);
};

View File

@@ -6,7 +6,7 @@ class AssetsProcessor extends ProcessorBase implements ProcessorInterface {
public $id = 'assets';
public $title = 'Assets';
public function process($debugger) {
public function process() {
$this->container['assets']->init();
$this->container->fireEvent('onAssetsInitialized');
}

View File

@@ -6,7 +6,7 @@ class ConfigurationProcessor extends ProcessorBase implements ProcessorInterface
public $id = '_config';
public $title = 'Configuration';
public function process($debugger) {
public function process() {
$this->container['config']->init();
return $this->container['plugins']->setup();
}

View File

@@ -6,8 +6,8 @@ class DebuggerAssetsProcessor extends ProcessorBase implements ProcessorInterfac
public $id = 'debugger_assets';
public $title = 'Debugger Assets';
public function process($debugger) {
$debugger->addAssets();
public function process() {
$this->container['debugger']->addAssets();
}
}

View File

@@ -6,8 +6,8 @@ class DebuggerInitProcessor extends ProcessorBase implements ProcessorInterface
public $id = '_debugger';
public $title = 'Init Debugger';
public function process($debugger) {
$debugger->init();
public function process() {
$this->container['debugger']->init();
}
}

View File

@@ -6,7 +6,7 @@ class ErrorsProcessor extends ProcessorBase implements ProcessorInterface {
public $id = '_errors';
public $title = 'Error Handlers Reset';
public function process($debugger) {
public function process() {
$this->container['errors']->resetHandlers();
}

View File

@@ -6,7 +6,7 @@ class InitializeProcessor extends ProcessorBase implements ProcessorInterface {
public $id = 'init';
public $title = 'Initialize';
public function process($debugger) {
public function process() {
$this->container['config']->debug();
// Use output buffering to prevent headers from being sent too early.

View File

@@ -6,7 +6,7 @@ class PagesProcessor extends ProcessorBase implements ProcessorInterface {
public $id = 'pages';
public $title = 'Pages';
public function process($debugger) {
public function process() {
$this->container['pages']->init();
$this->container->fireEvent('onPagesInitialized');
$this->container->fireEvent('onPageInitialized');

View File

@@ -6,7 +6,7 @@ class PluginsProcessor extends ProcessorBase implements ProcessorInterface {
public $id = 'plugins';
public $title = 'Plugins';
public function process($debugger) {
public function process() {
$this->container['plugins']->init();
$this->container->fireEvent('onPluginsInitialized');
}

View File

@@ -6,5 +6,5 @@ class ProcessorBase {
public function __construct($container) {
$this->container = $container;
}
}

View File

@@ -2,5 +2,5 @@
namespace Grav\Common\Processors;
interface ProcessorInterface {
public function process($debugger);
public function process();
}

View File

@@ -6,7 +6,7 @@ class RenderProcessor extends ProcessorBase implements ProcessorInterface {
public $id = 'render';
public $title = 'Render';
public function process($debugger) {
public function process() {
$this->container->output = $this->container['output'];
$this->container->fireEvent('onOutputGenerated');
}

View File

@@ -6,7 +6,7 @@ class SiteSetupProcessor extends ProcessorBase implements ProcessorInterface {
public $id = '_setup';
public $title = 'Site Setup';
public function process($debugger) {
public function process() {
$this->container['setup']->init();
$this->container['streams'];
}

View File

@@ -6,7 +6,7 @@ class TasksProcessor extends ProcessorBase implements ProcessorInterface {
public $id = 'tasks';
public $title = 'Tasks';
public function process($debugger) {
public function process() {
$task = $this->container['task'];
if ($task) {
$this->container->fireEvent('onTask.' . $task);

View File

@@ -6,7 +6,7 @@ class ThemesProcessor extends ProcessorBase implements ProcessorInterface {
public $id = 'themes';
public $title = 'Themes';
public function process($debugger) {
public function process() {
$this->container['themes']->init();
}

View File

@@ -6,7 +6,7 @@ class TwigProcessor extends ProcessorBase implements ProcessorInterface {
public $id = 'twig';
public $title = 'Twig';
public function process($debugger) {
public function process() {
$this->container['twig']->init();
}