Passed
Push — master ( abe9d4...f9c79d )
by Vladimir
04:18
created

Viber   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A processShareData() 0 3 1
A buildLink() 0 3 1
1
<?php
2
/**
3
 * @link https://github.com/yiimaker/yii2-social-share
4
 * @copyright Copyright (c) 2017 Yii Maker
5
 * @license BSD 3-Clause License
6
 */
7
8
namespace ymaker\social\share\drivers;
9
10
use ymaker\social\share\base\DriverAbstract;
11
12
/**
13
 * DriverAbstract for Viber messenger.
14
 * @link https://viber.com
15
 *
16
 * WARNING: This driver works only in mobile devices
17
 * with installed Viber client.
18
 *
19
 * @author Vladimir Kuprienko <[email protected]>
20
 * @since 1.0
21
 */
22
class Viber extends DriverAbstract
23
{
24
    /**
25
     * @inheritdoc
26
     */
27
    protected function processShareData()
28
    {
29
        $this->url = static::encodeData($this->url);
30
    }
31
32
    /**
33
     * @inheritdoc
34
     */
35
    protected function buildLink()
36
    {
37
        return 'viber://forward?text={url}';
38
    }
39
}
40