Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
40 | public function insert($entity) { |
||
41 | $db = $entity->getDbStatic(); |
||
42 | |||
43 | $row = $entity->exportRowWithoutId(); |
||
44 | if (empty($row)) { |
||
45 | // TODO Exceptiion |
||
46 | return 0; |
||
47 | } |
||
48 | $db->doInsertSet($entity->getTableName(), $row); |
||
49 | |||
50 | // TODO Exceptiion if db_insert_id() is empty |
||
51 | return $entity->dbId = $db->db_insert_id(); |
||
52 | } |
||
53 | |||
55 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.