Completed
Push — work-fleets ( 4aef09...b4179a )
by SuperNova.WS
05:37
created

DBStaticFleetBashing   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 24
rs 10
c 1
b 0
f 0
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A db_bashing_list_get() 0 5 1
A db_bashing_insert() 0 3 1
1
<?php
2
3
class DBStaticFleetBashing {
4
5
  /**
6
   * @param $user
7
   * @param $planet_dst
8
   * @param $time_limit
9
   *
10
   * @return array|bool|mysqli_result|null
11
   */
12
  public static function db_bashing_list_get($user, $planet_dst, $time_limit) {
13
    $query = doquery("SELECT bashing_time FROM {{bashing}} WHERE bashing_user_id = {$user['id']} AND bashing_planet_id = {$planet_dst['id']} AND bashing_time >= {$time_limit};");
14
15
    return $query;
16
  }
17
18
19
  /**
20
   * @param $bashing_list
21
   */
22
  public static function db_bashing_insert($bashing_list) {
23
    doquery("INSERT INTO {{bashing}} (bashing_user_id, bashing_planet_id, bashing_time) VALUES {$bashing_list};");
24
  }
25
26
}
27