Skip to content

Commit d9bef34

Browse files
committed
Fix: Setting adapter does not take effect
1 parent 28dc2d2 commit d9bef34

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Casbin.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ public function __construct(?Config $config = null)
116116

117117
$this->config = $config;
118118

119-
if (!$config->getAdapter() instanceof Adapter) {
120-
$this->adapter = new DatabaseAdapter();
121-
}
119+
$this->adapter = $config->getAdapter() ?? new DatabaseAdapter();
122120

123121
if ($logger = $this->config->getLoggerClass() ?? 'EasySwoole\Permission\Logger') {
124122
if (class_exists($logger)) {

0 commit comments

Comments
 (0)