Completed
Pull Request — 0.x (#235)
by Akihito
03:27
created
var/www/dev/app/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 if (isset($_GET['property'])) {
12 12
     $graph = (new Printo($app))->setRange(Printo::RANGE_PROPERTY)->setLinkDistance(130)->setCharge(-500);
13
-    $a1 =$disabled;
13
+    $a1 = $disabled;
14 14
 } elseif (isset($_GET['full'])) {
15 15
     $graph = (new Printo($app))->setRange(Printo::RANGE_ALL);
16 16
     $a3 = $disabled;
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 }
21 21
 
22 22
 $view['app_name'] = get_class($app);
23
-$contentsForLayout =<<<EOT
23
+$contentsForLayout = <<<EOT
24 24
     <ul class="breadcrumb">
25 25
     <li><a href="/dev">Home</a> </li>
26 26
     <li class="active">Application</li>
@@ -33,4 +33,4 @@  discard block
 block discarded – undo
33 33
 
34 34
     {$graph}
35 35
 EOT;
36
-echo include dirname(__DIR__) . '/view/layout.php';
36
+echo include dirname(__DIR__).'/view/layout.php';
Please login to merge, or discard this patch.
var/www/dev/di/index.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,13 +15,13 @@  discard block
 block discarded – undo
15 15
 //$module->activate();
16 16
 //$bindings = nl2br((string)$module);
17 17
 
18
-$bindings = nl2br((string)$injector);
18
+$bindings = nl2br((string) $injector);
19 19
 $bindings = preg_replace('/\w+:/', '<span style="background-color: #FFFFCC; font-weight:bold">$0</span>', $bindings);
20
-$injections = nl2br((string)$injector->getLogger());
20
+$injections = nl2br((string) $injector->getLogger());
21 21
 $injections = preg_replace('/\w+:/', '<span style="background-color: #FFFFCC; font-weight:bold">$0</span>', $injections);
22 22
 $injections = preg_replace('/#singleton/', '<span style="color: gray; ">$0</span>', $injections);
23 23
 $injections = preg_replace('/#prototype/', '<span style="color: red; ">$0</span>', $injections);
24
-$contentsForLayout =<<<EOT
24
+$contentsForLayout = <<<EOT
25 25
     <ul class="breadcrumb">
26 26
     <li><a href="/dev">Home</a> </li>
27 27
     <li class="active">Di log</li>
@@ -37,4 +37,4 @@  discard block
 block discarded – undo
37 37
     </div>
38 38
 EOT;
39 39
 
40
-echo include dirname(__DIR__) . '/view/layout.php';
40
+echo include dirname(__DIR__).'/view/layout.php';
Please login to merge, or discard this patch.
var/www/dev/clear/index.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@  discard block
 block discarded – undo
6 6
  * @global $appDir string
7 7
  */
8 8
 
9
-error_log('app files cleared by ' . __FILE__);
10
-require $appDir . '/bin/clear.php';
9
+error_log('app files cleared by '.__FILE__);
10
+require $appDir.'/bin/clear.php';
11 11
 
12 12
 
13 13
 $view['app_name'] = get_class($app);
14 14
 $time = date('r', time());
15
-$contentsForLayout =<<<EOT
15
+$contentsForLayout = <<<EOT
16 16
     <ul class="breadcrumb">
17 17
     <li><a href="/devs">Home</a> </li>
18 18
     <li class="active">Clear</li>
@@ -26,4 +26,4 @@  discard block
 block discarded – undo
26 26
     <span class="btn btn-default"><span class="glyphicon glyphicon-trash"></span> Retry</span></a>
27 27
 EOT;
28 28
 
29
-echo include dirname(__DIR__) . '/view/layout.php';
29
+echo include dirname(__DIR__).'/view/layout.php';
Please login to merge, or discard this patch.
var/www/dev/log/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 use BEAR\Package\Dev\Resource\ResourceLog;
9 9
 
10 10
 dependency: {
11
-    $file = $appDir . '/var/log/resource.db';
11
+    $file = $appDir.'/var/log/resource.db';
12 12
     $cacheClear = isset($_GET['clear']);
13 13
 }
14 14
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     $view['log'] = (new ResourceLog($file))->toTable();
26 26
 }
27 27
 output: {
28
-    $contentsForLayout = \DbugL::$css . <<<EOT
28
+    $contentsForLayout = \DbugL::$css.<<<EOT
29 29
     <ul class="breadcrumb">
30 30
     <li><a href="/dev">Home</a> </li>
31 31
     <li class="active">Log</li>
@@ -33,5 +33,5 @@  discard block
 block discarded – undo
33 33
     <p><a href="index"><span class="btn">Reload</span></a> <a href="index?clear"><span class="btn">Clear</span></a></p>
34 34
     {$view['log']}
35 35
 EOT;
36
-    echo include dirname(__DIR__) . '/view/layout.php';
36
+    echo include dirname(__DIR__).'/view/layout.php';
37 37
 }
