Completed
Push — master ( 85a7e3...d50bf3 )
by Jelle
02:47
created

EventRepository   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 3
Bugs 0 Features 2
Metric Value
wmc 5
c 3
b 0
f 2
lcom 1
cbo 2
dl 0
loc 24
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A byName() 0 3 1
A byFileName() 0 3 1
A byNameAndSeason() 0 3 1
A nextFiveByTeam() 0 3 1
A nextFifteenEventsByLeague() 0 3 1
1
<?php
2
/**
3
 * @file
4
 * Contains \TheSportsDb\Entity\Repository\EventRepository.
5
 */
6
7
namespace TheSportsDb\Entity\Repository;
8
9
/**
10
 * The default EventRepository implementation.
11
 *
12
 * @author Jelle Sebreghts
13
 */
14
class EventRepository extends Repository implements EventRepositoryInterface {
15
16
  protected $entityType = 'event';
17
  public function byName($name) {
18
    return $this->normalizeArray($this->sportsDbClient->doRequest('searchevents.php', array('e' => $name))->event);
19
  }
20
21
  public function byFileName($fileName) {
22
    return $this->normalizeArray($this->sportsDbClient->doRequest('searchfilename.php', array('e' => $fileName))->event);
23
  }
24
25
  public function byNameAndSeason($name, $season) {
26
    return $this->normalizeArray($this->sportsDbClient->doRequest('searchevents.php', array('e' => $name, 's' => $season))->event);
27
  }
28
29
  public function nextFiveByTeam($teamId) {
30
    return $this->normalizeArray($this->sportsDbClient->doRequest('eventsnext.php', array('id' => $teamId))->events);
31
  }
32
33
  public function nextFifteenEventsByLeague($leagueId) {
34
    return $this->normalizeArray($this->sportsDbClient->doRequest('eventsnextleague.php', array('id' => $leagueId))->events);
35
  }
36
37
}
38