aboutsummaryrefslogtreecommitdiff
path: root/app/class/Modeldb.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2020-04-17 19:01:05 +0200
committervincent-peugnet <v.peugnet@free.fr>2020-04-17 19:01:05 +0200
commit802f5135b0979bab3bf30ae1733f9867e2caed7a (patch)
tree3575cb7dd353e7f1ce74b079aa1559b5d69054bf /app/class/Modeldb.php
parent74e2b3fdd66bfbe99bae771fa3a0b6c427fc0f86 (diff)
downloadwcms-802f5135b0979bab3bf30ae1733f9867e2caed7a.tar.gz
wcms-802f5135b0979bab3bf30ae1733f9867e2caed7a.zip
apply psr12
Diffstat (limited to 'app/class/Modeldb.php')
-rw-r--r--app/class/Modeldb.php71
1 files changed, 33 insertions, 38 deletions
diff --git a/app/class/Modeldb.php b/app/class/Modeldb.php
index 953521f..784b45f 100644
--- a/app/class/Modeldb.php
+++ b/app/class/Modeldb.php
@@ -9,42 +9,37 @@ use Wcms\Flywheel\Repository;
class Modeldb extends Model
{
- protected $database;
- /** @var Repository */
- protected $repo;
-
-
- public function __construct()
- {
- $this->dbinit();
- }
-
-
- public function dbinit($dir = Model::DATABASE_DIR)
- {
- $this->database = new Flywheel\Config($dir , [
- 'query_class' => Query::class,
- 'formatter' => new JSON,
- ]);
- }
-
- public function storeinit(string $repo)
- {
- $this->repo = new Repository($repo, $this->database);
- }
-
- /**
- * List every IDs of a database
- *
- * @return array of ID strings
- */
- public function list() : array
- {
- return $this->repo->getAllIds();
- }
-
-
-
-
-
+ protected $database;
+ /** @var Repository */
+ protected $repo;
+
+
+ public function __construct()
+ {
+ $this->dbinit();
+ }
+
+
+ public function dbinit($dir = Model::DATABASE_DIR)
+ {
+ $this->database = new Flywheel\Config($dir, [
+ 'query_class' => Query::class,
+ 'formatter' => new JSON(),
+ ]);
+ }
+
+ public function storeinit(string $repo)
+ {
+ $this->repo = new Repository($repo, $this->database);
+ }
+
+ /**
+ * List every IDs of a database
+ *
+ * @return array of ID strings
+ */
+ public function list(): array
+ {
+ return $this->repo->getAllIds();
+ }
}