Passed
Pull Request — master (#10)
by Petro
02:29
created

Odnoklassniki::processShareData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
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\AbstractDriver;
11
12
/**
13
 * Driver for Ok.ru
14
 *
15
 * @link https://ok.ru
16
 *
17
 * @author Petro Sokolnykov <[email protected]>
18
 * @since 2.0
19
 */
20
class Odnoklassniki extends AbstractDriver
21
{
22
    /**
23
     * @inheritdoc
24
     */
25
    protected function processShareData()
26
    {
27
        $this->url = static::encodeData($this->url);
28
        $this->title = static::encodeData($this->title);
29
        $this->description = static::encodeData($this->description);
30
        $this->imageUrl = static::encodeData($this->imageUrl);
31
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36
    protected function buildLink()
37
    {
38
        return 'https://connect.ok.ru/offer'
39
            . '?url={url}'
40
            . '&title={title}'
41
            . '&description={description}'
42
            . '&imageUrl={imageUrl}';
43
    }
44
}
45