Avatars::find()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 6
ccs 0
cts 4
cp 0
crap 6
rs 10
1
<?php
2
3
namespace SchoppAx\Sleeper\Api;
4
5
class Avatars
6
{
7
8
    /**
9
     * @param string $avatarId
10
     * @param bool[optional] $thumbnail
11
     *
12
     * @return string image link for each avatar
13
     * @throws ClientException if status code <> 200
14
     * @throws Exception if response body equals null
15
     */
16
    public function find(string $avatarId, bool $thumbnail = false)
17
    {
18
      if ($thumbnail) {
19
        $avatarId = 'thumbs/'. $avatarId;
20
      }
21
      return 'https://sleepercdn.com/avatars/'. $avatarId;
22
    }
23
}
24