@@ -13,6 +13,6 @@ |
||
| 13 | 13 | { |
| 14 | 14 | protected function configure() |
| 15 | 15 | { |
| 16 | - $this->bind('Ray\Di\InjectorInterface')->toProvider(__NAMESPACE__ . '\DiProvider')->in(Scope::SINGLETON); |
|
| 16 | + $this->bind('Ray\Di\InjectorInterface')->toProvider(__NAMESPACE__.'\DiProvider')->in(Scope::SINGLETON); |
|
| 17 | 17 | } |
| 18 | 18 | } |
@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function get($extraCacheKey = '') |
| 68 | 68 | { |
| 69 | - $contextKey = is_array($this->context)? implode('_', $this->context) : $this->context; |
|
| 70 | - $saveKey = $this->appName . $contextKey; |
|
| 69 | + $contextKey = is_array($this->context) ? implode('_', $this->context) : $this->context; |
|
| 70 | + $saveKey = $this->appName.$contextKey; |
|
| 71 | 71 | if (isset(self::$compiler[$saveKey])) { |
| 72 | 72 | return self::$compiler[$saveKey]; |
| 73 | 73 | } |
| 74 | - $moduleProvider = function () use ($saveKey) { |
|
| 74 | + $moduleProvider = function() use ($saveKey) { |
|
| 75 | 75 | // avoid infinity loop |
| 76 | 76 | if (isset(self::$module[$saveKey])) { |
| 77 | 77 | return self::$module[$saveKey]; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | return self::$module[$saveKey]; |
| 83 | 83 | }; |
| 84 | - $cacheKey = $this->appName . $contextKey . $extraCacheKey; |
|
| 84 | + $cacheKey = $this->appName.$contextKey.$extraCacheKey; |
|
| 85 | 85 | self::$compiler[$saveKey] = $compiler = DiCompiler::create($moduleProvider, $this->cache, $cacheKey, $this->tmpDir); |
| 86 | 86 | |
| 87 | 87 | return $compiler; |
@@ -15,6 +15,6 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | protected function configure() |
| 17 | 17 | { |
| 18 | - $this->bind('Aura\Input\Form')->toProvider(__NAMESPACE__ . '\AuraFormProvider'); |
|
| 18 | + $this->bind('Aura\Input\Form')->toProvider(__NAMESPACE__.'\AuraFormProvider'); |
|
| 19 | 19 | } |
| 20 | 20 | } |
@@ -19,13 +19,13 @@ |
||
| 19 | 19 | // log register |
| 20 | 20 | $this |
| 21 | 21 | ->bind('BEAR\Sunday\Extension\ApplicationLogger\ApplicationLoggerInterface') |
| 22 | - ->to(__NAMESPACE__ . '\ApplicationLogger') |
|
| 22 | + ->to(__NAMESPACE__.'\ApplicationLogger') |
|
| 23 | 23 | ->in(Scope::SINGLETON); |
| 24 | 24 | |
| 25 | 25 | // log writer |
| 26 | 26 | $this |
| 27 | 27 | ->bind('BEAR\Resource\LogWriterInterface') |
| 28 | - ->toProvider(__NAMESPACE__ . '\ResourceLog\DevWritersProvider') |
|
| 28 | + ->toProvider(__NAMESPACE__.'\ResourceLog\DevWritersProvider') |
|
| 29 | 29 | ->in(Scope::SINGLETON); |
| 30 | 30 | |
| 31 | 31 | $this |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function __construct(FirePHP $fire = null) |
| 34 | 34 | { |
| 35 | - $this->fire = $fire ? : FirePHP::getInstance(true); |
|
| 35 | + $this->fire = $fire ?: FirePHP::getInstance(true); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | { |
| 91 | 91 | $body = $this->normalize($result->body); |
| 92 | 92 | $isTable = is_array($body) && isset($body[0]) && isset($body[1]) && (array_keys($body[0]) === array_keys($body[1])); |
| 93 | - if (! $isTable) { |
|
| 93 | + if (!$isTable) { |
|
| 94 | 94 | $this->fire->log($body, 'body'); |
| 95 | 95 | return; |
| 96 | 96 | } |
@@ -117,16 +117,16 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | array_walk_recursive( |
| 119 | 119 | $body, |
| 120 | - function (&$value) { |
|
| 120 | + function(&$value) { |
|
| 121 | 121 | if ($value instanceof RequestInterface) { |
| 122 | - $value = '(Request) ' . $value->toUri(); |
|
| 122 | + $value = '(Request) '.$value->toUri(); |
|
| 123 | 123 | } |
| 124 | 124 | if ($value instanceof ResourceObject) { |
| 125 | 125 | /** @var $value ResourceObject */ |
| 126 | - $value = '(ResourceObject) ' . get_class($value) . json_encode($value->body); |
|
| 126 | + $value = '(ResourceObject) '.get_class($value).json_encode($value->body); |
|
| 127 | 127 | } |
| 128 | 128 | if (is_object($value)) { |
| 129 | - $value = '(object) ' . get_class($value); |
|
| 129 | + $value = '(object) '.get_class($value); |
|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | ); |
@@ -46,10 +46,10 @@ |
||
| 46 | 46 | $this->pageId = rtrim(base64_encode(pack('H*', md5($_SERVER['REQUEST_TIME_FLOAT']))), '='); |
| 47 | 47 | $id = "{$this->pageId}"; |
| 48 | 48 | /** @var $logger \Zend\Log\LoggerInterface */ |
| 49 | - $msg = "id:{$id}\treq:" . $request->toUriWithMethod(); |
|
| 50 | - $msg .= "\tcode:" . $result->code; |
|
| 51 | - $msg .= "\tbody:" . json_encode($result->body); |
|
| 52 | - $msg .= "\theader:" . json_encode($result->headers); |
|
| 49 | + $msg = "id:{$id}\treq:".$request->toUriWithMethod(); |
|
| 50 | + $msg .= "\tcode:".$result->code; |
|
| 51 | + $msg .= "\tbody:".json_encode($result->body); |
|
| 52 | + $msg .= "\theader:".json_encode($result->headers); |
|
| 53 | 53 | $path = $this->getPath(isset($_SERVER['PATH_INFO'])); |
| 54 | 54 | $msg .= "\tpath:$path"; |
| 55 | 55 | try { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $this->zf2Log->addWriter(new Syslog); |
| 38 | 38 | $dbConfig = [ |
| 39 | 39 | 'driver' => 'Pdo_Sqlite', |
| 40 | - 'dsn' => 'sqlite:' . $logDir . '/resource.db' |
|
| 40 | + 'dsn' => 'sqlite:'.$logDir.'/resource.db' |
|
| 41 | 41 | ]; |
| 42 | 42 | $this->db = new Adapter($dbConfig); |
| 43 | 43 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | { |
| 50 | 50 | static $zf2Log; |
| 51 | 51 | |
| 52 | - if (! $zf2Log) { |
|
| 52 | + if (!$zf2Log) { |
|
| 53 | 53 | $this->db->query( |
| 54 | 54 | 'CREATE TABLE IF NOT EXISTS log(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, timestamp, message, priority, priorityName, extra_page)', |
| 55 | 55 | Adapter::QUERY_MODE_EXECUTE |
@@ -19,12 +19,12 @@ |
||
| 19 | 19 | // log register |
| 20 | 20 | $this |
| 21 | 21 | ->bind('BEAR\Sunday\Extension\ApplicationLogger\ApplicationLoggerInterface') |
| 22 | - ->to(__NAMESPACE__ . '\DevApplicationLogger'); |
|
| 22 | + ->to(__NAMESPACE__.'\DevApplicationLogger'); |
|
| 23 | 23 | |
| 24 | 24 | // log writer |
| 25 | 25 | $this |
| 26 | 26 | ->bind('BEAR\Resource\LogWriterInterface') |
| 27 | - ->toProvider(__NAMESPACE__ . '\ResourceLog\DevWritersProvider') |
|
| 27 | + ->toProvider(__NAMESPACE__.'\ResourceLog\DevWritersProvider') |
|
| 28 | 28 | ->in(Scope::SINGLETON); |
| 29 | 29 | |
| 30 | 30 | $this |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | */ |
| 68 | 68 | public function fetch($tplWithoutExtension) |
| 69 | 69 | { |
| 70 | - $this->template = $tplWithoutExtension . self::EXT; |
|
| 70 | + $this->template = $tplWithoutExtension.self::EXT; |
|
| 71 | 71 | $this->fileExists($this->template); |
| 72 | 72 | $template = $this->twig->loadTemplate($this->template); |
| 73 | 73 | $rendered = $template->render($this->values); |