Please login to merge, or discard this patch.
var/www/dev/resource/new.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     $appReflector = new ApplicationReflector($app);
16 16
     $view['app_name'] = $appReflector->appName;
17 17
     $resources = $appReflector->getResources();
18
-    if (! isset($_POST['uri'])) {
18
+    if (!isset($_POST['uri'])) {
19 19
         $body = '';
20 20
         goto output;
21 21
     }
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 view: {
37 37
     $view['app_name'] = $appReflector->appName;
38 38
     $uri = $_POST['uri'];
39
-    $contents = '<pre>' . highlight_string($fileContents, true) . '</pre>';
39
+    $contents = '<pre>'.highlight_string($fileContents, true).'</pre>';
40 40
     $file = urlencode($filePath);
41 41
     $edit = ($code === 201) ? "<a href=\"../edit/?file={$file}\"><span class=\"btn\">Edit</span></a>" : '';
42 42
     $body = <<<EOT
@@ -72,5 +72,5 @@  discard block
 block discarded – undo
72 72
     {$body}
73 73
 EOT;
74 74
     // two step view
75
-    echo include $devDir . '/view/layout.php';
75
+    echo include $devDir.'/view/layout.php';
76 76
 }
Please login to merge, or discard this patch.
var/www/dev/resource/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         $linkKeys = array_keys($resource['links']);
49 49
         $links = '';
50 50
         foreach ($linkKeys as $link) {
51
-            $links .= '<span class="label label-default">' . $link . '</span> ';
51
+            $links .= '<span class="label label-default">'.$link.'</span> ';
52 52
         }
53 53
         foreach ($resource['options'] as $method => $param) {
54 54
             $param = "<span class=\"strong\">{$param}</span>";
@@ -76,5 +76,5 @@  discard block
 block discarded – undo
76 76
 EOT;
77 77
     // two step view
78 78
     /** @noinspection PhpIncludeInspection */
79
-    echo include $devDir . '/view/layout.php';
79
+    echo include $devDir.'/view/layout.php';
80 80
 }
Please login to merge, or discard this patch.
var/www/dev/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
  */
6 6
 
7 7
 $view['app_name'] = $appDir;
8
-$contentsForLayout =<<<EOT
8
+$contentsForLayout = <<<EOT
9 9
     <style>
10 10
         .glyphicon {
11 11
             font-size: 20px;
@@ -45,4 +45,4 @@  discard block
 block discarded – undo
45 45
     </div>
46 46
     ****
47 47
 EOT;
48
-echo include __DIR__ . '/view/layout.php';
48
+echo include __DIR__.'/view/layout.php';
Please login to merge, or discard this patch.
src/Dev/Dev.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 
11 11
 namespace BEAR\Package\Dev;
12 12
 
13
-use Aura\Di\Exception;
14 13
 use BEAR\Ace\ErrorEditor;
15 14
 use BEAR\Package\Dev\Debug\ExceptionHandle\ExceptionHandler;
16 15
 use BEAR\Package\Dev\Web\Web;
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     ) {
100 100
         global $argv;
101 101
 
102
-        $this->web = $web ? : new Web;
102
+        $this->web = $web ?: new Web;
103 103
         if (is_null($server) && isset($_SERVER)) {
104 104
             $server = $_SERVER;
105 105
         }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         } elseif (isset($argv[2])) {
109 109
             $this->requestUri = $argv[2];
110 110
         }
111
-        $this->sapiName = $sapiName ? : php_sapi_name();
111
+        $this->sapiName = $sapiName ?: php_sapi_name();
112 112
     }
113 113
 
114 114
     /**
@@ -132,10 +132,10 @@  discard block
 block discarded – undo
132 132
 
133 133
         // stop
134 134
         register_shutdown_function(
135
-            function () {
135
+            function() {
136 136
                 $xhprof = xhprof_disable();
137 137
                 if (!$xhprof) {
138
-                    error_log('xhprof failed in ' . __FILE__);
138
+                    error_log('xhprof failed in '.__FILE__);
139 139
 
140 140
                     return;
141 141
                 }
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         ini_set('xdebug.collect_params', 0);
161 161
         ini_set('xdebug.max_nesting_level', 500);
162 162
         ini_set('xdebug.file_link_format', '/dev/edit/?file=%f&line=$l');
163
-        if (! ini_get('date.timezone')) {
163
+        if (!ini_get('date.timezone')) {
164 164
             date_default_timezone_set('Asia/Tokyo');
165 165
         }
166 166
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
      */
173 173
     public function registerErrorHandler()
