@@ -19,7 +19,7 @@ |
||
| 19 | 19 | public function getEtag($object, $args) |
| 20 | 20 | { |
| 21 | 21 | $args = ($args instanceof \ArrayObject) ? $args->getArrayCopy() : $args; |
| 22 | - $etag = crc32(get_class($object) . serialize($args)); |
|
| 22 | + $etag = crc32(get_class($object).serialize($args)); |
|
| 23 | 23 | |
| 24 | 24 | return $etag; |
| 25 | 25 | } |
@@ -19,12 +19,12 @@ |
||
| 19 | 19 | $this->bindInterceptor( |
| 20 | 20 | $this->matcher->any(), |
| 21 | 21 | $this->matcher->annotatedWith('BEAR\Sunday\Annotation\Cache'), |
| 22 | - [$this->requestInjection(__NAMESPACE__ . '\Interceptor\CacheLoader')] |
|
| 22 | + [$this->requestInjection(__NAMESPACE__.'\Interceptor\CacheLoader')] |
|
| 23 | 23 | ); |
| 24 | 24 | $this->bindInterceptor( |
| 25 | 25 | $this->matcher->any(), |
| 26 | 26 | $this->matcher->annotatedWith('BEAR\Sunday\Annotation\CacheUpdate'), |
| 27 | - [$this->requestInjection(__NAMESPACE__ . '\Interceptor\CacheUpdater')] |
|
| 27 | + [$this->requestInjection(__NAMESPACE__.'\Interceptor\CacheUpdater')] |
|
| 28 | 28 | ); |
| 29 | 29 | } |
| 30 | 30 | } |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | global $appDir; |
| 49 | 49 | |
| 50 | 50 | $appDir = $this->appDir; |
| 51 | - $constantsCollection = require $this->appDir . '/var/conf/constants.php'; |
|
| 51 | + $constantsCollection = require $this->appDir.'/var/conf/constants.php'; |
|
| 52 | 52 | $constants = $constantsCollection[$this->context] + $constantsCollection['prod'] + ($this->getDefaultConstants($appDir)); |
| 53 | - $paramsCollection = require $this->appDir . '/var/conf/params.php'; |
|
| 53 | + $paramsCollection = require $this->appDir.'/var/conf/params.php'; |
|
| 54 | 54 | $params = $paramsCollection[$this->context] + $paramsCollection['prod']; |
| 55 | 55 | $appClass = $constants['app_class']; |
| 56 | 56 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | { |
| 75 | 75 | return [ |
| 76 | 76 | 'app_name'=> $this->nameSpace, |
| 77 | - 'app_class' => $this->nameSpace . '\App', |
|
| 77 | + 'app_class' => $this->nameSpace.'\App', |
|
| 78 | 78 | 'tmp_dir' => "{$appDir}/var/tmp", |
| 79 | 79 | 'log_dir' => "{$appDir}/var/log", |
| 80 | 80 | 'lib_dir' => "{$appDir}/var/lib", |
@@ -39,6 +39,6 @@ |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | $this->bind()->annotatedWith('param_providers')->toInstance(serialize($paramProviders)); |
| 42 | - $this->bind('BEAR\Resource\SignalParameterInterface')->toProvider(__NAMESPACE__ . '\SignalParamProvider'); |
|
| 42 | + $this->bind('BEAR\Resource\SignalParameterInterface')->toProvider(__NAMESPACE__.'\SignalParamProvider'); |
|
| 43 | 43 | } |
| 44 | 44 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | $this->bindInterceptor( |
| 22 | 22 | $this->matcher->any(), |
| 23 | 23 | $this->matcher->annotatedWith('BEAR\Sunday\Annotation\ResourceGraph'), |
| 24 | - [$this->requestInjection(__NAMESPACE__ . '\Interceptor\ResourceGraph')] |
|
| 24 | + [$this->requestInjection(__NAMESPACE__.'\Interceptor\ResourceGraph')] |
|
| 25 | 25 | ); |
| 26 | 26 | } |
| 27 | 27 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | { |
| 59 | 59 | $this->db = $db; |
| 60 | 60 | |
| 61 | - $currentPage = $this->currentPage ? : (isset($_GET[$this->pageKey]) ? $_GET[$this->pageKey] : 1); |
|
| 61 | + $currentPage = $this->currentPage ?: (isset($_GET[$this->pageKey]) ? $_GET[$this->pageKey] : 1); |
|
| 62 | 62 | $this->firstResult = ($currentPage - 1) * $this->maxPerPage; |
| 63 | 63 | $pagerfanta->setMaxPerPage($this->maxPerPage); |
| 64 | 64 | $pagerfanta->setCurrentPage($currentPage, false, true); |
@@ -82,8 +82,8 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | private function getHtml(Pagerfanta $pagerfanta) |
| 84 | 84 | { |
| 85 | - $view = $this->view ? : new TwitterBootstrapView; |
|
| 86 | - $routeGenerator = $this->routeGenerator ? : function ($page) { |
|
| 85 | + $view = $this->view ?: new TwitterBootstrapView; |
|
| 86 | + $routeGenerator = $this->routeGenerator ?: function($page) { |
|
| 87 | 87 | return "?{$this->pageKey}={$page}"; |
| 88 | 88 | }; |
| 89 | 89 | $html = $view->render( |
@@ -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 | } |