Skip to content

Commit a3ad13d

Browse files
committed
db refactoring
1 parent f469ed6 commit a3ad13d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/DataBase.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class DataBase
1010
{
1111

1212
/**
13-
*
13+
* dataBase file
1414
*
1515
* @var resource
1616
*/
@@ -27,6 +27,8 @@ class DataBase
2727
* Create instance of JsonDataBase
2828
*
2929
* @param $pathToFile
30+
* @throws \RuntimeException
31+
* @throws \InvalidArgumentException
3032
*/
3133
public function __construct($pathToFile)
3234
{
@@ -67,7 +69,7 @@ public function save()
6769
foreach ($this->tables as $tabName => $table) {
6870
$result[$tabName] = $table->toArray();
6971
}
70-
72+
7173
ftruncate($this->dbFile, 0);
7274
rewind($this->dbFile);
7375
fwrite($this->dbFile, json_encode($result, JSON_PRETTY_PRINT));

0 commit comments

Comments
 (0)