Completed
Pull Request — 0.x (#235)
by Akihito
03:27
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/Dev/Debug/Debug.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.