Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
50.00% covered (danger)
50.00%
1 / 2
CRAP
25.00% covered (danger)
25.00%
2 / 8
User
0.00% covered (danger)
0.00%
0 / 1
50.00% covered (danger)
50.00%
1 / 2
10.75
25.00% covered (danger)
25.00%
2 / 8
 __construct
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 show
0.00% covered (danger)
0.00%
0 / 1
12
0.00% covered (danger)
0.00%
0 / 6
<?php
declare(strict_types=1);
namespace Eywa\Database\User {
    use Eywa\Collection\Collect;
    use Eywa\Database\Connexion\Connect;
    use Eywa\Exception\Kedavra;
    class User
    {
        /**
         *
         * The connection to the base
         *
         */
        private Connect $connexion;
        public function __construct(Connect $connexion)
        {
            $this->connexion = $connexion;
        }
        /**
         *
         * Show users
         *
         * @return Collect
         *
         * @throws Kedavra
         *
         */
        public function show(): Collect
        {
            switch ($this->connexion->driver()) {
                case MYSQL:
                    return collect($this->connexion->set('SELECT User from mysql.user')->get(COLUMNS));
                case POSTGRESQL:
                    return collect($this->connexion->set('SELECT rolname FROM pg_roles;')->get(COLUMNS));
                default:
                    return collect();
            }
        }
    }
}