Passed
Pull Request — master (#1151)
by
unknown
10:36
created
src/Boot/src/Memory.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     public function __construct(
20 20
         string $directory,
21 21
         private readonly FilesInterface $files
22
-    ) {
22
+    ){
23 23
         $this->directory = \rtrim($directory, '/');
24 24
     }
25 25
 
@@ -30,17 +30,17 @@  discard block
 block discarded – undo
30 30
     {
31 31
         $filename = $this->getFilename($section);
32 32
 
33
-        if (!\file_exists($filename)) {
33
+        if (!\file_exists($filename)){
34 34
             return null;
35 35
         }
36 36
 
37
-        try {
37
+        try{
38 38
             $fp = \fopen($filename, 'r');
39
-            if ($fp === false) {
39
+            if ($fp === false){
40 40
                 return null;
41 41
             }
42 42
 
43
-            if (!\flock($fp, \LOCK_SH | \LOCK_NB)) {
43
+            if (!\flock($fp, \LOCK_SH | \LOCK_NB)){
44 44
                 \fclose($fp);
45 45
                 return null;
46 46
             }
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
             $data = include($filename);
49 49
 
50 50
             \flock($fp, \LOCK_UN);
51
-        } catch (\Throwable) {
51
+        }catch (\Throwable){
52 52
             return null;
53
-        } finally {
54
-            if (isset($fp)) {
53
+        }finally{
54
+            if (isset($fp)){
55 55
                 \fclose($fp);
56 56
             }
57 57
         }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     {
64 64
         $this->files->write(
65 65
             $this->getFilename($section),
66
-            '<?php return ' . \var_export($data, true) . ';',
66
+            '<?php return '.\var_export($data, true).';',
67 67
             FilesInterface::RUNTIME,
68 68
             true
69 69
         );
Please login to merge, or discard this patch.
Braces   +16 added lines, -7 removed lines patch added patch discarded remove patch
@@ -30,17 +30,21 @@  discard block
 block discarded – undo
30 30
     {
31 31
         $filename = $this->getFilename($section);
32 32
 
33
-        if (!\file_exists($filename)) {
33
+        if (!\file_exists($filename))
34
+        {
34 35
             return null;
35 36
         }
36 37
 
37
-        try {
38
+        try
39
+        {
38 40
             $fp = \fopen($filename, 'r');
39
-            if ($fp === false) {
41
+            if ($fp === false)
42
+            {
40 43
                 return null;
41 44
             }
42 45
 
43
-            if (!\flock($fp, \LOCK_SH | \LOCK_NB)) {
46
+            if (!\flock($fp, \LOCK_SH | \LOCK_NB))
47
+            {
44 48
                 \fclose($fp);
45 49
                 return null;
46 50
             }
@@ -48,10 +52,15 @@  discard block
 block discarded – undo
48 52
             $data = include($filename);
49 53
 
50 54
             \flock($fp, \LOCK_UN);
51
-        } catch (\Throwable) {
55
+        }
56
+        catch (\Throwable)
57
+        {
52 58
             return null;
53
-        } finally {
54
-            if (isset($fp)) {
59
+        }
60
+        finally
61
+        {
62
+            if (isset($fp))
63
+            {
55 64
                 \fclose($fp);
56 65
             }
57 66
         }
Please login to merge, or discard this patch.