forked from Kantai235/php-design-pattern
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBag.php
More file actions
51 lines (44 loc) · 744 Bytes
/
Bag.php
File metadata and controls
51 lines (44 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
namespace DesignPatterns\Behavioral\ChainOfResponsibilities;
/**
* Class Bag.
*/
class Bag
{
/**
* @var Turnips
*/
protected Turnips $turnips;
/**
* @var int
*/
protected int $bells = 0;
/**
* @param Turnips $turnips
*/
public function setTurnips(Turnips $turnips)
{
$this->turnips = $turnips;
}
/**
* @param int $bells
*/
public function setBells(int $bells)
{
$this->bells = $bells;
}
/**
* @return Turnips
*/
public function getTurnips(): Turnips
{
return $this->turnips;
}
/**
* @return int
*/
public function getBells(): int
{
return $this->bells;
}
}