Completed
Push — work-fleets ( d28adc...7496c9 )
by SuperNova.WS
06:01
created

ResultMessages::parseException()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
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 2
dl 0
loc 8
rs 9.4285
ccs 0
cts 7
cp 0
crap 6
1
<?php
2
3
/**
4
 * Created by Gorlum 30.07.2016 21:15
5
 */
6
class ResultMessages {
7
8
  /**
9
   * @param $e Exception
10
   * @param array $resultMessages
11
   *
12
   * @return int|mixed
13
   */
14
  public static function parseException($e, &$resultMessages) {
15
    $resultMessages[] = array(
16
      'STATUS'  => in_array($e->getCode(), array(ERR_NONE, ERR_WARNING, ERR_ERROR)) ? $e->getCode() : ERR_ERROR,
17
      'MESSAGE' => classSupernova::$gc->localePlayer[$e->getMessage()],
18
    );
19
20
    return $e->getCode();
21
  }
22
23
}