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.
Completed
Push — master ( 2ec89f...0b541d )
by Alexey
13:03
created

BFrontendMenuGridView::encodeMenuItem()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
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 backend.modules.menu.components.grid
8
 */
9
class BFrontendMenuGridView extends BGridView
10
{
11
  protected static $gridIdPrefix = 'BFrontendMenu_';
12
13
  /**
14
   * @param BFrontendMenu $model
15
   *
16
   * @return string
17
   */
18
  public static function buildGridId(BFrontendMenu $model)
19
  {
20
    return self::$gridIdPrefix.$model->getId();
21
  }
22
23
  /**
24
   * @param string $gridId
25
   *
26
   * @return mixed
27
   */
28
  public static function getIdFromGridViewId($gridId)
29
  {
30
    return str_replace(self::$gridIdPrefix, '', $gridId);
31
  }
32
33
  public static function encodeMenuItem(BFrontendMenuGridAdapter $adapter)
34
  {
35
    return implode('#', [$adapter->getPrimaryKey(), $adapter->getType()]);
36
  }
37
38
  /**
39
   * Возвращает [0 => itemId, 1 => type]
40
   * @param $string
41
   *
42
   * @return array
43
   */
44
  public static function decodeMenuItem($string)
45
  {
46
    return explode('#', $string);
47
  }
48
}