Completed
Push — 4-cactus ( 339538...3ebc54 )
by Alberto
39s queued 26s
created

InvalidDataException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 13
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
/**
3
 * BEdita, API-first content management framework
4
 * Copyright 2022 ChannelWeb Srl, Chialab Srl
5
 *
6
 * This file is part of BEdita: you can redistribute it and/or modify
7
 * it under the terms of the GNU Lesser General Public License as published
8
 * by the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * See LICENSE.LGPL or <http://gnu.org/licenses/lgpl-3.0.html> for more details.
12
 */
13
14
namespace BEdita\Core\Exception;
15
16
use Cake\Core\Exception\Exception;
17
18
/**
19
 * Exception raised when invalid data are passed to Model/ORM classes
20
 */
21
class InvalidDataException extends Exception
22
{
23
    /**
24
     * {@inheritDoc}
25
     *
26
     * Use 400 as HTTP status code and add options details array to internal attributes.
27
     *
28
     * @codeCoverageIgnore
29
     */
30
    public function __construct(string $message, ?array $details = null)
31
    {
32
        parent::__construct($message, 400);
33
        $this->_attributes['detail'] = $details;
34
    }
35
}
36