Viber   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A processShareData() 0 3 1
A buildLink() 0 3 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\drivers;
10
11
use ymaker\social\share\base\AbstractDriver;
12
13
/**
14
 * Driver for Viber messenger.
15
 *
16
 * @see https://viber.com
17
 *
18
 * WARNING: This driver works only in mobile devices
19
 * with installed Viber client.
20
 *
21
 * @author Vladimir Kuprienko <[email protected]>
22
 *
23
 * @since 1.0
24
 */
25
class Viber extends AbstractDriver
26
{
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function processShareData()
31
    {
32
        $this->url = static::encodeData($this->url);
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    protected function buildLink()
39
    {
40
        return 'viber://forward?text={url}';
41
    }
42
}
43