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

PlayerRepository::byTeamName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 3
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 3
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 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 View Code Duplication
class PlayerRepository extends Repository implements PlayerRepositoryInterface {
1 ignored issue
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
16
  protected $entityType = 'player';
17
18
  public function byTeamName($name) {
19
    return $this->normalizeArray($this->sportsDbClient->doRequest('searchplayers.php', array('t' => $name))->player);
20
  }
21
22
  public function byName($name) {
23
    return $this->normalizeArray($this->sportsDbClient->doRequest('searchplayers.php', array('p' => $name))->player);
24
  }
25
26
  public function byTeamNameAndName($teamName, $name) {
27
    return $this->normalizeArray($this->sportsDbClient->doRequest('searchplayers.php', array('p' => $name, 't' => $teamName))->player);
28
  }
29
30
  public function byTeam($teamId) {
31
    return $this->normalizeArray($this->sportsDbClient->doRequest('lookup_all_players.php', array('id' => $teamId))->player);
32
  }
33
34
}
35