@@ -30,17 +30,21 @@ discard block |
||
| 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 |
||
| 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 | } |