CancellationException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Cubiche package.
5
 *
6
 * Copyright (c) Cubiche
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Cubiche\Core\Async\Promise;
13
14
/**
15
 * Cancellation Exception class.
16
 *
17
 * @author Karel Osorio Ramírez <[email protected]>
18
 */
19
class CancellationException extends RejectionException
20
{
21
    /**
22
     * @param string $message
23
     */
24
    public function __construct($message = null)
25
    {
26
        if ($message !== null) {
27
            $message = 'The promise has been cancelled';
28
        }
29
30
        parent::__construct($this, $message);
31
    }
32
}
33