WhatsApp::buildLink()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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 WhatsApp messenger.
15
 *
16
 * @see https://www.whatsapp.com
17
 *
18
 * WARNING: This driver works only in mobile devices
19
 * with installed WhatsApp client.
20
 *
21
 * @author Vladimir Kuprienko <[email protected]>
22
 *
23
 * @since 1.0
24
 */
25
class WhatsApp 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 'whatsapp://send?text={url}';
41
    }
42
}
43