Notification::send()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 1
1
<?php namespace Magestead\Service;
2
3
use Joli\JoliNotif\Notification as Notify;
4
use Joli\JoliNotif\NotifierFactory;
5
6
/**
7
 * Class Notification
8
 * @package Magestead\Service
9
 */
10
class Notification
11
{
12
    /**
13
     * Send desktop notification
14
     *
15
     * @param $message
16
     */
17
    public static function send($message)
18
    {
19
        $notifier     = NotifierFactory::create();
20
        $basePath     = dirname( __FILE__ ) . '/../../../';
21
        $notification =
22
            (new Notify())
23
                ->setTitle('Magestead')
24
                ->setBody($message)
25
                ->setIcon($basePath .'assets/magentologo.png')
26
        ;
27
28
        $notifier->send($notification);
29
    }
30
}