@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | public function getOptionParser() { |
133 | 133 | $parser = parent::getOptionParser(); |
134 | 134 | $parser->description(__d('debug_kit', |
135 | - 'Allows you to obtain some rough benchmarking statistics' . |
|
135 | + 'Allows you to obtain some rough benchmarking statistics'. |
|
136 | 136 | 'about a fully qualified URL.' |
137 | 137 | )) |
138 | 138 | ->addArgument('url', array( |
@@ -145,12 +145,12 @@ discard block |
||
145 | 145 | )) |
146 | 146 | ->addOption('t', array( |
147 | 147 | 'default' => 100, |
148 | - 'help' => __d('debug_kit', 'Maximum total time for all iterations, in seconds.' . |
|
148 | + 'help' => __d('debug_kit', 'Maximum total time for all iterations, in seconds.'. |
|
149 | 149 | 'If a single iteration takes more than the timeout, only one request will be made' |
150 | 150 | ) |
151 | 151 | )) |
152 | 152 | ->epilog(__d('debug_kit', |
153 | - 'Example Use: `cake benchmark --n 10 --t 100 http://localhost/testsite`. ' . |
|
153 | + 'Example Use: `cake benchmark --n 10 --t 100 http://localhost/testsite`. '. |
|
154 | 154 | '<info>Note:</info> this benchmark does not include browser render times.' |
155 | 155 | )); |
156 | 156 | return $parser; |
@@ -30,22 +30,22 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function main() { |
32 | 32 | $path = APP; |
33 | - if (!empty($this->params['path']) && strpos($this->params['path'], '/') === 0) { |
|
33 | + if ( ! empty($this->params['path']) && strpos($this->params['path'], '/') === 0) { |
|
34 | 34 | $path = $this->params['path']; |
35 | - } elseif (!empty($this->params['path'])) { |
|
35 | + } elseif ( ! empty($this->params['path'])) { |
|
36 | 36 | $path .= $this->params['path']; |
37 | 37 | } |
38 | 38 | $folder = new Folder($path); |
39 | 39 | |
40 | 40 | $r = $folder->findRecursive('.*\.php'); |
41 | - $this->out("Checking *.php in " . $path); |
|
41 | + $this->out("Checking *.php in ".$path); |
|
42 | 42 | foreach ($r as $file) { |
43 | 43 | $c = file_get_contents($file); |
44 | 44 | if (preg_match('/^[\n\r|\n\r|\n|\r|\s]+\<\?php/', $c)) { |
45 | - $this->out('!!!contains leading whitespaces: ' . $this->shortPath($file)); |
|
45 | + $this->out('!!!contains leading whitespaces: '.$this->shortPath($file)); |
|
46 | 46 | } |
47 | 47 | if (preg_match('/\?\>[\n\r|\n\r|\n|\r|\s]+$/', $c)) { |
48 | - $this->out('!!!contains trailing whitespaces: ' . $this->shortPath($file)); |
|
48 | + $this->out('!!!contains trailing whitespaces: '.$this->shortPath($file)); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | } |
@@ -58,19 +58,19 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function trim() { |
60 | 60 | $path = APP; |
61 | - if (!empty($this->params['path']) && strpos($this->params['path'], '/') === 0) { |
|
61 | + if ( ! empty($this->params['path']) && strpos($this->params['path'], '/') === 0) { |
|
62 | 62 | $path = $this->params['path']; |
63 | - } elseif (!empty($this->params['path'])) { |
|
63 | + } elseif ( ! empty($this->params['path'])) { |
|
64 | 64 | $path .= $this->params['path']; |
65 | 65 | } |
66 | 66 | $folder = new Folder($path); |
67 | 67 | |
68 | 68 | $r = $folder->findRecursive('.*\.php'); |
69 | - $this->out("Checking *.php in " . $path); |
|
69 | + $this->out("Checking *.php in ".$path); |
|
70 | 70 | foreach ($r as $file) { |
71 | 71 | $c = file_get_contents($file); |
72 | 72 | if (preg_match('/^[\n\r|\n\r|\n|\r|\s]+\<\?php/', $c) || preg_match('/\?\>[\n\r|\n\r|\n|\r|\s]+$/', $c)) { |
73 | - $this->out('trimming' . $this->shortPath($file)); |
|
73 | + $this->out('trimming'.$this->shortPath($file)); |
|
74 | 74 | $c = preg_replace('/^[\n\r|\n\r|\n|\r|\s]+\<\?php/', '<?php', $c); |
75 | 75 | $c = preg_replace('/\?\>[\n\r|\n\r|\n|\r|\s]+$/', '?>', $c); |
76 | 76 | file_put_contents($file, $c); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * @return \ToolbarComponent |
130 | 130 | */ |
131 | 131 | public function __construct(ComponentCollection $collection, $settings = array()) { |
132 | - $settings = array_merge((array)Configure::read('DebugKit'), $settings); |
|
132 | + $settings = array_merge((array) Configure::read('DebugKit'), $settings); |
|
133 | 133 | $panels = $this->_defaultPanels; |
134 | 134 | if (isset($settings['panels'])) { |
135 | 135 | $panels = $this->_makePanelList($settings['panels']); |
@@ -137,10 +137,10 @@ discard block |
||
137 | 137 | } |
138 | 138 | $this->controller = $collection->getController(); |
139 | 139 | |
140 | - parent::__construct($collection, array_merge($this->settings, (array)$settings)); |
|
140 | + parent::__construct($collection, array_merge($this->settings, (array) $settings)); |
|
141 | 141 | |
142 | 142 | if ( |
143 | - !Configure::read('debug') && |
|
143 | + ! Configure::read('debug') && |
|
144 | 144 | empty($this->settings['forceEnable']) |
145 | 145 | ) { |
146 | 146 | $this->enabled = false; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } |
149 | 149 | if ( |
150 | 150 | $this->settings['autoRun'] === false && |
151 | - !isset($this->controller->request->query['debug']) |
|
151 | + ! isset($this->controller->request->query['debug']) |
|
152 | 152 | ) { |
153 | 153 | $this->enabled = false; |
154 | 154 | return false; |
@@ -176,13 +176,13 @@ discard block |
||
176 | 176 | * @return array |
177 | 177 | */ |
178 | 178 | public function implementedEvents() { |
179 | - $before = function ($name) { |
|
180 | - return function () use ($name) { |
|
179 | + $before = function($name) { |
|
180 | + return function() use ($name) { |
|
181 | 181 | DebugTimer::start($name, $name); |
182 | 182 | }; |
183 | 183 | }; |
184 | - $after = function ($name) { |
|
185 | - return function () use ($name) { |
|
184 | + $after = function($name) { |
|
185 | + return function() use ($name) { |
|
186 | 186 | DebugTimer::stop($name); |
187 | 187 | }; |
188 | 188 | }; |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | * @return boolean |
232 | 232 | */ |
233 | 233 | public function initialize(Controller $controller) { |
234 | - if (!$this->enabled) { |
|
234 | + if ( ! $this->enabled) { |
|
235 | 235 | $this->_Collection->disable('Toolbar'); |
236 | 236 | } |
237 | 237 | } |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | } |
256 | 256 | // Compatibility for when panels were not |
257 | 257 | // required to have a plugin prefix. |
258 | - $alternate = 'DebugKit.' . ucfirst($key); |
|
258 | + $alternate = 'DebugKit.'.ucfirst($key); |
|
259 | 259 | $index = array_search($alternate, $panels); |
260 | 260 | if ($index !== false) { |
261 | 261 | unset($panels[$index]); |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | * @return void |
296 | 296 | */ |
297 | 297 | public function beforeRedirect(Controller $controller, $url, $status = null, $exit = true) { |
298 | - if (!class_exists('DebugTimer')) { |
|
298 | + if ( ! class_exists('DebugTimer')) { |
|
299 | 299 | return null; |
300 | 300 | } |
301 | 301 | DebugTimer::stop('controllerAction'); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | * @return void |
318 | 318 | */ |
319 | 319 | public function beforeRender(Controller $controller) { |
320 | - if (!class_exists('DebugTimer')) { |
|
320 | + if ( ! class_exists('DebugTimer')) { |
|
321 | 321 | return null; |
322 | 322 | } |
323 | 323 | DebugTimer::stop('controllerAction'); |
@@ -340,11 +340,11 @@ discard block |
||
340 | 340 | )); |
341 | 341 | |
342 | 342 | $isHtml = ( |
343 | - !isset($controller->request->params['ext']) || |
|
343 | + ! isset($controller->request->params['ext']) || |
|
344 | 344 | $controller->request->params['ext'] === 'html' |
345 | 345 | ); |
346 | 346 | |
347 | - if (!$controller->request->is('ajax') && $isHtml) { |
|
347 | + if ( ! $controller->request->is('ajax') && $isHtml) { |
|
348 | 348 | $format = 'Html'; |
349 | 349 | } else { |
350 | 350 | $format = 'FirePhp'; |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | $panel = $this->panels[$panelName]; |
411 | 411 | $panelName = Inflector::underscore($panelName); |
412 | 412 | $vars[$panelName]['content'] = $panel->beforeRender($controller); |
413 | - $elementName = Inflector::underscore($panelName) . '_panel'; |
|
413 | + $elementName = Inflector::underscore($panelName).'_panel'; |
|
414 | 414 | if (isset($panel->elementName)) { |
415 | 415 | $elementName = $panel->elementName; |
416 | 416 | } |
@@ -419,11 +419,11 @@ discard block |
||
419 | 419 | $vars[$panelName]['title'] = $panel->title; |
420 | 420 | $vars[$panelName]['disableTimer'] = true; |
421 | 421 | |
422 | - if (!empty($panel->javascript)) { |
|
423 | - $vars['javascript'] = array_merge($vars['javascript'], (array)$panel->javascript); |
|
422 | + if ( ! empty($panel->javascript)) { |
|
423 | + $vars['javascript'] = array_merge($vars['javascript'], (array) $panel->javascript); |
|
424 | 424 | } |
425 | - if (!empty($panel->css)) { |
|
426 | - $vars['css'] = array_merge($vars['css'], (array)$panel->css); |
|
425 | + if ( ! empty($panel->css)) { |
|
426 | + $vars['css'] = array_merge($vars['css'], (array) $panel->css); |
|
427 | 427 | } |
428 | 428 | } |
429 | 429 | return $vars; |
@@ -438,11 +438,11 @@ discard block |
||
438 | 438 | */ |
439 | 439 | protected function _loadPanels($panels, $settings) { |
440 | 440 | foreach ($panels as $panel) { |
441 | - $className = ucfirst($panel) . 'Panel'; |
|
441 | + $className = ucfirst($panel).'Panel'; |
|
442 | 442 | list($plugin, $className) = pluginSplit($className, true); |
443 | 443 | |
444 | - App::uses($className, $plugin . 'Panel'); |
|
445 | - if (!class_exists($className)) { |
|
444 | + App::uses($className, $plugin.'Panel'); |
|
445 | + if ( ! class_exists($className)) { |
|
446 | 446 | trigger_error(__d('debug_kit', 'Could not load DebugToolbar panel %s', $panel), E_USER_WARNING); |
447 | 447 | continue; |
448 | 448 | } |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | */ |
464 | 464 | protected function _saveState(Controller $controller, $vars) { |
465 | 465 | $config = Cache::config('debug_kit'); |
466 | - if (empty($config) || !isset($this->panels['history'])) { |
|
466 | + if (empty($config) || ! isset($this->panels['history'])) { |
|
467 | 467 | return; |
468 | 468 | } |
469 | 469 | $history = Cache::read($this->cacheKey, 'debug_kit'); |
@@ -476,13 +476,13 @@ discard block |
||
476 | 476 | |
477 | 477 | if (isset($vars['variables']['content'])) { |
478 | 478 | // Remove unserializable native objects. |
479 | - array_walk_recursive($vars['variables']['content'], function (&$item) { |
|
479 | + array_walk_recursive($vars['variables']['content'], function(&$item) { |
|
480 | 480 | if ( |
481 | 481 | $item instanceof Closure || |
482 | 482 | $item instanceof PDO || |
483 | 483 | $item instanceof SimpleXmlElement |
484 | 484 | ) { |
485 | - $item = 'Unserializable object - ' . get_class($item); |
|
485 | + $item = 'Unserializable object - '.get_class($item); |
|
486 | 486 | } elseif ($item instanceof Exception) { |
487 | 487 | $item = sprintf( |
488 | 488 | 'Unserializable object - %s. Error: %s in %s, line %s', |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function sql_explain() { |
104 | 104 | if ( |
105 | - !$this->request->is('post') || |
|
105 | + ! $this->request->is('post') || |
|
106 | 106 | empty($this->request->data['log']['sql']) || |
107 | 107 | empty($this->request->data['log']['ds']) || |
108 | 108 | empty($this->request->data['log']['hash']) || |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | ) { |
111 | 111 | throw new BadRequestException('Invalid parameters'); |
112 | 112 | } |
113 | - $hash = Security::hash($this->request->data['log']['sql'] . $this->request->data['log']['ds'], 'sha1', true); |
|
113 | + $hash = Security::hash($this->request->data['log']['sql'].$this->request->data['log']['ds'], 'sha1', true); |
|
114 | 114 | if ($hash !== $this->request->data['log']['hash']) { |
115 | 115 | throw new BadRequestException('Invalid parameters'); |
116 | 116 | } |
@@ -208,7 +208,7 @@ |
||
208 | 208 | * @return void |
209 | 209 | */ |
210 | 210 | public static function fireError($data, $links) { |
211 | - $name = $data['error'] . ' - ' . $data['description']; |
|
211 | + $name = $data['error'].' - '.$data['description']; |
|
212 | 212 | $message = "{$data['error']} {$data['code']} {$data['description']} on line: {$data['line']} in file: {$data['file']}"; |
213 | 213 | FireCake::group($name); |
214 | 214 | FireCake::error($message, $name); |
@@ -55,17 +55,17 @@ |
||
55 | 55 | */ |
56 | 56 | public static function record($message = null) { |
57 | 57 | $memoryUse = self::getCurrent(); |
58 | - if (!$message) { |
|
58 | + if ( ! $message) { |
|
59 | 59 | $named = false; |
60 | 60 | $trace = debug_backtrace(); |
61 | - $message = Debugger::trimpath($trace[0]['file']) . ' line ' . $trace[0]['line']; |
|
61 | + $message = Debugger::trimpath($trace[0]['file']).' line '.$trace[0]['line']; |
|
62 | 62 | } |
63 | 63 | if (isset(self::$_points[$message])) { |
64 | 64 | $originalMessage = $message; |
65 | 65 | $i = 1; |
66 | 66 | while (isset(self::$_points[$message])) { |
67 | 67 | $i++; |
68 | - $message = $originalMessage . ' #' . $i; |
|
68 | + $message = $originalMessage.' #'.$i; |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | self::$_points[$message] = $memoryUse; |
@@ -37,15 +37,15 @@ discard block |
||
37 | 37 | public static function start($name = null, $message = null) { |
38 | 38 | $start = microtime(true); |
39 | 39 | |
40 | - if (!$name) { |
|
40 | + if ( ! $name) { |
|
41 | 41 | $named = false; |
42 | 42 | $calledFrom = debug_backtrace(); |
43 | - $_name = $name = Debugger::trimpath($calledFrom[0]['file']) . ' line ' . $calledFrom[0]['line']; |
|
43 | + $_name = $name = Debugger::trimpath($calledFrom[0]['file']).' line '.$calledFrom[0]['line']; |
|
44 | 44 | } else { |
45 | 45 | $named = true; |
46 | 46 | } |
47 | 47 | |
48 | - if (!$message) { |
|
48 | + if ( ! $message) { |
|
49 | 49 | $message = $name; |
50 | 50 | } |
51 | 51 | |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | $i = 1; |
54 | 54 | while (isset(self::$_timers[$name])) { |
55 | 55 | $i++; |
56 | - $name = $_name . ' #' . $i; |
|
56 | + $name = $_name.' #'.$i; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | if ($i > 1) { |
60 | - $message .= ' #' . $i; |
|
60 | + $message .= ' #'.$i; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | self::$_timers[$name] = array( |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public static function stop($name = null) { |
80 | 80 | $end = microtime(true); |
81 | - if (!$name) { |
|
81 | + if ( ! $name) { |
|
82 | 82 | $names = array_reverse(array_keys(self::$_timers)); |
83 | 83 | foreach ($names as $name) { |
84 | - if (!empty(self::$_timers[$name]['end'])) { |
|
84 | + if ( ! empty(self::$_timers[$name]['end'])) { |
|
85 | 85 | continue; |
86 | 86 | } |
87 | 87 | if (empty(self::$_timers[$name]['named'])) { |
@@ -96,10 +96,10 @@ discard block |
||
96 | 96 | break; |
97 | 97 | } |
98 | 98 | $i++; |
99 | - $name = $_name . ' #' . $i; |
|
99 | + $name = $_name.' #'.$i; |
|
100 | 100 | } |
101 | 101 | } |
102 | - if (!isset(self::$_timers[$name])) { |
|
102 | + if ( ! isset(self::$_timers[$name])) { |
|
103 | 103 | return false; |
104 | 104 | } |
105 | 105 | self::$_timers[$name]['end'] = $end; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $now = microtime(true); |
119 | 119 | |
120 | 120 | $times = array(); |
121 | - if (!empty(self::$_timers)) { |
|
121 | + if ( ! empty(self::$_timers)) { |
|
122 | 122 | $firstTimer = reset(self::$_timers); |
123 | 123 | $_end = $firstTimer['start']; |
124 | 124 | } else { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | 'named' => null |
133 | 133 | ); |
134 | 134 | foreach (self::$_timers as $name => $timer) { |
135 | - if (!isset($timer['end'])) { |
|
135 | + if ( ! isset($timer['end'])) { |
|
136 | 136 | $timer['end'] = $now; |
137 | 137 | } |
138 | 138 | $times[$name] = array_merge($timer, array( |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * @return float number of seconds elapsed for timer name, 0 on missing key |
166 | 166 | */ |
167 | 167 | public static function elapsedTime($name = 'default', $precision = 5) { |
168 | - if (!isset(self::$_timers[$name]['start']) || !isset(self::$_timers[$name]['end'])) { |
|
168 | + if ( ! isset(self::$_timers[$name]['start']) || ! isset(self::$_timers[$name]['end'])) { |
|
169 | 169 | return 0; |
170 | 170 | } |
171 | 171 | return round(self::$_timers[$name]['end'] - self::$_timers[$name]['start'], $precision); |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | App::uses('Debugger', 'Utility'); |
16 | 16 | |
17 | -if (!function_exists('firecake')) { |
|
17 | +if ( ! function_exists('firecake')) { |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * Procedural version of FireCake::log() |
@@ -120,13 +120,13 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public static function getInstance($class = null) { |
122 | 122 | static $instance = array(); |
123 | - if (!empty($class)) { |
|
124 | - if (!$instance || strtolower($class) !== strtolower(get_class($instance[0]))) { |
|
123 | + if ( ! empty($class)) { |
|
124 | + if ( ! $instance || strtolower($class) !== strtolower(get_class($instance[0]))) { |
|
125 | 125 | $instance[0] = new $class(); |
126 | 126 | $instance[0]->setOptions(); |
127 | 127 | } |
128 | 128 | } |
129 | - if (!isset($instance[0]) || !$instance[0]) { |
|
129 | + if ( ! isset($instance[0]) || ! $instance[0]) { |
|
130 | 130 | $instance[0] = new FireCake(); |
131 | 131 | $instance[0]->setOptions(); |
132 | 132 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | trigger_error(__d('debug_kit', 'Headers already sent in %s on line %s. Cannot send log data to FirePHP.', $filename, $linenum), E_USER_WARNING); |
311 | 311 | return false; |
312 | 312 | } |
313 | - if (!$_this->_enabled || !$_this->detectClientExtension()) { |
|
313 | + if ( ! $_this->_enabled || ! $_this->detectClientExtension()) { |
|
314 | 314 | return false; |
315 | 315 | } |
316 | 316 | |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $skipFinalObjectEncode = false; |
342 | 342 | if ($type == $_this->_levels['trace']) { |
343 | 343 | $trace = debug_backtrace(); |
344 | - if (!$trace) { |
|
344 | + if ( ! $trace) { |
|
345 | 345 | return false; |
346 | 346 | } |
347 | 347 | $message = FireCake::_parseTrace($trace, $args[0]); |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | } |
350 | 350 | |
351 | 351 | if ($_this->options['includeLineNumbers']) { |
352 | - if (!isset($meta['file']) || !isset($meta['line'])) { |
|
352 | + if ( ! isset($meta['file']) || ! isset($meta['line'])) { |
|
353 | 353 | $trace = debug_backtrace(); |
354 | 354 | for ($i = 0, $len = count($trace); $i < $len; $i++) { |
355 | 355 | $keySet = (isset($trace[$i]['class']) && isset($trace[$i]['function'])); |
@@ -375,19 +375,19 @@ discard block |
||
375 | 375 | } |
376 | 376 | |
377 | 377 | $_this->_sendHeader('X-Wf-Protocol-1', 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2'); |
378 | - $_this->_sendHeader('X-Wf-1-Plugin-1', 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/' . $_this->_version); |
|
378 | + $_this->_sendHeader('X-Wf-1-Plugin-1', 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/'.$_this->_version); |
|
379 | 379 | if ($type == $_this->_levels['groupStart']) { |
380 | 380 | $meta['Collapsed'] = 'true'; |
381 | 381 | } |
382 | 382 | if ($type == $_this->_levels['dump']) { |
383 | 383 | $dump = FireCake::jsonEncode($message); |
384 | - $msg = '{"' . $label . '":' . $dump . '}'; |
|
384 | + $msg = '{"'.$label.'":'.$dump.'}'; |
|
385 | 385 | } else { |
386 | 386 | $meta['Type'] = $type; |
387 | 387 | if ($label !== null) { |
388 | 388 | $meta['Label'] = $label; |
389 | 389 | } |
390 | - $msg = '[' . $_this->jsonEncode($meta) . ',' . $_this->jsonEncode($message, $skipFinalObjectEncode) . ']'; |
|
390 | + $msg = '['.$_this->jsonEncode($meta).','.$_this->jsonEncode($message, $skipFinalObjectEncode).']'; |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | $lines = explode("\n", chunk_split($msg, 5000, "\n")); |
@@ -396,14 +396,14 @@ discard block |
||
396 | 396 | if (empty($line)) { |
397 | 397 | continue; |
398 | 398 | } |
399 | - $header = 'X-Wf-1-' . $structureIndex . '-1-' . $_this->_messageIndex; |
|
399 | + $header = 'X-Wf-1-'.$structureIndex.'-1-'.$_this->_messageIndex; |
|
400 | 400 | if (count($lines) > 2) { |
401 | 401 | $first = ($i == 0) ? strlen($msg) : ''; |
402 | 402 | $end = ($i < count($lines) - 2) ? '\\' : ''; |
403 | - $message = $first . '|' . $line . '|' . $end; |
|
403 | + $message = $first.'|'.$line.'|'.$end; |
|
404 | 404 | $_this->_sendHeader($header, $message); |
405 | 405 | } else { |
406 | - $_this->_sendHeader($header, strlen($line) . '|' . $line . '|'); |
|
406 | + $_this->_sendHeader($header, strlen($line).'|'.$line.'|'); |
|
407 | 407 | } |
408 | 408 | $_this->_messageIndex++; |
409 | 409 | if ($_this->_messageIndex > 99999) { |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | for ($i = 0, $len = count($trace); $i < $len; $i++) { |
427 | 427 | $keySet = (isset($trace[$i]['class']) && isset($trace[$i]['function'])); |
428 | 428 | $selfCall = ($keySet && $trace[$i]['class'] === 'FireCake'); |
429 | - if (!$selfCall) { |
|
429 | + if ( ! $selfCall) { |
|
430 | 430 | $message = array( |
431 | 431 | 'Class' => isset($trace[$i]['class']) ? $trace[$i]['class'] : '', |
432 | 432 | 'Type' => isset($trace[$i]['type']) ? $trace[$i]['type'] : '', |
@@ -474,15 +474,15 @@ discard block |
||
474 | 474 | $_this = FireCake::getInstance(); |
475 | 475 | $return = array(); |
476 | 476 | if (is_resource($object)) { |
477 | - return '** ' . (string)$object . '**'; |
|
477 | + return '** '.(string) $object.'**'; |
|
478 | 478 | } |
479 | 479 | if (is_object($object)) { |
480 | 480 | if ($objectDepth == $_this->options['maxObjectDepth']) { |
481 | - return '** Max Object Depth (' . $_this->options['maxObjectDepth'] . ') **'; |
|
481 | + return '** Max Object Depth ('.$_this->options['maxObjectDepth'].') **'; |
|
482 | 482 | } |
483 | 483 | foreach ($_this->_encodedObjects as $encoded) { |
484 | 484 | if ($encoded === $object) { |
485 | - return '** Recursion (' . get_class($object) . ') **'; |
|
485 | + return '** Recursion ('.get_class($object).') **'; |
|
486 | 486 | } |
487 | 487 | } |
488 | 488 | $_this->_encodedObjects[] = $object; |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | } |
497 | 497 | if (is_array($object)) { |
498 | 498 | if ($arrayDepth == $_this->options['maxArrayDepth']) { |
499 | - return '** Max Array Depth (' . $_this->options['maxArrayDepth'] . ') **'; |
|
499 | + return '** Max Array Depth ('.$_this->options['maxArrayDepth'].') **'; |
|
500 | 500 | } |
501 | 501 | foreach ($object as $key => $value) { |
502 | 502 | $return[$key] = FireCake::stringEncode($value, 1, $arrayDepth + 1); |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | */ |
520 | 520 | public static function jsonEncode($object, $skipEncode = false) { |
521 | 521 | $_this = FireCake::getInstance(); |
522 | - if (!$skipEncode) { |
|
522 | + if ( ! $skipEncode) { |
|
523 | 523 | $object = FireCake::stringEncode($object); |
524 | 524 | } |
525 | 525 | return json_encode($object); |
@@ -533,6 +533,6 @@ discard block |
||
533 | 533 | * @return void |
534 | 534 | */ |
535 | 535 | protected function _sendHeader($name, $value) { |
536 | - header($name . ': ' . $value); |
|
536 | + header($name.': '.$value); |
|
537 | 537 | } |
538 | 538 | } |
@@ -42,9 +42,9 @@ |
||
42 | 42 | * @return void |
43 | 43 | */ |
44 | 44 | public function write($type, $message) { |
45 | - if (!isset($this->logs[$type])) { |
|
45 | + if ( ! isset($this->logs[$type])) { |
|
46 | 46 | $this->logs[$type] = array(); |
47 | 47 | } |
48 | - $this->logs[$type][] = array(date('Y-m-d H:i:s'), (string)$message); |
|
48 | + $this->logs[$type][] = array(date('Y-m-d H:i:s'), (string) $message); |
|
49 | 49 | } |
50 | 50 | } |