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 — 3.x ( 52ff30...48a2e9 )
by Jindřich
12s queued 11s
created

WebServiceAlias   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 26
ccs 4
cts 5
cp 0.8
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolveAlias() 0 9 2
1
<?php
2
3
declare(strict_types=1);
4
5
6
namespace Skaut\Skautis\Wsdl;
7
8
9
class WebServiceAlias
10
{
11
  /**
12
   * Aliasy webových služeb pro rychlý přístup
13
   *
14
   * @var string[]
15
   */
16
  private const ALIASES = [
17
    'user' => 'UserManagement',
18
    'usr' => 'UserManagement',
19
    'org' => 'OrganizationUnit',
20
    'app' => 'ApplicationManagement',
21
    'event' => 'Events',
22
    'events' => 'Events',
23
  ];
24
25 1
  public static function resolveAlias(string $alias): string {
26 1
    $alias = strtolower($alias);
27
28 1
    if (!array_key_exists($alias, self::ALIASES)) {
29
      throw new WebServiceAliasNotFoundException($alias);
30
    }
31
32 1
    return self::ALIASES[$alias];
33
  }
34
}