ice / framework

Source code of Ice framework
https://www.iceframework.org
BSD 3-Clause "New" or "Revised" License
341 stars 45 forks source link

Auth file, fetch users from the options #285

Closed mruz closed 4 years ago

mruz commented 4 years ago

It could simplify the definition from:

$di->set('auth', function () use ($options, $users) {
    $auth = new Ice\Auth\Driver\File($options);
    $auth->setUsers($users);

    return $auth;
});

to:

$di->auth = [
    Ice\Auth\Driver\File::class => $options
];