Code Duplication    Length = 8-9 lines in 2 locations

ClashAPI/League.class.php 2 locations

@@ 37-44 (lines=8) @@
34
	{
35
		if($this->league == NULL)
36
		{
37
			foreach ($this->api->getLeagueList()->items as $league) 
38
			{
39
				if ($league->id == $this->leagueId) 
40
				{
41
					$this->league = $league;
42
					return $this->league;
43
				}
44
			}
45
			return 0;
46
		}
47
		else
@@ 62-70 (lines=9) @@
59
	 */
60
	public function setLeagueByName($name)
61
	{
62
		foreach ($this->api->getLeagueList()->items as $league) 
63
		{
64
			if ($league->name == $name) 
65
			{
66
				$this->leagueId = $league->id;
67
				$this->league = $league;
68
				return 1;
69
			}
70
		}
71
		return 0;
72
	}
73