Skip to content

Commit 024f410

Browse files
committed
Move mkdir to save()
1 parent 05be7dd commit 024f410

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/DebugBar/Storage/FileStorage.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ class FileStorage implements StorageInterface
2323
public function __construct($dirname)
2424
{
2525
$this->dirname = rtrim($dirname, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
26-
if (!file_exists($this->dirname)) {
27-
mkdir($this->dirname, 0777, true);
28-
}
2926
}
3027

3128
/**
3229
* {@inheritDoc}
3330
*/
3431
public function save($id, $data)
3532
{
33+
if (!file_exists($this->dirname)) {
34+
mkdir($this->dirname, 0777, true);
35+
}
3636
file_put_contents($this->makeFilename($id), json_encode($data));
3737
}
3838

0 commit comments

Comments
 (0)