Completed
Push — development ( a546b2...2b11c6 )
by Ashutosh
09:55
created

TaxOption   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 14
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDescriptionForEvent() 0 15 4
1
<?php
2
3
namespace App\Model\Payment;
4
5
use App\BaseModel;
6
use Spatie\Activitylog\Traits\LogsActivity;
7
8
class TaxOption extends BaseModel
9
{
10
	use LogsActivity;
11
    protected $table = 'tax_rules';
12
    protected static $logName = 'Tax Class';
13
    protected static $logAttributes = ['tax_enable', 'inclusive', 'shop_inclusive', 'cart_inclusive', 'rounding', 'Gst_no'];
14
     protected static $logOnlyDirty = true;
15
    protected $fillable = ['tax_enable', 'inclusive', 'shop_inclusive', 'cart_inclusive', 'rounding', 'Gst_no'];
16
17
  
18
   public function getDescriptionForEvent(string $eventName): string
19
    {
20
        if ($eventName == 'created') {
21
            return 'Tax Rule  <strong> '.$this->name.' </strong> was created';
0 ignored issues
show
Bug introduced by
The property name does not seem to exist on App\Model\Payment\TaxOption. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
22
        }
23
24
        if ($eventName == 'updated') {
25
            return 'Tax Rule<strong> '.$this->name.'</strong> was updated';
26
        }
27
28
        if ($eventName == 'deleted') {
29
            return 'Tax Rule<strong> '.$this->name.' </strong> was deleted';
30
        }
31
32
        return '';
33
    }
34
}