Completed
Push — master ( db3a5a...bd914c )
by Jelle
10:58
created

PlayerRepository   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 36
ccs 8
cts 8
cp 1
rs 10
c 1
b 1
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A byTeamName() 0 3 1
A byName() 0 3 1
A byTeamNameAndName() 0 3 1
A byTeam() 0 3 1
1
<?php
2
/**
3
 * @file
4
 * Contains \TheSportsDb\Entity\Repository\PlayerRepository.
5
 */
6
7
namespace TheSportsDb\Entity\Repository;
8
9
/**
10
 * The default PlayerRepository implementation.
11
 *
12
 * @author Jelle Sebreghts
13
 */
14
class PlayerRepository extends Repository implements PlayerRepositoryInterface {
15
16
  /**
17
   * {@inheritdoc}
18
   */
19
  protected $entityType = 'player';
20
21
  /**
22
   * {@inheritdoc}
23
   */
24 1
  public function byTeamName($name) {
25 1
    return $this->normalizeArray($this->sportsDbClient->doRequest('searchplayers.php', array('t' => $name))->player);
26
  }
27
28
  /**
29
   * {@inheritdoc}
30
   */
31 1
  public function byName($name) {
32 1
    return $this->normalizeArray($this->sportsDbClient->doRequest('searchplayers.php', array('p' => $name))->player);
33
  }
34
35
  /**
36
   * {@inheritdoc}
37
   */
38 1
  public function byTeamNameAndName($teamName, $name) {
39 1
    return $this->normalizeArray($this->sportsDbClient->doRequest('searchplayers.php', array('p' => $name, 't' => $teamName))->player);
40
  }
41
42
  /**
43
   * {@inheritdoc}
44
   */
45 1
  public function byTeam($teamId) {
46 1
    return $this->normalizeArray($this->sportsDbClient->doRequest('lookup_all_players.php', array('id' => $teamId))->player);
47
  }
48
49
}
50