174 174
     {
175
-        set_error_handler( function ($errNo, $errStr, $errFile, $errLine) {
175
+        set_error_handler(function($errNo, $errStr, $errFile, $errLine) {
176 176
             if (error_reporting() === 0) {
177 177
 
178 178
                 // return in error-control operator(@)
@@ -209,14 +209,14 @@  discard block
 block discarded – undo
209 209
     public function registerExceptionHandler($logDir)
210 210
     {
211 211
         set_exception_handler(
212
-            function ($e) use ($logDir) {
212
+            function($e) use ($logDir) {
213 213
                 if ($e instanceof \Error) {
214 214
                     $e = new ErrorException($e->getMessage());
215 215
                 }
216 216
                 var_dump(get_class($e));
217 217
                 $handler = new ExceptionHandler(
218 218
                     new SymfonyResponse(new ConsoleOutput),
219
-                    (dirname(__DIR__)) . '/Dev/Module/ExceptionHandle/template/exception.php'
219
+                    (dirname(__DIR__)).'/Dev/Module/ExceptionHandle/template/exception.php'
220 220
                 );
221 221
                 $handler->setLogDir($logDir);
222 222
                 $handler->handle($e);
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
     public function registerFatalErrorHandler()
256 256
     {
257 257
         register_shutdown_function(
258
-            function () {
258
+            function() {
259 259
                 if (PHP_SAPI === 'cli') {
260 260
                     return;
261 261
                 }
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
                 $outputBuffer = ob_get_clean();
275 275
                 error_log($outputBuffer);
276 276
                 http_response_code(500);
277
-                $html = require __DIR__ . '/view/fatal_error.php';
277
+                $html = require __DIR__.'/view/fatal_error.php';
278 278
                 echo $html;
279 279
                 exit(1);
280 280
             }
@@ -307,10 +307,10 @@  discard block
 block discarded – undo
307 307
         if (isset($this->app->router)) {
308 308
             $this->route($this->app);
309 309
         }
310
-        if (! $this->web->isDevWebService($this->sapiName, $this->requestUri)) {
310
+        if (!$this->web->isDevWebService($this->sapiName, $this->requestUri)) {
311 311
             return '';
312 312
         }
313
-        $requestUri = $requestUri ? : $_SERVER['REQUEST_URI'];
313
+        $requestUri = $requestUri ?: $_SERVER['REQUEST_URI'];
314 314
         $html = $this->web->service($requestUri, $this->app, $this->appDir);
315 315
 
316 316
         return $html;
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
      */
333 333
     public function loadDevFunctions()
334 334
     {
335
-        error_log(__METHOD__  . ' is no longer necessary.');
335
+        error_log(__METHOD__.' is no longer necessary.');
336 336
 
337 337
         return $this;
338 338
     }
@@ -361,11 +361,11 @@  discard block
 block discarded – undo
361 361
      */
362 362
     private function getVendorDirectory()
363 363
     {
364
-        $vendorDir = dirname(dirname(__DIR__)) . '/vendor';
364
+        $vendorDir = dirname(dirname(__DIR__)).'/vendor';
365 365
 
366 366
         if (strpos(__DIR__, '/vendor/bear/package') !== false) {
367 367
             $baseDir = explode('/vendor/bear/package', __DIR__)[0];
368
-            $vendorDir = $baseDir . '/vendor';
368
+            $vendorDir = $baseDir.'/vendor';
369 369
         }
370 370
         return $vendorDir;
371 371
     }
Please login to merge, or discard this patch.
src/Installer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
     public static function packageUpdate(Event $event)
20 20
     {
21 21
         $packageDir = dirname(__DIR__);
22
-        $targetHello = dirname(__DIR__) . '/vendor/bear/demo-apps/Demo.Helloworld';
23
-        $targetSandbox = dirname(__DIR__) . '/vendor/bear/demo-apps/Demo.Sandbox';
24
-        $helloApp = dirname(__DIR__) . '/apps/Demo.Helloworld';
25
-        $sandboxApp = dirname(__DIR__) . '/apps/Demo.Sandbox';
22
+        $targetHello = dirname(__DIR__).'/vendor/bear/demo-apps/Demo.Helloworld';
23
+        $targetSandbox = dirname(__DIR__).'/vendor/bear/demo-apps/Demo.Sandbox';
24
+        $helloApp = dirname(__DIR__).'/apps/Demo.Helloworld';
25
+        $sandboxApp = dirname(__DIR__).'/apps/Demo.Sandbox';
26 26
 
27 27
         if (file_exists($helloApp)) {
28 28
             unlink($helloApp);
@@ -33,6 +33,6 @@  discard block
 block discarded – undo
33 33
         symlink($targetHello, $helloApp);
34 34
         symlink($targetSandbox, $sandboxApp);
35 35
 
36
-        include $packageDir . '/bin/bear.env';
36
+        include $packageDir.'/bin/bear.env';
37 37
     }
38 38
 }
Please login to merge, or discard this patch.