| Total Complexity | 3 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 7 | class RoleBuilder extends QueryBuilder |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Scope Role query to roles of a particular type. |
||
| 11 | * |
||
| 12 | * @param string $type |
||
| 13 | * @param string $operator |
||
| 14 | * @param string $boolean |
||
| 15 | * |
||
| 16 | * @return $this |
||
| 17 | */ |
||
| 18 | public function whereType(string $type, string $operator = '=', string $boolean = 'and') |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Scope Role query to only 'user' type roles. |
||
| 27 | * |
||
| 28 | * @param string $operator |
||
| 29 | * @param string $boolean |
||
| 30 | * |
||
| 31 | * @return $this |
||
| 32 | */ |
||
| 33 | public function whereTypeUser(string $operator = '=', string $boolean = 'and') |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Scope query results to Role's matching a role 'name'. |
||
| 42 | * |
||
| 43 | * @param string $name |
||
| 44 | * @param string $operator |
||
| 45 | * @param string $boolean |
||
| 46 | * @return $this |
||
| 47 | */ |
||
| 48 | public function whereName(string $name, string $operator = '=', string $boolean = 'and'): self |
||
| 54 |