Total Complexity | 8 |
Total Lines | 65 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | class OrganisationEvaluation |
||
19 | { |
||
20 | /** |
||
21 | * @var Organisation |
||
22 | */ |
||
23 | private $organisation; |
||
24 | |||
25 | /** |
||
26 | * @var SemesterReport |
||
27 | */ |
||
28 | private $semesterReport; |
||
29 | |||
30 | /** |
||
31 | * @var Event[] |
||
32 | */ |
||
33 | private $events; |
||
34 | |||
35 | /** |
||
36 | * OrganisationEvaluation constructor. |
||
37 | * |
||
38 | * @param Event[] $events |
||
39 | */ |
||
40 | public function __construct(Organisation $organisation, SemesterReport $semesterReport, array $events) |
||
41 | { |
||
42 | $this->organisation = $organisation; |
||
43 | $this->semesterReport = $semesterReport; |
||
44 | $this->events = $events; |
||
45 | } |
||
46 | |||
47 | public function getOrganisation(): Organisation |
||
48 | { |
||
49 | return $this->organisation; |
||
50 | } |
||
51 | |||
52 | public function getSemesterReport(): SemesterReport |
||
55 | } |
||
56 | |||
57 | public function getRevenueSum(): int |
||
58 | { |
||
59 | $revenueSum = 0; |
||
60 | foreach ($this->events as $futureEvent) { |
||
61 | $revenueSum += $futureEvent->getRevenue(); |
||
62 | } |
||
63 | |||
64 | return $revenueSum; |
||
65 | } |
||
66 | |||
67 | public function getExpenditureSum(): int |
||
68 | { |
||
69 | $expenditureSum = 0; |
||
70 | foreach ($this->events as $futureEvent) { |
||
71 | $expenditureSum += $futureEvent->getExpenditure(); |
||
72 | } |
||
73 | |||
74 | return $expenditureSum; |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * @return Event[] |
||
79 | */ |
||
80 | public function getEvents(): array |
||
83 | } |
||
84 | } |
||
85 |