Passed
Push — master ( 151185...42f330 )
by P.R.
04:09
created

TableWrapper   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 47
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getDocBlockReturnType() 0 3 1
A writeResultHandler() 0 6 1
A getReturnTypeDeclaration() 0 3 1
A writeRoutineFunctionLobReturnData() 0 2 1
A writeRoutineFunctionLobFetchData() 0 2 1
1
<?php
2
declare(strict_types=1);
3
4
namespace SetBased\Stratum\MySql\Wrapper;
5
6
use SetBased\Stratum\MySql\Exception\MySqlDataLayerException;
7
8
/**
9
 * Class for generating a wrapper method for a stored procedure of which the selected rows must be echoed in a table
10
 * layout.
11
 */
12
class TableWrapper extends Wrapper
13
{
14
  //--------------------------------------------------------------------------------------------------------------------
15
  /**
16
   * @inheritdoc
17
   */
18 1
  protected function getDocBlockReturnType(): string
19
  {
20 1
    return 'int';
21
  }
22
23
  //--------------------------------------------------------------------------------------------------------------------
24
  /**
25
   * @inheritdoc
26
   */
27 1
  protected function getReturnTypeDeclaration(): string
28
  {
29 1
    return ': int';
30
  }
31
32
  //--------------------------------------------------------------------------------------------------------------------
33
  /**
34
   * @inheritdoc
35
   */
36 1
  protected function writeResultHandler(): void
37
  {
38 1
    $this->throws(MySqlDataLayerException::class);
39
40 1
    $routineArgs = $this->getRoutineArgs();
41 1
    $this->codeStore->append('return $this->executeTable(\'call '.$this->routine['routine_name'].'('.$routineArgs.')\');');
42
  }
43
44
  //--------------------------------------------------------------------------------------------------------------------
45
  /**
46
   * @inheritdoc
47
   */
48
  protected function writeRoutineFunctionLobFetchData(): void
49
  {
50
    // Nothing to do.
51
  }
52
53
  //--------------------------------------------------------------------------------------------------------------------
54
  /**
55
   * @inheritdoc
56
   */
57
  protected function writeRoutineFunctionLobReturnData(): void
58
  {
59
    // Nothing to do.
60
  }
61
62
  //--------------------------------------------------------------------------------------------------------------------
63
}
64
65
//----------------------------------------------------------------------------------------------------------------------
66