Passed
Push — master ( 18cedb...696cbf )
by Melech
04:01
created

LogSms   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 1
b 0
f 0
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A send() 0 9 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Valkyrja Framework package.
7
 *
8
 * (c) Melech Mizrachi <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Valkyrja\Sms;
15
16
use Valkyrja\Log\Contract\Logger;
17
use Valkyrja\Sms\Contract\Sms as Contract;
18
use Valkyrja\Sms\Data\Contract\Message;
19
20
/**
21
 * Class LogSms.
22
 *
23
 * @author Melech Mizrachi
24
 */
25
class LogSms implements Contract
26
{
27
    /**
28
     * LogSms constructor.
29
     */
30
    public function __construct(
31
        protected Logger $logger,
32
    ) {
33
    }
34
35
    /**
36
     * @inheritDoc
37
     */
38
    public function send(Message $message): void
39
    {
40
        $this->logger->info(static::class . ' Send');
41
        $this->logger->info('From:');
42
        $this->logger->info($message->getFrom());
43
        $this->logger->info('To:');
44
        $this->logger->info($message->getTo());
45
        $this->logger->info('Text:');
46
        $this->logger->info($message->getText());
47
    }
48
}
49