Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrtak-CZ committed Mar 6, 2015
1 parent 5f485b4 commit 084fa86
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/Callbacks/OnErrorCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class OnErrorCallback extends \Nette\Object
{

/**
* @param \Nette\Application\Application
* @param \Exception
Expand All @@ -26,4 +27,5 @@ public function register(Application $application)
{
$application->onError[] = $this;
}

}
4 changes: 4 additions & 0 deletions src/Callbacks/OnRequestCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@

class OnRequestCallback extends \Nette\Object
{

/** @var array */
private $map;

/** @var string */
private $license;

/** @var string */
private $actionKey;

Expand Down Expand Up @@ -74,4 +77,5 @@ public function register(Application $application)
{
$application->onRequest[] = $this;
}

}
20 changes: 14 additions & 6 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@

class Extension extends \Nette\DI\CompilerExtension
{

/** @var bool */
private $skipIfIsDisabled;

/** @var bool */
private $enabled = TRUE;

Expand Down Expand Up @@ -95,20 +97,22 @@ public function afterCompile(ClassType $class)
// AppName and license
if (isset($config['appName']) && !is_array($config['appName'])) {
$initialize->addBody('\VrtakCZ\NewRelic\Tracy\Bootstrap::setup(?, ?);', array(
$config['appName'], isset($config['license']) ? $config['license'] : NULL
$config['appName'],
isset($config['license']) ? $config['license'] : NULL,
));
} elseif (isset($config['appName']) && is_array($config['appName'])) {
if (!isset($config['appName']['*'])) {
throw new \RuntimeException('Missing default app name as "*"');
}
$initialize->addBody('\VrtakCZ\NewRelic\Tracy\Bootstrap::setup(?, ?);', array(
$config['appName']['*'], isset($config['license']) ? $config['license'] : NULL
$config['appName']['*'],
isset($config['license']) ? $config['license'] : NULL,
));
}

// Logger
$initialize->addBody('\Tracy\Debugger::setLogger(new \VrtakCZ\NewRelic\Tracy\Logger(?));', array(
array_unique($config['logLevel'])
array_unique($config['logLevel']),
));

$this->setupCustom($initialize);
Expand Down Expand Up @@ -144,7 +148,7 @@ public function afterCompile(ClassType $class)
$initialize->addBody("ini_set('newrelic.error_collector.record_database_errors', ?);", array(
(string) $config['errorCollector']['recordDatabaseErrors'],
));
$initialize->addBody("newrelic_capture_params(?);", array(
$initialize->addBody('newrelic_capture_params(?);', array(
$config['parameters']['capture'],
));
$initialize->addBody("ini_set('newrelic.ignored_params', ?);", array(
Expand All @@ -162,7 +166,9 @@ private function setupApplicationOnRequest()

$builder->addDefinition($this->prefix('onRequestCallback'))
->setClass('VrtakCZ\NewRelic\Nette\Callbacks\OnRequestCallback', array(
$map, $license, isset($config['actionKey']) ? $config['actionKey'] : Presenter::ACTION_KEY,
$map,
$license,
isset($config['actionKey']) ? $config['actionKey'] : Presenter::ACTION_KEY,
))
->addSetup('register', array('@\Nette\Application\Application'))
->addTag('run', TRUE);
Expand All @@ -189,7 +195,8 @@ private function setupCustom(Method $initialize)

foreach ($config['custom']['parameters'] as $name => $value) {
$initialize->addBody('\VrtakCZ\NewRelic\Tracy\Custom\Parameters::addParameter(?, ?);', array(
$name, $value
$name,
$value,
));
}
}
Expand Down Expand Up @@ -221,4 +228,5 @@ private function setupRUM()
$builder->addDefinition($this->prefix('rum.footerControl'))
->setClass('VrtakCZ\NewRelic\Nette\RUM\FooterControl', array($rumEnabled));
}

}
3 changes: 3 additions & 0 deletions src/RUM/FooterControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

class FooterControl extends \Nette\Application\UI\Control
{

/** @var bool */
private $enabled;

/** @var bool */
private $withScriptTag = TRUE;

Expand Down Expand Up @@ -33,4 +35,5 @@ public function render()
echo newrelic_get_browser_timing_footer($this->withScriptTag);
}
}

}
3 changes: 3 additions & 0 deletions src/RUM/HeaderControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

class HeaderControl extends \Nette\Application\UI\Control
{

/** @var bool */
private $enabled;

/** @var bool */
private $withScriptTag = TRUE;

Expand Down Expand Up @@ -33,4 +35,5 @@ public function render()
echo newrelic_get_browser_timing_header($this->withScriptTag);
}
}

}
2 changes: 2 additions & 0 deletions src/RUM/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

class User extends \Nette\Object
{

/** @var bool */
private $enabled;

Expand All @@ -29,4 +30,5 @@ public function setAttributes($user, $account, $product)
}
return $this;
}

}

0 comments on commit 084fa86

Please sign in to comment.