Passed
Pull Request — master (#1151)
by Aleksei
12:32
created
src/Boot/src/Memory.php 2 patches
Spacing   +8 added lines, -8 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,29 +30,29 @@  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 37
         $fp = false;
38 38
         $lock = false;
39 39
 
40
-        try {
40
+        try{
41 41
             $fp = \fopen($filename, 'r');
42
-            if ($fp === false) {
42
+            if ($fp === false){
43 43
                 return null;
44 44
             }
45 45
 
46 46
             $lock = \flock($fp, \LOCK_SH | \LOCK_NB);
47 47
 
48
-            if ($lock === false) {
48
+            if ($lock === false){
49 49
                 return null;
50 50
             }
51 51
 
52 52
             return include($filename);
53
-        } catch (\Throwable) {
53
+        }catch (\Throwable){
54 54
             return null;
55
-        } finally {
55
+        }finally{
56 56
             $lock === false or \flock($fp, \LOCK_UN);
57 57
             $fp === false or \fclose($fp);
58 58
         }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     {
63 63
         $this->files->write(
64 64
             $this->getFilename($section),
65
-            '<?php return ' . \var_export($data, true) . ';',
65
+            '<?php return '.\var_export($data, true).';',
66 66
             FilesInterface::RUNTIME,
67 67
             true
68 68
         );
Please login to merge, or discard this patch.
Braces   +14 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,29 +30,37 @@
 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 38
         $fp = false;
38 39
         $lock = false;
39 40
 
40
-        try {
41
+        try
42
+        {
41 43
             $fp = \fopen($filename, 'r');
42
-            if ($fp === false) {
44
+            if ($fp === false)
45
+            {
43 46
                 return null;
44 47
             }
45 48
 
46 49
             $lock = \flock($fp, \LOCK_SH | \LOCK_NB);
47 50
 
48
-            if ($lock === false) {
51
+            if ($lock === false)
52
+            {
49 53
                 return null;
50 54
             }
51 55
 
52 56
             return include($filename);
53
-        } catch (\Throwable) {
57
+        }
58
+        catch (\Throwable)
59
+        {
54 60
             return null;
55
-        } finally {
61
+        }
62
+        finally
63
+        {
56 64
             $lock === false or \flock($fp, \LOCK_UN);
57 65
             $fp === false or \fclose($fp);
58 66
         }
Please login to merge, or discard this patch.