GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

SmsTrafficClient   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 46
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2

3 Methods

Rating   Name   Duplication   Size   Complexity  
A sendMessage() 0 9 1
A getWsdl() 0 4 1
A encode() 0 4 1
1
<?php
2
/**
3
 * @author Nikita Melnikov <[email protected]>
4
 * @link https://github.com/shogodev/argilla/
5
 * @copyright Copyright &copy; 2003-2014 Shogo
6
 * @license http://argilla.ru/LICENSE
7
 * @package frontend.components.soap
8
 */
9
class SmsTrafficClient extends AbstractSoapClient
10
{
11
  /**
12
   * @var int
13
   */
14
  protected static $rusOption = '1';
15
16
  /**
17
   * Название отправителя
18
   *
19
   * @var string
20
   */
21
  protected static $originator = 'Cuberussia';
22
23
  /**
24
   * @param string $phone
25
   * @param string $message
26
   */
27
  public function sendMessage($phone, $message)
28
  {
29
    $this->send(SmsSoapConfig::getInstance()->getLogin(),
0 ignored issues
show
Documentation Bug introduced by
The method send does not exist on object<SmsTrafficClient>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
30
                SmsSoapConfig::getInstance()->getPassword(),
31
                $phone,
32
                $message,
33
                self::$originator,
34
                self::$rusOption);
35
  }
36
37
  /**
38
   * @return string
39
   */
40
  public function getWsdl()
41
  {
42
    return SmsSoapConfig::getInstance()->getWsdl();
43
  }
44
45
  /**
46
   * @param $data
47
   *
48
   * @return string
49
   */
50
  protected function encode($data)
51
  {
52
    return iconv('UTF-8', 'CP1251', $data);
53
  }
54
}