Completed
Push — work-fleets ( b0e897...355465 )
by SuperNova.WS
13:11 queued 07:54
created

DbSqlHelper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 37.5%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 25
ccs 3
cts 8
cp 0.375
rs 10
wmc 3
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A UCFirstByRef() 0 3 1
A quoteComment() 0 9 2
1
<?php
2
3
class DbSqlHelper {
4
5 3
  public static function UCFirstByRef(&$value) {
6 3
    $value = ucfirst($value);
7 3
  }
8
9
  /**
10
   * Quotes comment with SQL comment statement
11
   * Make checks for comment limiters in comment
12
   *
13
   * @param $comment
14
   *
15
   * @return string
16
   */
17
  public static function quoteComment($comment) {
18
    if($comment == '') {
19
      return '';
20
    }
21
22
    $comment = str_replace(array('/*', '*/'), '__',$comment);
23
24
    return "\r\n/*" . $comment . "*/";
25
  }
26
27
}
28