| Total Complexity | 5 | 
| Total Lines | 37 | 
| Duplicated Lines | 0 % | 
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1);  | 
            ||
| 8 | trait HavingTrait  | 
            ||
| 9 | { | 
            ||
| 10 | /**  | 
            ||
| 11 | * @var array  | 
            ||
| 12 | */  | 
            ||
| 13 | protected $having = [];  | 
            ||
| 14 | |||
| 15 | /**  | 
            ||
| 16 | * @param string $condition  | 
            ||
| 17 | * @param array $bind  | 
            ||
| 18 | *  | 
            ||
| 19 | * @return $this  | 
            ||
| 20 | * @throws QueryBuilderException  | 
            ||
| 21 | */  | 
            ||
| 22 | public function having(string $condition, array $bind = [])  | 
            ||
| 23 |     { | 
            ||
| 24 |         if (!$condition) { | 
            ||
| 25 |             throw new QueryBuilderException('You must pass $condition to having function!'); | 
            ||
| 26 | }  | 
            ||
| 27 | |||
| 28 | $this->having[] = $condition;  | 
            ||
| 29 | |||
| 30 |         if (!empty($bind)) { | 
            ||
| 31 | $this->bind($bind);  | 
            ||
| 
                                                                                                    
                        
                         | 
                |||
| 32 | }  | 
            ||
| 33 | |||
| 34 | return $this;  | 
            ||
| 35 | }  | 
            ||
| 36 | |||
| 37 | /**  | 
            ||
| 38 | * @return null|string  | 
            ||
| 39 | */  | 
            ||
| 40 | protected function buildHavingQueryPart(): ?string  | 
            ||
| 45 | ;  | 
            ||
| 46 | }  | 
            ||
| 48 |