DummyReader   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 28
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 4 1
A getWeek() 0 4 1
A getAmount() 0 15 2
1
<?php
2
3
namespace WITR\TopTwenty;
4
5
use stdClass;
6
7
class DummyReader implements Reader {
8
9
	public function get()
10
	{
11
		return $this->getAmount(20);
12
	}
13
14
	public function getWeek()
15
	{
16
		return $this->getAmount(50);
17
	}
18
19
	private function getAmount($amount)
20
	{
21
		$songs = [];
22
		for ($i = 0; $i < $amount; $i++)
23
		{
24
			$song = new stdClass();
25
			$song->artist = 'Rage Against The Machine';
26
			$song->title = 'Bombtrack';
27
			$song->count = $amount - $i;
28
			$song->name = 'Feature';
29
			$songs[] = $song;
30
		}
31
32
		return $songs;	
33
	}
34
}