Passed
Push — master ( c9ca19...a23bb5 )
by Greg
01:52
created

Notify   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 20 4
1
<?php
2
namespace GJClasses;
3
4
class Notify
5
{
6
    public function __construct($method, $name, $address, $reply_name, $reply_address, $recipients, $subject, $html,
7
                                $text, $push_provider, $api_key, $user_key, $content, $url)
8
    {
9
        if ($method == 'all') {
10
11
            $mail = new Mail();
12
            $mail->send($name, $address, $reply_name, $reply_address, $recipients, $subject, $html, $text);
13
14
            $push = new Push($push_provider);
15
            $push->push($api_key, $user_key, $subject, $content, $url);
16
17
        } elseif ($method == 'email') {
18
19
            $mail = new Mail();
20
            $mail->send($name, $address, $reply_name, $reply_address, $recipients, $subject, $html, $text);
21
22
        } elseif ($method == 'push') {
23
24
            $push = new Push($push_provider);
25
            $push->push($api_key, $user_key, $subject, $content, $url);
26
27
        }
28
    }
29
}
30