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

ErrorException::getTrimmedMessage()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 8
cp 0
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
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