Test Failed
Push — master ( e30de6...7363a8 )
by Andrés
08:20 queued 11s
created

ErrorException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 13
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTrimmedMessage() 0 10 2
1
<?php
2
/*
3
 * This file is part of the Magallanes package.
4
 *
5
 * (c) Andrés Montañez <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Mage\Task\Exception;
12
13
use Exception;
14
15
/**
16
 * The Task Failed, and it has a Custom Message
17
 *
18
 * @author Andrés Montañez <[email protected]>
19
 */
20
class ErrorException extends Exception
21
{
22
    public function getTrimmedMessage($maxLength = 60)
23
    {
24
        $message = $this->getMessage();
25
26
        if (strlen($message) > $maxLength) {
27
            $message = substr($message, 0, $maxLength) . '...';
28
        }
29
30
        return $message;
31
    }
32
}
33