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

TeamRepository::byLeagueName()   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\TeamRepository.
5
 */
6
7
namespace TheSportsDb\Entity\Repository;
8
9
/**
10
 * The default TeamRepository implementation.
11
 *
12
 * @author Jelle Sebreghts
13
 */
14
class TeamRepository extends Repository implements TeamRepositoryInterface {
15
16
  /**
17
   * {@inheritdoc}
18
   */
19
  protected $entityType = 'team';
20
21
  /**
22
   * {@inheritdoc}
23
   */
24 1
  public function byName($name) {
25 1
    return $this->normalizeArray($this->sportsDbClient->doRequest('searchteams.php', array('t' => $name))->teams);
26
  }
27
28
  /**
29
   * {@inheritdoc}
30
   */
31 1
  public function byLeagueName($leagueName) {
32 1
    return $this->normalizeArray($this->sportsDbClient->doRequest('search_all_teams.php', array('l' => $leagueName))->teams);
33
  }
34
35
  /**
36
   * {@inheritdoc}
37
   */
38 1
  public function bySportAndCountry($sport, $country) {
39 1
    return $this->normalizeArray($this->sportsDbClient->doRequest('search_all_teams.php', array('s' => $sport, 'c' => $country))->teams);
40
  }
41
42
  /**
43
   * {@inheritdoc}
44
   */
45 1
  public function byLeague($leagueId) {
46 1
    return $this->normalizeArray($this->sportsDbClient->doRequest('lookup_all_teams.php', array('id' => $leagueId))->teams);
47
  }
48
49
}
50