-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPerson.php
More file actions
44 lines (41 loc) · 850 Bytes
/
Copy pathPerson.php
File metadata and controls
44 lines (41 loc) · 850 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
<?php
/**
* Created by PhpStorm.
* User: hdrm147
* Date: 2/9/19
* Time: 2:38 PM
*/
class Person
{
public $name;
public $mood;
public $length;
public $sports;
public $energy;
public function __construct($name,$energy)
{
$this->name = $name;
$this->energy = $energy;
echo "Class Constructor Called";
}
public function sleep($hours = 7)
{
switch ($hours) {
case 0:
$this->energy += 0;
break;
case 1:
$this->energy += 0;
break;
case 2:
$this->energy += 0;
break;
case 3:
$this->energy += 0.01;
break;
case 7:
$this->energy += 6;
break;
}
}
}