ModelAdjustedException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 2
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Mangopixel\Adjuster\Exceptions;
4
5
use Exception;
6
7
/**
8
 * An exception which is thrown when trying to call save on a model that has applied
9
 * adjustments through the applyAdjustments method on the CanBeAdjusted trait.
10
 *
11
 * @package Laravel Adjuster
12
 * @author  Alexander Tømmerås <[email protected]>
13
 * @license The MIT License
14
 */
15
class ModelAdjustedException extends Exception
16
{
17
    /**
18
     * Constructor.
19
     *
20
     * @param string|null $message
21
     */
22
    public function __construct( string $message = null )
23
    {
24
        parent::__construct( $message ?: 'You cannot persist a model with applied adjustments and save protection enabled' );
25
    }
26
}