Completed
Push — feature/add_generic_damage ( 9a931a...3c0061 )
by Laurent
43s
created
Infrastructure/Damage/Query/Repository/GetPilotDamagesQueryRepository.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,16 +35,16 @@
 block discarded – undo
35 35
     public function query($year)
36 36
     {
37 37
         $sql = 'SELECT damage.amount as amount, damage.billed as billed, damage.author_id as author, author.firstname as author_name';
38
-        $sql.=' FROM '.MAIN_DB_PREFIX.'bbc_flight_damages as damage';
39
-        $sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'bbc_vols as flight ON flight.rowid = damage.flight_id';
40
-        $sql.=' INNER JOIN '.MAIN_DB_PREFIX.'user as author ON author.rowid = damage.author_id';
41
-        $sql.=' WHERE YEAR(damage.created_at) = '.$this->db->escape($year);
38
+        $sql .= ' FROM ' . MAIN_DB_PREFIX . 'bbc_flight_damages as damage';
39
+        $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bbc_vols as flight ON flight.rowid = damage.flight_id';
40
+        $sql .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'user as author ON author.rowid = damage.author_id';
41
+        $sql .= ' WHERE YEAR(damage.created_at) = ' . $this->db->escape($year);
42 42
 
43 43
         $resql = $this->db->query($sql);
44 44
         if ($resql) {
45 45
             $num = $this->db->num_rows($resql);
46 46
             if ($num) {
47
-                for($i = 0; $i < $num ; $i++) {
47
+                for ($i = 0; $i < $num; $i++) {
48 48
                     $properties = $this->db->fetch_array($resql);
49 49
                     $damage = TotalDamage::fromArray($properties);
50 50
                     yield $damage;
Please login to merge, or discard this patch.