Passed
Push — master ( e0c5e8...7926db )
by P.R.
04:00
created

LogWrapper::writeResultHandler()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
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 'selecting' rows for logging.
10
 */
11
class LogWrapper extends Wrapper
12
{
13
  //--------------------------------------------------------------------------------------------------------------------
14
  /**
15
   * @inheritdoc
16
   */
17 1
  protected function getDocBlockReturnType(): string
18
  {
19 1
    return 'int';
20
  }
21
22
  //--------------------------------------------------------------------------------------------------------------------
23
  /**
24
   * @inheritdoc
25
   */
26 1
  protected function getReturnTypeDeclaration(): string
27
  {
28 1
    return ': int';
29
  }
30
31
  //--------------------------------------------------------------------------------------------------------------------
32
  /**
33
   * @inheritdoc
34
   */
35 1
  protected function writeResultHandler(): void
36
  {
37 1
    $this->throws(MySqlDataLayerException::class);
38
39 1
    $routine_args = $this->getRoutineArgs();
40 1
    $this->codeStore->append('return $this->executeLog(\'call '.$this->routine['routine_name'].'('.$routine_args.')\');');
41 1
  }
42
43
  //--------------------------------------------------------------------------------------------------------------------
44
  /**
45
   * @inheritdoc
46
   */
47
  protected function writeRoutineFunctionLobFetchData(): void
48
  {
49
    // Nothing to do.
50
  }
51
52
  //--------------------------------------------------------------------------------------------------------------------
53
  /**
54
   * @inheritdoc
55
   */
56
  protected function writeRoutineFunctionLobReturnData(): void
57
  {
58
    // Nothing to do.
59
  }
60
61
  //--------------------------------------------------------------------------------------------------------------------
62
}
63
64
//----------------------------------------------------------------------------------------------------------------------
65