BadDataTablesCSVExporterException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 10
c 0
b 0
f 0
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
/*
4
 * This file is part of the jquery-datatables-bundle package.
5
 *
6
 * (c) 2018 WEBEWEB
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 WBW\Bundle\JQuery\DataTablesBundle\Exception;
13
14
use WBW\Bundle\JQuery\DataTablesBundle\Provider\DataTablesCSVExporterInterface;
15
16
/**
17
 * Bad DataTables CSV exporter exception.
18
 *
19
 * @author webeweb <https://github.com/webeweb>
20
 * @package WBW\Bundle\JQuery\DataTablesBundle\Exception
21
 */
22
class BadDataTablesCSVExporterException extends AbstractDataTablesException {
23
24
    /**
25
     * Constructor.
26
     *
27
     * @param object|null $object The exporter.
28
     */
29
    public function __construct($object) {
30
31
        $message = "The DataTables CSV exporter is null";
32
33
        if (null !== $object) {
34
            $format  = 'The DataTables CSV exporter "%s" must implement ' . DataTablesCSVExporterInterface::class;
35
            $message = sprintf($format, get_class($object));
36
        }
37
38
        parent::__construct($message);
39
    }
40
}
41