@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | public function query() |
| 165 | 165 | { |
| 166 | - $this->currentPage = $this->currentPage ? : (isset($_GET[$this->pageKey]) ? $_GET[$this->pageKey] : 1); |
|
| 166 | + $this->currentPage = $this->currentPage ?: (isset($_GET[$this->pageKey]) ? $_GET[$this->pageKey] : 1); |
|
| 167 | 167 | $firstResult = ($this->currentPage - 1) * $this->maxPerPage; |
| 168 | 168 | $args = func_get_args(); |
| 169 | 169 | $query = $args[0]; |
@@ -206,8 +206,8 @@ discard block |
||
| 206 | 206 | */ |
| 207 | 207 | private function getHtml() |
| 208 | 208 | { |
| 209 | - $view = $this->view ? : new TwitterBootstrap3View; |
|
| 210 | - $routeGenerator = $this->routeGenerator ? : function ($page) { |
|
| 209 | + $view = $this->view ?: new TwitterBootstrap3View; |
|
| 210 | + $routeGenerator = $this->routeGenerator ?: function($page) { |
|
| 211 | 211 | return "?{$this->pageKey}={$page}"; |
| 212 | 212 | }; |
| 213 | 213 | $html = $view->render( |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | private function installDbInjector() |
| 30 | 30 | { |
| 31 | - $dbInjector = $this->requestInjection(__NAMESPACE__ . '\Interceptor\DbInjector'); |
|
| 31 | + $dbInjector = $this->requestInjection(__NAMESPACE__.'\Interceptor\DbInjector'); |
|
| 32 | 32 | $this->bindInterceptor( |
| 33 | 33 | $this->matcher->annotatedWith('BEAR\Sunday\Annotation\Db'), |
| 34 | 34 | $this->matcher->startWith('on'), |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | { |
| 129 | 129 | // be smart and try to guess the total number of records |
| 130 | 130 | $countQuery = $this->getCountQuery($query); |
| 131 | - if (! $countQuery) { |
|
| 131 | + if (!$countQuery) { |
|
| 132 | 132 | // GROUP BY => fetch the whole result set and count the rows returned |
| 133 | 133 | $result = $this->pdo->query($query)->fetchAll(); |
| 134 | 134 | $count = count($result); |
@@ -157,13 +157,13 @@ discard block |
||
| 157 | 157 | } |
| 158 | 158 | $openParenthesis = '(?:\()'; |
| 159 | 159 | $closeParenthesis = '(?:\))'; |
| 160 | - $subQueryInSelect = $openParenthesis . '.*\bFROM\b.*' . $closeParenthesis; |
|
| 161 | - $pattern = '/(?:.*' . $subQueryInSelect . '.*)\bFROM\b\s+/Uims'; |
|
| 160 | + $subQueryInSelect = $openParenthesis.'.*\bFROM\b.*'.$closeParenthesis; |
|
| 161 | + $pattern = '/(?:.*'.$subQueryInSelect.'.*)\bFROM\b\s+/Uims'; |
|
| 162 | 162 | if (preg_match($pattern, $query)) { |
| 163 | 163 | return false; |
| 164 | 164 | } |
| 165 | - $subQueryWithLimitOrder = $openParenthesis . '.*\b(LIMIT|ORDER)\b.*' . $closeParenthesis; |
|
| 166 | - $pattern = '/.*\bFROM\b.*(?:.*' . $subQueryWithLimitOrder . '.*).*/Uims'; |
|
| 165 | + $subQueryWithLimitOrder = $openParenthesis.'.*\b(LIMIT|ORDER)\b.*'.$closeParenthesis; |
|
| 166 | + $pattern = '/.*\bFROM\b.*(?:.*'.$subQueryWithLimitOrder.'.*).*/Uims'; |
|
| 167 | 167 | if (preg_match($pattern, $query)) { |
| 168 | 168 | return false; |
| 169 | 169 | } |
@@ -13,6 +13,6 @@ |
||
| 13 | 13 | { |
| 14 | 14 | protected function configure() |
| 15 | 15 | { |
| 16 | - $this->bind('Ray\Di\InstanceInterface')->toProvider(__NAMESPACE__ . '\DiCompilerProvider')->in(Scope::SINGLETON); |
|
| 16 | + $this->bind('Ray\Di\InstanceInterface')->toProvider(__NAMESPACE__.'\DiCompilerProvider')->in(Scope::SINGLETON); |
|
| 17 | 17 | } |
| 18 | 18 | } |
@@ -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 | } |
@@ -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 | ); |
@@ -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 |