Passed
Push — master ( 8b5b84...34c143 )
by IRFA
01:51
created

Roll::putDropUp()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 2
nc 2
nop 1
1
<?php 
2
/* 
3
	Author:Irfa Ardiansyah <[email protected]>
4
	Simple Items Gatcha with PHP
5
*/
6
namespace Irfa\Gatcha;
7
8
use Irfa\Gatcha\Roulette\Roulette;
9
use Exception;
10
11
class Roll extends Roulette {
12
13
	private static $items;
14
	private static $return;
0 ignored issues
show
introduced by
The private property $return is not used, and could be removed.
Loading history...
15
16
	public static function put($items)
17
	{
18
		self::$items = $items;
19
20
		return new static();
21
	}
22
	public static function spin() 
23
	{
24
		return self::getItem();
25
	}
26
	public static function dropUp($items, $rate)
27
	{
28
		$items_bucket = self::$items;
29
		self::putDropUp(self::itemDropUp($items_bucket, $items, $rate));
30
		return new static();
31
	}
32
	private static function getItem() {
33
		$ret = self::get(self::$items);
34
		self::$items = null;
35
		return $ret;
36
	}
37
	private static function putDropUp($arr){
38
		foreach($arr as $k => $v){
39
			self::$items[$k] = $v;
40
		}
41
		var_dump(self::$items);
0 ignored issues
show
Security Debugging Code introduced by
var_dump(self::items) looks like debug code. Are you sure you do not want to remove it?
Loading history...
42
	}
43
	
44
}