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

PlayerRepository::byTeamName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 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