We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f469ed6 commit a3ad13dCopy full SHA for a3ad13d
1 file changed
src/DataBase.php
@@ -10,7 +10,7 @@ class DataBase
10
{
11
12
/**
13
- *
+ * dataBase file
14
*
15
* @var resource
16
*/
@@ -27,6 +27,8 @@ class DataBase
27
* Create instance of JsonDataBase
28
29
* @param $pathToFile
30
+ * @throws \RuntimeException
31
+ * @throws \InvalidArgumentException
32
33
public function __construct($pathToFile)
34
@@ -67,7 +69,7 @@ public function save()
67
69
foreach ($this->tables as $tabName => $table) {
68
70
$result[$tabName] = $table->toArray();
71
}
-
72
+
73
ftruncate($this->dbFile, 0);
74
rewind($this->dbFile);
75
fwrite($this->dbFile, json_encode($result, JSON_PRETTY_PRINT));
0 commit comments