Completed
Push — 0.x ( a2b070...a5c73d )
by Akihito
09:21
created
src/Bootstrap/Bootstrap.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Dev/Debug/ExceptionHandle/ExceptionHandler.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Module/Cache/Interceptor/CacheUpdater.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Module/Form/AuraForm/AuraFormTrait.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Module/Resource/ResourceGraphModule.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -6,10 +6,7 @@
 block discarded – undo
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
 {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Module/Resource/SignalParamProvider.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -10,11 +10,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Provide/ResourceView/HalFactory.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
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
 {
Please login to merge, or discard this patch.
src/Provide/WebResponse/HttpFoundation.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Installer.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.