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

Notification   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 4
Bugs 0 Features 2
Metric Value
wmc 1
c 4
b 0
f 2
lcom 0
cbo 2
dl 0
loc 21
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A send() 0 13 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
}