AbstractMailDriver   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 7
c 1
b 0
f 0
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A processShareData() 0 8 1
1
<?php
2
3
/**
4
 * @link https://github.com/yiimaker/yii2-social-share
5
 * @copyright Copyright (c) 2017-2021 Volodymyr Kupriienko
6
 * @license BSD 3-Clause License
7
 */
8
9
namespace ymaker\social\share\base;
10
11
/**
12
 * Base class for drivers for mail services like Gmail and Yahoo.
13
 *
14
 * @author Vladimir Kuprienko <[email protected]>
15
 *
16
 * @since 2.0
17
 */
18
abstract class AbstractMailDriver extends AbstractDriver
19
{
20
    /**
21
     * @var string
22
     */
23
    public $bodyPattern = '{description} - {url}';
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    protected function processShareData()
29
    {
30
        $this->title = static::encodeData($this->title);
31
32
        $this->appendToData('body', \strtr($this->bodyPattern, [
33
            '{url}' => $this->url,
34
            '{description}' => $this->description,
35
            '{imageUrl}' => $this->imageUrl,
36
        ]));
37
    }
38
}
39