Notifies::notifySuccess()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 1
b 0
f 0
1
<?php 
2
3
namespace Epesi\Core\System\Modules\Concerns;
4
5
trait Notifies
6
{
7
    public function notify($options)
8
    {
9
        $options = array_merge(['duration'=> 1500], is_array($options)? $options: ['message' => $options]);
10
11
        return new \atk4\ui\JsToast($options);
12
    }
13
    
14
    public function notifySuccess($options)
15
    {
16
        $options = array_merge(['class' => 'success'], is_array($options)? $options: ['message' => $options]);
17
        
18
        return $this->notify($options);
19
    }
20
    
21
    public function notifyError($options)
22
    {
23
        $options = array_merge(['class' => 'error'], is_array($options)? $options: ['message' => $options]);
24
        
25
        return $this->notify($options);
26
    }
27
}