| Conditions | 2 |
| Paths | 2 |
| Total Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function __construct( \PDO $pdo, $sheets_table, $coupons_table, $php_class = null) |
||
| 26 | { |
||
| 27 | $this->php_class = $php_class ?: CouponSheet::class; |
||
| 28 | |||
| 29 | $sql = "SELECT |
||
| 30 | Sheets.id, |
||
| 31 | Sheets.slug, |
||
| 32 | Sheets.name, |
||
| 33 | Sheets.quantity, |
||
| 34 | Sheets.valid_from, |
||
| 35 | Sheets.valid_until, |
||
| 36 | GROUP_CONCAT(Coupons.code) AS coupons |
||
| 37 | |||
| 38 | FROM `{$sheets_table}` Sheets |
||
| 39 | |||
| 40 | RIGHT JOIN `{$coupons_table}` Coupons |
||
| 41 | ON Coupons.coupon_sheet_id = Sheets.id |
||
| 42 | |||
| 43 | WHERE (valid_until IS NULL OR valid_until >= :datetime_string) |
||
| 44 | AND (valid_from <= :datetime_string) |
||
| 45 | |||
| 46 | GROUP BY Sheets.id"; |
||
| 47 | |||
| 48 | $this->stmt = $pdo->prepare( $sql ); |
||
|
|
|||
| 49 | } |
||
| 50 | |||
| 71 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..