Passed
Push — master ( 92fa0d...527073 )
by Jakub
04:42
created

Friendica   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 5
eloc 8
c 1
b 0
f 1
dl 0
loc 22
ccs 8
cts 8
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getImageAlt() 0 2 1
A getImageTitle() 0 2 1
A getLink() 0 3 1
A getImage() 0 2 1
A __construct() 0 2 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Nexendrie\Components\SocialIcons;
5
6
use Nexendrie\Model\SettingsRepository;
7
8
/**
9
 * Twitter Social Icon
10
 *
11
 * @author Jakub Konečný
12
 */
13 1
final class Friendica implements \Nexendrie\Components\ISocialIcon {
14
  private string $account;
15
16
  public function __construct(SettingsRepository $sr) {
17 1
    $this->account = $sr->settings["socialAccounts"]["friendica"];
18 1
  }
19
20
  public function getLink(): string {
21 1
    $parts = explode("@", $this->account);
22 1
    return "https://{$parts[2]}/profile/{$parts[1]}";
23
  }
24
25
  public function getImage(): string {
26 1
    return "friendica.png";
27
  }
28
29
  public function getImageAlt(): string {
30 1
    return "Friendica";
31
  }
32
33
  public function getImageTitle(): string {
34 1
    return "Účet Friendica v rámci fedivesmíru";
35
  }
36
}
37
?>