Completed
Pull Request — 1.x (#6)
by Akihito
04:25
created
src/Baracoa.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -74,6 +74,9 @@
 block discarded – undo
74 74
         return (string) $this->execJs->evalJs($code);
75 75
     }
76 76
 
77
+    /**
78
+     * @param string $bundleSrc
79
+     */
77 80
     private function getSsrCode($bundleSrc, array $store, array $metas) : string
78 81
     {
79 82
         $storeJson = json_encode($store);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,10 +47,10 @@
 block discarded – undo
47 47
     /**
48 48
      * {@inheritdoc}
49 49
      */
50
-    public function render(string $appName, array $store, array $metas = []) : string
50
+    public function render(string $appName, array $store, array $metas = [ ]) : string
51 51
     {
52 52
         $bundleSrcPath = sprintf('%s/%s.bundle.js', $this->bundleSrcBasePath, $appName);
53
-        if (! file_exists($bundleSrcPath)) {
53
+        if (!file_exists($bundleSrcPath)) {
54 54
             throw new JsFileNotExistsException($bundleSrcPath);
55 55
         }
56 56
         $bundleSrc = file_get_contents($bundleSrcPath);
Please login to merge, or discard this patch.
src/CacheBaracoa.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
     /**
40 40
      * {@inheritdoc}
41 41
      */
42
-    public function render(string $appName, array $store, array $metas = []) : string
42
+    public function render(string $appName, array $store, array $metas = [ ]) : string
43 43
     {
44
-        if (! $this->cache->has($appName)) {
44
+        if (!$this->cache->has($appName)) {
45 45
             $this->saveSnapshot($appName);
46 46
         }
47 47
         $snapShot = $this->cache->get($appName);
48
-        $v8 = new V8Js('PHP', [], [], true, $snapShot);
48
+        $v8 = new V8Js('PHP', [ ], [ ], true, $snapShot);
49 49
         try {
50 50
             $html = $v8->executeString($this->getSsrCode($store, $metas));
51 51
         } catch (\V8JsScriptException $e) {
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     private function saveSnapshot(string $appName) : void
63 63
     {
64 64
         $bundleSrcPath = sprintf('%s/%s.bundle.js', $this->bundleSrcBasePath, $appName);
65
-        if (! file_exists($bundleSrcPath)) {
65
+        if (!file_exists($bundleSrcPath)) {
66 66
             throw new JsFileNotExistsException($bundleSrcPath);
67 67
         }
68 68
         $bundleSrc = file_get_contents($bundleSrcPath);
Please login to merge, or discard this patch.
src/BaracoaInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,5 +17,5 @@
 block discarded – undo
17 17
      *
18 18
      * @return string
19 19
      */
20
-    public function render(string $appName, array $store, array $metas = []) : string;
20
+    public function render(string $appName, array $store, array $metas = [ ]) : string;
21 21
 }
Please login to merge, or discard this patch.