Test Failed
Push — trunk ( cc0c70...769658 )
by SuperNova.WS
10:35
created

Storage   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 23
ccs 0
cts 9
cp 0
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 1 1
A loadById() 0 7 1
1
<?php
2
3
/**
4
 * Created by Gorlum 10.02.2017 0:28
5
 */
6
7
use Core\GlobalContainer;
8
9
/**
10
 * Class Storage
11
 * @deprecated
12
 */
13
class Storage {
14
15
  /**
16
   * Storage constructor.
17
   *
18
   * @param GlobalContainer $gc
19
   */
20
  public function __construct(GlobalContainer $gc) {
0 ignored issues
show
Unused Code introduced by
The parameter $gc is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

20
  public function __construct(/** @scrutinizer ignore-unused */ GlobalContainer $gc) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
21
  }
22
23
  /**
24
   * @param TextRecordDescription $recordDescription
25
   * @param string|int            $id
26
   *
27
   * @return array|null
28
   */
29
  public function loadById($recordDescription, $id) {
30
    $dbq = new \DBAL\DbQuery($recordDescription->db);
31
    $dbq
32
      ->setTable($recordDescription->table)
33
      ->setOneRow()
34
      ->setWhereArray(array($recordDescription->indexFieldName => $id));
35
    return $recordDescription->db->dbqSelectAndFetch($dbq);
36
  }
37
38
}
39