@@ -9,8 +9,6 @@ |
||
| 9 | 9 | use Composer\Autoload\ClassLoader; |
| 10 | 10 | use Doctrine\Common\Annotations\AnnotationRegistry; |
| 11 | 11 | use Doctrine\Common\Annotations\AnnotationReader; |
| 12 | -use Doctrine\Common\Cache\ApcCache; |
|
| 13 | -use Doctrine\Common\Cache\FilesystemCache; |
|
| 14 | 12 | use BEAR\Package\Module\Di\DiCompilerProvider; |
| 15 | 13 | use Doctrine\Common\Cache\Cache; |
| 16 | 14 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | public static function registerLoader(ClassLoader $loader, $appName, $appDir) |
| 25 | 25 | { |
| 26 | 26 | /** @var $loader \Composer\Autoload\ClassLoader */ |
| 27 | - $loader->addPsr4($appName . '\\', $appDir . '/src'); |
|
| 27 | + $loader->addPsr4($appName.'\\', $appDir.'/src'); |
|
| 28 | 28 | |
| 29 | 29 | AnnotationRegistry::registerLoader([$loader, 'loadClass']); |
| 30 | 30 | AnnotationReader::addGlobalIgnoredName('noinspection'); |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | apc_clear_cache(); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - $unlink = function ($path) use (&$unlink) { |
|
| 65 | - foreach (glob(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*') as $file) { |
|
| 64 | + $unlink = function($path) use (&$unlink) { |
|
| 65 | + foreach (glob(rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'*') as $file) { |
|
| 66 | 66 | is_dir($file) ? $unlink($file) : unlink($file); |
| 67 | 67 | @rmdir($file); |
| 68 | 68 | } |
@@ -70,6 +70,6 @@ discard block |
||
| 70 | 70 | foreach ($dirs as $dir) { |
| 71 | 71 | $unlink($dir); |
| 72 | 72 | } |
| 73 | - $unlink(dirname(__DIR__) . '/var/tmp'); |
|
| 73 | + $unlink(dirname(__DIR__).'/var/tmp'); |
|
| 74 | 74 | } |
| 75 | 75 | } |
@@ -13,7 +13,6 @@ |
||
| 13 | 13 | use BEAR\Resource\Exception\ResourceNotFound; |
| 14 | 14 | use BEAR\Resource\Exception\Scheme; |
| 15 | 15 | use BEAR\Resource\Exception\Uri; |
| 16 | -use BEAR\Sunday\Exception\LogicException; |
|
| 17 | 16 | use BEAR\Sunday\Extension\WebResponse\ResponseInterface; |
| 18 | 17 | use BEAR\Sunday\Inject\LogDirInject; |
| 19 | 18 | use Exception; |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | ) { |
| 95 | 95 | $this->viewTemplate = $exceptionTpl; |
| 96 | 96 | $this->response = $response; |
| 97 | - $this->errorPage = $errorPage ? : new ErrorPage; |
|
| 97 | + $this->errorPage = $errorPage ?: new ErrorPage; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | private function buildErrorPage($e, ResourceObject $response) |
| 134 | 134 | { |
| 135 | - $exceptionId = 'e' . $response->code . '-' . substr(md5((string) $e), 0, 5); |
|
| 135 | + $exceptionId = 'e'.$response->code.'-'.substr(md5((string) $e), 0, 5); |
|
| 136 | 136 | try { |
| 137 | 137 | throw $e; |
| 138 | 138 | } catch (ResourceNotFound $e) { |
@@ -179,9 +179,9 @@ discard block |
||
| 179 | 179 | } |
| 180 | 180 | $response->headers['X-EXCEPTION-CLASS'] = get_class($e); |
| 181 | 181 | $response->headers['X-EXCEPTION-MESSAGE'] = str_replace(PHP_EOL, ' ', $e->getMessage()); |
| 182 | - $response->headers['X-EXCEPTION-CODE-FILE-LINE'] = '(' . $e->getCode() . ') ' . $e->getFile( |
|
| 183 | - ) . ':' . $e->getLine(); |
|
| 184 | - $previous = $e->getPrevious() ? (get_class($e->getPrevious()) . ': ' . str_replace( |
|
| 182 | + $response->headers['X-EXCEPTION-CODE-FILE-LINE'] = '('.$e->getCode().') '.$e->getFile( |
|
| 183 | + ).':'.$e->getLine(); |
|
| 184 | + $previous = $e->getPrevious() ? (get_class($e->getPrevious()).': '.str_replace( |
|
| 185 | 185 | PHP_EOL, |
| 186 | 186 | ' ', |
| 187 | 187 | $e->getPrevious()->getMessage() |
@@ -260,10 +260,10 @@ discard block |
||
| 260 | 260 | $data = (string) $e; |
| 261 | 261 | $previousE = $e->getPrevious(); |
| 262 | 262 | if ($previousE) { |
| 263 | - $data .= PHP_EOL . PHP_EOL . '-- Previous Exception --' . PHP_EOL . PHP_EOL; |
|
| 263 | + $data .= PHP_EOL.PHP_EOL.'-- Previous Exception --'.PHP_EOL.PHP_EOL; |
|
| 264 | 264 | $data .= $previousE->getTraceAsString(); |
| 265 | 265 | } |
| 266 | - $data .= PHP_EOL . PHP_EOL . '-- Bindings --' . PHP_EOL . (string) $this->injector; |
|
| 266 | + $data .= PHP_EOL.PHP_EOL.'-- Bindings --'.PHP_EOL.(string) $this->injector; |
|
| 267 | 267 | $file = $this->getLogFilePath($exceptionId); |
| 268 | 268 | if (is_writable($this->logDir)) { |
| 269 | 269 | file_put_contents($file, $data); |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | use Ray\Aop\MethodInterceptor; |
| 10 | 10 | use Ray\Aop\MethodInvocation; |
| 11 | 11 | use Ray\Di\Di\Inject; |
| 12 | -use Ray\Di\Di\Named; |
|
| 13 | 12 | use ReflectionMethod; |
| 14 | 13 | use Doctrine\Common\Cache\Cache; |
| 15 | 14 | |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | use Ray\Aop\MethodInvocation; |
| 11 | 11 | use Aura\Input\Form; |
| 12 | 12 | use Ray\Di\Di\Inject; |
| 13 | -use Ray\Di\Di\Named; |
|
| 14 | 13 | use Aura\Session\Manager as Session; |
| 15 | 14 | use BEAR\Package\Module\Session\AuraSession\AntiCsrf; |
| 16 | 15 | |
@@ -6,10 +6,7 @@ |
||
| 6 | 6 | */ |
| 7 | 7 | namespace BEAR\Package\Module\Resource; |
| 8 | 8 | |
| 9 | -use BEAR\Package\Provide as ProvideModule; |
|
| 10 | -use BEAR\Sunday\Module as SundayModule; |
|
| 11 | 9 | use Ray\Di\AbstractModule; |
| 12 | -use Ray\Di\Scope; |
|
| 13 | 10 | |
| 14 | 11 | class ResourceGraphModule extends AbstractModule |
| 15 | 12 | { |
@@ -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 | } |
@@ -10,11 +10,9 @@ |
||
| 10 | 10 | use Aura\Signal\Manager; |
| 11 | 11 | use Aura\Signal\ResultCollection; |
| 12 | 12 | use Aura\Signal\ResultFactory; |
| 13 | -use BEAR\Package\Provide as ProvideModule; |
|
| 14 | 13 | use BEAR\Resource\Param; |
| 15 | 14 | use BEAR\Resource\SignalParameter; |
| 16 | 15 | use BEAR\Resource\ParamProviderInterface; |
| 17 | -use BEAR\Sunday\Module as SundayModule; |
|
| 18 | 16 | use Ray\Di\InstanceInterface; |
| 19 | 17 | use Ray\Di\ProviderInterface; |
| 20 | 18 | use Ray\Di\Di\Inject; |
@@ -11,7 +11,6 @@ |
||
| 11 | 11 | use Nocarrier\Hal; |
| 12 | 12 | use BEAR\Resource\Link; |
| 13 | 13 | use Ray\Di\Di\Inject; |
| 14 | -use Ray\Di\Di\Named; |
|
| 15 | 14 | |
| 16 | 15 | class HalFactory implements HalFactoryInterface |
| 17 | 16 | { |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | */ |
| 7 | 7 | namespace BEAR\Package\Provide\WebResponse; |
| 8 | 8 | |
| 9 | -use BEAR\Resource\ResourceObject as Page; |
|
| 10 | 9 | use BEAR\Resource\ResourceObject; |
| 11 | 10 | use BEAR\Resource\RenderInterface; |
| 12 | 11 | use BEAR\Sunday\Exception\InvalidResourceType; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public function render(RenderInterface $renderer = null) |
| 116 | 116 | { |
| 117 | - $this->view = is_null($renderer) ? (string) $this->resource : $renderer->render($this->resource); |
|
| 117 | + $this->view = is_null($renderer) ? (string) $this->resource : $renderer->render($this->resource); |
|
| 118 | 118 | |
| 119 | 119 | return $this; |
| 120 | 120 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | // compliant with RFC 2616. |
| 131 | 131 | $this->response; |
| 132 | 132 | |
| 133 | - if (! $this->isCli) { |
|
| 133 | + if (!$this->isCli) { |
|
| 134 | 134 | $this->response->send(); |
| 135 | 135 | return $this; |
| 136 | 136 | } |
@@ -22,13 +22,13 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | // label |
| 24 | 24 | $receiver = $trace[0]; |
| 25 | - $method = (isset($trace[1]['class'])) ? " ({$trace[1]['class']}" . '::' . "{$trace[1]['function']})" : ''; |
|
| 25 | + $method = (isset($trace[1]['class'])) ? " ({$trace[1]['class']}".'::'."{$trace[1]['function']})" : ''; |
|
| 26 | 26 | preg_match( |
| 27 | 27 | "/{$receiver['function']}\((.+)[\s,\)]/is", |
| 28 | 28 | trim(file($receiver['file'])[$receiver['line'] - 1]), |
| 29 | 29 | $matches |
| 30 | 30 | ); |
| 31 | - list($varName, $varDump) = isset($matches[1]) ? [$matches[1], $varDump] : ['(void)', '<br>']; |
|
| 31 | + list($varName, $varDump) = isset($matches[1]) ? [$matches[1], $varDump] : ['(void)', '<br>']; |
|
| 32 | 32 | |
| 33 | 33 | if ($isCli) { |
| 34 | 34 | self::outputCli($varName, $var, $receiver, $method); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | // contents |
| 54 | 54 | $isCli = (PHP_SAPI === 'cli'); |
| 55 | 55 | $htmlErrors = ini_get('html_errors'); |
| 56 | - if (! extension_loaded('xdebug')) { |
|
| 56 | + if (!extension_loaded('xdebug')) { |
|
| 57 | 57 | ini_set('html_errors', 'On'); |
| 58 | 58 | return [$htmlErrors, $isCli]; |
| 59 | 59 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $colorClose = "\033[0m"; |
| 101 | 101 | echo "{$colorOpenReverse}{$varName}{$colorClose} = "; |
| 102 | 102 | var_dump($var); |
| 103 | - echo $colorOpenPlain . "in {$colorOpenBold}{$receiver['file']}{$colorClose}{$colorOpenPlain}"; |
|
| 103 | + echo $colorOpenPlain."in {$colorOpenBold}{$receiver['file']}{$colorClose}{$colorOpenPlain}"; |
|
| 104 | 104 | echo "on line {$receiver['line']}{$method}{$colorClose}\n"; |
| 105 | 105 | } |
| 106 | 106 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | private static function outputFb($var, $file, $line) |
| 115 | 115 | { |
| 116 | - $label = __FUNCTION__ . "() in {$file} on line {$line}"; |
|
| 116 | + $label = __FUNCTION__."() in {$file} on line {$line}"; |
|
| 117 | 117 | /** @noinspection PhpUndefinedClassInspection */ |
| 118 | 118 | /** @noinspection PhpUndefinedMethodInspection */ |
| 119 | 119 | FB::group($label); |