@@ -40,4 +40,4 @@ |
||
40 | 40 | 'hostname' => 'emulate hostname', |
41 | 41 | "server_name" => 'emulate server name', |
42 | 42 | ); |
43 | - } |
|
44 | 43 | \ No newline at end of file |
44 | + } |
|
45 | 45 | \ No newline at end of file |
@@ -15,26 +15,26 @@ |
||
15 | 15 | */ |
16 | 16 | global $app; |
17 | 17 | static $logger = null; |
18 | - if(is_null($logger)) { |
|
18 | + if (is_null($logger)) { |
|
19 | 19 | $logger = $app['pinba_logger']; |
20 | 20 | } |
21 | 21 | return $logger; |
22 | 22 | } |
23 | 23 | |
24 | -function pinba_script_name_set ($name){ |
|
24 | +function pinba_script_name_set($name) { |
|
25 | 25 | get_pinba_logger()->debug(__FUNCTION__, func_get_args()); |
26 | 26 | } |
27 | -function pinba_timer_start ($tags){ |
|
27 | +function pinba_timer_start($tags) { |
|
28 | 28 | get_pinba_logger()->debug(__FUNCTION__, func_get_args()); |
29 | - return rand(100,999); |
|
29 | + return rand(100, 999); |
|
30 | 30 | } |
31 | -function pinba_timer_stop ($tags){ |
|
31 | +function pinba_timer_stop($tags) { |
|
32 | 32 | get_pinba_logger()->debug(__FUNCTION__, func_get_args()); |
33 | 33 | } |
34 | -function pinba_timer_add ($tags, $time){ |
|
34 | +function pinba_timer_add($tags, $time) { |
|
35 | 35 | get_pinba_logger()->debug(__FUNCTION__, func_get_args()); |
36 | 36 | } |
37 | -function pinba_get_info (){ |
|
37 | +function pinba_get_info() { |
|
38 | 38 | get_pinba_logger()->debug(__FUNCTION__); |
39 | 39 | return array( |
40 | 40 | 'hostname' => 'emulate hostname', |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | use Intaro\PinbaBundle\Stopwatch\Stopwatch; |
11 | 11 | use Intaro\PinbaBundle\Stopwatch\StopwatchEvent; |
12 | 12 | |
13 | -class Filesystem extends FilesystemCache{ |
|
13 | +class Filesystem extends FilesystemCache { |
|
14 | 14 | /** |
15 | 15 | * @var Stopwatch |
16 | 16 | */ |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | return null; |
44 | 44 | } |
45 | 45 | $tags = $this->stopwatchAdditionalTags; |
46 | - $tags['group'] = 'filesystem::' . $methodName; |
|
46 | + $tags['group'] = 'filesystem::'.$methodName; |
|
47 | 47 | |
48 | 48 | return $this->stopwatch->start($tags); |
49 | 49 | } |
@@ -89,7 +89,7 @@ |
||
89 | 89 | |
90 | 90 | public function stop() |
91 | 91 | { |
92 | - $this->storage['tags'] = $this->tags; |
|
92 | + $this->storage['tags'] = $this->tags; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | } |
@@ -21,9 +21,9 @@ |
||
21 | 21 | |
22 | 22 | $storage = new \ArrayObject(); |
23 | 23 | |
24 | - $app = new ApplicationEmulator(); |
|
24 | + $app = new ApplicationEmulator(); |
|
25 | 25 | $app |
26 | - ->register(new TwigServiceProvider(),array( |
|
26 | + ->register(new TwigServiceProvider(), array( |
|
27 | 27 | 'twig.templates' => array('hello' => 'Hello {{ name }}!'), |
28 | 28 | )) |
29 | 29 | ->register(new SilexPinbaProvider()); |
@@ -36,15 +36,15 @@ discard block |
||
36 | 36 | $app['intaro_pinba.script_name_configure.enable'] = true; |
37 | 37 | |
38 | 38 | |
39 | - $app['intaro_pinba.script_name_configure.listener'] = function () use ($app) { |
|
39 | + $app['intaro_pinba.script_name_configure.listener'] = function() use ($app) { |
|
40 | 40 | return new $app['intaro_pinba.script_name_configure.class']; |
41 | 41 | }; |
42 | 42 | |
43 | - $app['intaro_pinba.stopwatch'] = function () use ($app) { |
|
43 | + $app['intaro_pinba.stopwatch'] = function() use ($app) { |
|
44 | 44 | return new $app['intaro_pinba.stopwatch.class']; |
45 | 45 | }; |
46 | 46 | |
47 | - $app['doctrine.dbal.logger'] = function () use ($app) { |
|
47 | + $app['doctrine.dbal.logger'] = function() use ($app) { |
|
48 | 48 | /** |
49 | 49 | * @see \Intaro\PinbaBundle\Logger\DbalLogger |
50 | 50 | */ |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | return new $className($app["intaro_pinba.stopwatch"], $host); |
54 | 54 | }; |
55 | 55 | |
56 | - $app['dbs.config'] = function ($app) { |
|
56 | + $app['dbs.config'] = function($app) { |
|
57 | 57 | $app['dbs.options.initializer'](); |
58 | 58 | |
59 | 59 | $configs = new Container(); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | return $configs; |
69 | 69 | }; |
70 | 70 | |
71 | - $app['twig.environment_factory'] = $app->protect(function ($app) { |
|
71 | + $app['twig.environment_factory'] = $app->protect(function($app) { |
|
72 | 72 | $className = $app['intaro_pinba.templating.engine.twig.class']; |
73 | 73 | return new $className($app['twig.loader'], $app['twig.options']); |
74 | 74 | }); |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function boot(Application $app) |
86 | 86 | { |
87 | - $app['twig'] = $app->extend('twig', function (\Twig_Environment $twig) use ($app) { |
|
88 | - if($twig instanceof TimedTwigEnvironment) { |
|
87 | + $app['twig'] = $app->extend('twig', function(\Twig_Environment $twig) use ($app) { |
|
88 | + if ($twig instanceof TimedTwigEnvironment) { |
|
89 | 89 | $twig |
90 | - ->setStopwatch( $app['intaro_pinba.stopwatch']) |
|
90 | + ->setStopwatch($app['intaro_pinba.stopwatch']) |
|
91 | 91 | ->setServerName($app['intaro_pinba.server.name']) |
92 | 92 | ; |
93 | 93 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | use Intaro\PinbaBundle\Stopwatch\Stopwatch; |
11 | 11 | |
12 | -class TimedTwigEnvironment extends \Twig_Environment{ |
|
12 | +class TimedTwigEnvironment extends \Twig_Environment { |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * @var Stopwatch |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function render($name, array $context = array()) |
57 | 57 | { |
58 | - if(null === $this->stopwatch) { |
|
58 | + if (null === $this->stopwatch) { |
|
59 | 59 | return parent::render($name, $context); |
60 | 60 | } |
61 | 61 | $e = $this->stopwatch->start(array( |
62 | 62 | 'server' => $this->serverName, |
63 | 63 | 'group' => 'twig::render', |
64 | - 'twig_template' => (string)$name, |
|
64 | + 'twig_template' => (string) $name, |
|
65 | 65 | )); |
66 | 66 | |
67 | 67 | $ret = parent::render($name, $context); |