@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | private function getPageLog(ExtendedPdo $db, $page) |
| 58 | 58 | { |
| 59 | 59 | $result = $db->fetchAll( |
| 60 | - 'SELECT * FROM `log` WHERE `extra_page` = ' . "'{$page}' ORDER BY id ASC" |
|
| 60 | + 'SELECT * FROM `log` WHERE `extra_page` = '."'{$page}' ORDER BY id ASC" |
|
| 61 | 61 | ); |
| 62 | 62 | $logs = []; |
| 63 | 63 | $log = ''; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $body = print_a(json_decode($log['body'], true), "return:1"); |
| 90 | 90 | $meta = $this->getHeaderInfo($log['req'], $log['header']); |
| 91 | 91 | if ($meta) { |
| 92 | - $body .= '<i class="icon-info-sign"></i><br>' . print_a($meta, "return:1"); |
|
| 92 | + $body .= '<i class="icon-info-sign"></i><br>'.print_a($meta, "return:1"); |
|
| 93 | 93 | } |
| 94 | 94 | $tableBody .= <<<EOT |
| 95 | 95 | <tr> |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | EOT; |
| 104 | 104 | } |
| 105 | 105 | $path = isset($log['path']) ? $log['path'] : ''; |
| 106 | - $body = $this->getTableOpen($path, $logs) . $tableBody . self::TABLE_CLOSE; |
|
| 106 | + $body = $this->getTableOpen($path, $logs).$tableBody.self::TABLE_CLOSE; |
|
| 107 | 107 | |
| 108 | 108 | return $body; |
| 109 | 109 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $meta = []; |
| 161 | 161 | |
| 162 | 162 | $method = substr($req, 0, 3); |
| 163 | - $onMethod = 'on' . ucwords($method); |
|
| 163 | + $onMethod = 'on'.ucwords($method); |
|
| 164 | 164 | $header = json_decode($header, true); |
| 165 | 165 | |
| 166 | 166 | // interceptors |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | */ |
| 53 | 53 | private function getPath($path) |
| 54 | 54 | { |
| 55 | - if (! is_array($path)) { |
|
| 55 | + if (!is_array($path)) { |
|
| 56 | 56 | $isDir = 'true'; |
| 57 | 57 | $path = $this->root; |
| 58 | 58 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function service($pagePath, AppInterface $app, $appDir) |
| 34 | 34 | { |
| 35 | - global $app; // for template |
|
| 35 | + global $app; // for template |
|
| 36 | 36 | global $appDir; // for template |
| 37 | 37 | |
| 38 | 38 | $path = parse_url(substr($pagePath, 4))['path']; |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $path .= 'index.php'; |
| 42 | 42 | } |
| 43 | 43 | $packageRoot = dirname(dirname(dirname(__DIR__))); |
| 44 | - $scriptFile = $packageRoot . '/var/www/dev/' . $path; |
|
| 44 | + $scriptFile = $packageRoot.'/var/www/dev/'.$path; |
|
| 45 | 45 | if (file_exists($scriptFile) && is_file($scriptFile)) { |
| 46 | 46 | /** @noinspection PhpIncludeInspection */ |
| 47 | 47 | ob_start(); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | public function isDevWebService($sapiName, $requestUri) |
| 73 | 73 | { |
| 74 | 74 | $path = substr($requestUri, 0, 5); |
| 75 | - $isDevTool = ($sapiName !== 'cli') && ($path === '/dev' || $path === '/dev/'); |
|
| 75 | + $isDevTool = ($sapiName !== 'cli') && ($path === '/dev' || $path === '/dev/'); |
|
| 76 | 76 | |
| 77 | 77 | return $isDevTool; |
| 78 | 78 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | function getCachedApp($appName, $context, $tmpDir) |
| 40 | 40 | { |
| 41 | - $injector = function () use ($appName, $context, $tmpDir) { |
|
| 41 | + $injector = function() use ($appName, $context, $tmpDir) { |
|
| 42 | 42 | $appModule = "{$appName}\Module\AppModule"; |
| 43 | 43 | return new Injector( |
| 44 | 44 | new Container(new Forge(new Config(new Annotation(new Definition, new AnnotationReader)))), |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | new DiLogger |
| 52 | 52 | ); |
| 53 | 53 | }; |
| 54 | - $initialization = function (AbstractApp $app) use ($context) { |
|
| 54 | + $initialization = function(AbstractApp $app) use ($context) { |
|
| 55 | 55 | if ($context === 'prod') { |
| 56 | 56 | (new ApplicationReflector($app))->compileAllResources(); |
| 57 | 57 | } |
@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | $cache = function_exists('apc_fetch') ? |
| 61 | 61 | new FusionCache( |
| 62 | 62 | new ApcCache, |
| 63 | - function () use ($tmpDir) { |
|
| 63 | + function() use ($tmpDir) { |
|
| 64 | 64 | return new FilesystemCache($tmpDir); |
| 65 | 65 | } |
| 66 | 66 | ) |
| 67 | 67 | : new FilesystemCache($tmpDir); |
| 68 | - $injector = new CacheInjector($injector, $initialization, $appName . $context, $cache); |
|
| 68 | + $injector = new CacheInjector($injector, $initialization, $appName.$context, $cache); |
|
| 69 | 69 | $app = $injector->getInstance('\BEAR\Sunday\Extension\Application\AppInterface'); |
| 70 | 70 | /* @var $app \BEAR\Sunday\Extension\Application\AppInterface */ |
| 71 | 71 | return $app; |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * @param $context |
| 35 | 35 | * @param null $tmpDir |
| 36 | 36 | * |
| 37 | - * @return \BEAR\Sunday\Extension\Application\AppInterface|object |
|
| 37 | + * @return \BEAR\Sunday\Extension\Application\AppInterface |
|
| 38 | 38 | */ |
| 39 | 39 | function getCachedApp($appName, $context, $tmpDir) |
| 40 | 40 | { |
@@ -25,7 +25,6 @@ |
||
| 25 | 25 | use Ray\Di\Logger as DiLogger; |
| 26 | 26 | use Koriym\FusionCache\DoctrineCache as FusionCache; |
| 27 | 27 | use Doctrine\Common\Annotations\AnnotationReader; |
| 28 | -use Ray\Di\CompileLogger; |
|
| 29 | 28 | |
| 30 | 29 | /** |
| 31 | 30 | * Return application instance |
@@ -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 | } |
@@ -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( |