ModelAdjustedException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 2
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
}