Completed
Pull Request — develop (#54)
by Steven
19:22 queued 16:17
created

Notification::send()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 2
Metric Value
c 3
b 0
f 2
dl 0
loc 13
rs 9.4285
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
}