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

DbSqlHelper::quoteComment()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 9
ccs 0
cts 5
cp 0
crap 6
rs 9.6666
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