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

Vkontakte   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A buildLink() 0 7 1
A processShareData() 0 6 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 Vkontakte.
14
 * @link https://vk.com
15
 *
16
 * @author Vladimir Kuprienko <[email protected]>
17
 * @since 1.0
18
 */
19
class Vkontakte extends DriverAbstract
20
{
21
    /**
22
     * @inheritdoc
23
     */
24
    protected function processShareData()
25
    {
26
        $this->url = static::encodeData($this->url);
27
        $this->title = static::encodeData($this->title);
28
        $this->description = static::encodeData($this->description);
29
        $this->imageUrl = static::encodeData($this->imageUrl);
30
    }
31
32
    /**
33
     * @inheritdoc
34
     */
35
    protected function buildLink()
36
    {
37
        return 'http://vk.com/share.php?'
38
            . 'url={url}'
39
            . '&title={title}'
40
            . '&description={description}'
41
            . '&image={imageUrl}';
42
    }
43
}
44