Conditions | 3 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function __construct($auth) |
||
25 | { |
||
26 | // if the auth value does not carry |
||
27 | // the authenticateProvider instance value, an exception is thrown. |
||
28 | if(!$auth instanceof AuthenticateProvider){ |
||
29 | exception()->runtime('AuthenticateProvider instance is not valid'); |
||
30 | } |
||
31 | |||
32 | //authenticate instance |
||
33 | $this->auth = $auth; |
||
34 | |||
35 | // for the builder, we get the namespace value from the auth object. |
||
36 | // this namespace will take us to the query builder application. |
||
37 | $driverBuilder = $this->auth->getDriverBuilderNamespace(); |
||
38 | |||
39 | // we get the instance value of |
||
40 | // the imported builder object. |
||
41 | $this->driverBuilderInstance = new $driverBuilder($auth); |
||
42 | |||
43 | if(!$this->driverBuilderInstance instanceof BuilderContract){ |
||
44 | exception()->runtime($driverBuilder.' is not instance of '.BuilderContract::class); |
||
45 | } |
||
67 | } |