@@ -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 | } |
@@ -21,13 +21,13 @@ discard block |
||
21 | 21 | $version = $event->getComposer()->getPackage()->getPrettyVersion(); |
22 | 22 | $hash = $event->getComposer()->getLocker()->getLockData()['hash']; |
23 | 23 | $packageDir = dirname(__DIR__); |
24 | - file_put_contents($packageDir . '/VERSION', $version); |
|
25 | - file_put_contents($packageDir . '/ID', $hash); |
|
24 | + file_put_contents($packageDir.'/VERSION', $version); |
|
25 | + file_put_contents($packageDir.'/ID', $hash); |
|
26 | 26 | |
27 | - $targetHello = dirname(__DIR__) . '/vendor/bear/demo-apps/Demo.Helloworld'; |
|
28 | - $targetSandbox = dirname(__DIR__) . '/vendor/bear/demo-apps/Demo.Sandbox'; |
|
29 | - $helloApp = dirname(__DIR__) . '/apps/Demo.Helloworld'; |
|
30 | - $sandboxApp = dirname(__DIR__) . '/apps/Demo.Sandbox'; |
|
27 | + $targetHello = dirname(__DIR__).'/vendor/bear/demo-apps/Demo.Helloworld'; |
|
28 | + $targetSandbox = dirname(__DIR__).'/vendor/bear/demo-apps/Demo.Sandbox'; |
|
29 | + $helloApp = dirname(__DIR__).'/apps/Demo.Helloworld'; |
|
30 | + $sandboxApp = dirname(__DIR__).'/apps/Demo.Sandbox'; |
|
31 | 31 | |
32 | 32 | if (file_exists($helloApp)) { |
33 | 33 | unlink($helloApp); |
@@ -38,6 +38,6 @@ discard block |
||
38 | 38 | symlink($targetHello, $helloApp); |
39 | 39 | symlink($targetSandbox, $sandboxApp); |
40 | 40 | |
41 | - include $packageDir . '/bin/bear.env'; |
|
41 | + include $packageDir.'/bin/bear.env'; |
|
42 | 42 | } |
43 | 43 | } |