Skip to content

Commit 49cf201

Browse files
committed
fix: $driver type update ?string $driver
1 parent 79a7b98 commit 49cf201

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Adapter/DatabaseAdapter.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ class DatabaseAdapter implements Adapter, UpdatableAdapter, BatchAdapter, Filter
3333
/**
3434
* @var bool
3535
*/
36-
private $filtered = false;
36+
private bool $filtered = false;
3737

3838
/**
3939
* RuleModel model.
4040
*
4141
* @var RuleModel
4242
*/
43-
protected $model;
43+
protected RuleModel $model;
4444

4545
/**
4646
* the DatabaseAdapter constructor.

src/Model/RuleModel.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class RuleModel extends Model implements Arrayable
3434
'v5' => 'string'
3535
];
3636

37-
/** @var string $driver */
38-
protected string $driver;
37+
/** @var string|null $driver */
38+
protected ?string $driver;
3939

4040
/**
4141
* 架构函数
@@ -61,7 +61,7 @@ public function __construct(array $data = [], ?string $driver = null)
6161
*/
6262
protected function config(string $key = null, $default = null)
6363
{
64-
$driver = $this->driver ?? config('plugin.casbin.webman-permission.permission.default');
64+
$driver = $this->driver ?: config('plugin.casbin.webman-permission.permission.default');
6565
return config('plugin.casbin.webman-permission.permission.' . $driver . '.' . $key, $default);
6666
}
6767
}

0 commit comments

Comments
 (0)