Completed
Push — master ( cada30...88830a )
by Nate
02:26
created

Postmark::info()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://github.com/flipbox/postmark/blob/master/LICENSE.md
6
 * @link       https://github.com/flipbox/postmark
7
 */
8
9
namespace flipbox\postmark;
10
11
use Craft;
12
use craft\base\Plugin;
13
use craft\events\RegisterComponentTypesEvent;
14
use craft\helpers\MailerHelper;
15
use yii\base\Event;
16
17
/**
18
 * @author Flipbox Factory <[email protected]>
19
 * @since 1.0.0
20
 */
21
class Postmark extends Plugin
22
{
23
24
    /**
25
     * @inheritdoc
26
     */
27
    public function init()
28
    {
29
30
        parent::init();
31
32
        Event::on(
33
            MailerHelper::class,
34
            MailerHelper::EVENT_REGISTER_MAILER_TRANSPORT_TYPES,
35
            function (RegisterComponentTypesEvent $event) {
36
                $event->types[] = Adapter::class;
37
            }
38
        );
39
40
    }
41
42
    /**
43
     * Logs an informative message.
44
     *
45
     * @param $message
46
     * @param string $category
47
     */
48
    public static function info($message, $category = 'postmark')
49
    {
50
        Craft::info($message, $category);
51
    }
52
53
    /**
54
     * Logs a warning message.
55
     *
56
     * @param $message
57
     * @param string $category
58
     */
59
    public static function warning($message, $category = 'postmark')
60
    {
61
        Craft::warning($message, $category);
62
    }
63
64
    /**
65
     * Logs an error message.
66
     *
67
     * @param $message
68
     * @param string $category
69
     */
70
    public static function error($message, $category = 'postmark')
71
    {
72
        Craft::error($message, $category);
73
    }
74
75
}
76