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

LeagueRepository::byCountry()   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\LeagueRepository.
5
 */
6
7
namespace TheSportsDb\Entity\Repository;
8
9
/**
10
 * The default LeagueRepository implementation.
11
 *
12
 * @author Jelle Sebreghts
13
 */
14
class LeagueRepository extends Repository implements LeagueRepositoryInterface {
15
16
  /**
17
   * {@inheritdoc}
18
   */
19
  protected $entityType = 'league';
20
21
  /**
22
   * {@inheritdoc}
23
   */
24 1
  public function all() {
25 1
    return $this->normalizeArray($this->sportsDbClient->doRequest('all_leagues.php')->leagues);
26
  }
27
28
  /**
29
   * {@inheritdoc}
30
   */
31 1
  public function byCountry($country) {
32 1
    return $this->normalizeArray($this->sportsDbClient->doRequest('search_all_leagues.php', array('c' => $country))->countrys);
33
  }
34
35
  /**
36
   * {@inheritdoc}
37
   */
38 1
  public function byCountryAndSport($country, $sport) {
39 1
    return $this->normalizeArray($this->sportsDbClient->doRequest('search_all_leagues.php', array('c' => $country, 's' => $sport))->countrys);
40
  }
41
42
  /**
43
   * {@inheritdoc}
44
   */
45 1
  public function bySport($sport) {
46 1
    return $this->normalizeArray($this->sportsDbClient->doRequest('search_all_leagues.php', array('s' => $sport))->countrys);
47
  }
48
49
}
50