Completed
Push — master ( 072fa4...a16d14 )
by Alexander
05:24
created

ModelAdjustedException   A

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 $message
0 ignored issues
show
Documentation introduced by
Should the type for parameter $message not be null|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
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
}