ContainerNotEmpty::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 8
rs 9.4286
cc 1
eloc 5
nc 1
nop 3
1
<?php
2
/**
3
 * For the full copyright and license information, please view the LICENSE
4
 * file that was distributed with this source code.
5
 *
6
 * @author Nikita Vershinin <[email protected]>
7
 * @license MIT
8
 */
9
namespace OpenStackStorage\Exceptions;
10
11
/**
12
 * Raised when attempting to delete a container that still contains objects.
13
 */
14
class ContainerNotEmpty extends Error
15
{
16
17
    /**
18
     * The class constructor.
19
     *
20
     * @param string     $containerName
21
     * @param integer    $code
22
     * @param \Exception $previous
23
     */
24
    public function __construct($containerName, $code = 0, \Exception $previous = null)
25
    {
26
        parent::__construct(
27
            'Cannot delete non-empty container ' . $containerName,
28
            $code,
29
            $previous
30
        );
31
    }
32
}
33