1 | <?php |
||
13 | class StockInvestmentRatiosCalculator extends CalculatorAbstract |
||
14 | { |
||
15 | |||
16 | // sum of dividends per a period |
||
17 | protected $totalDividends; |
||
18 | // amount earned after taxes |
||
19 | protected $earningsAfterTaxes; |
||
20 | // number of stocks (total if constant, average if fluctuating) |
||
21 | protected $noOfStocks; |
||
22 | |||
23 | // props returned by the getResultAsArray method by default |
||
24 | protected $propResultArray = [ |
||
25 | "totalDividends", |
||
26 | "earningsAfterTaxes", |
||
27 | "noOfStocks", |
||
28 | "dividendPerStock", |
||
29 | "earningsPerStock", |
||
30 | "payoutRatio", |
||
31 | "dividendRatio", |
||
32 | "retentionRatio" |
||
33 | ]; |
||
34 | |||
35 | /** |
||
36 | * @param $totalDividends |
||
37 | * @param $earningsAfterTaxes |
||
38 | * @param $noOfStocks |
||
39 | */ |
||
40 | public function __construct( |
||
49 | |||
50 | /** |
||
51 | * @param $totalDividends |
||
52 | */ |
||
53 | public function setTotalDividends($totalDividends) |
||
57 | |||
58 | /** |
||
59 | * @param $earningsAfterTaxes |
||
60 | */ |
||
61 | public function setEarningsAfterTaxes($earningsAfterTaxes) |
||
65 | |||
66 | /** |
||
67 | * @param $noOfStocks |
||
68 | */ |
||
69 | public function setNoOfStocks($noOfStocks) |
||
73 | |||
74 | /** |
||
75 | * @return mixed |
||
76 | */ |
||
77 | public function getTotalDividends() |
||
81 | |||
82 | /** |
||
83 | * @return mixed |
||
84 | */ |
||
85 | public function getEarningsAfterTaxes() |
||
89 | |||
90 | /** |
||
91 | * @return mixed |
||
92 | */ |
||
93 | public function getNoOfStocks() |
||
97 | |||
98 | /** |
||
99 | * @return string |
||
100 | */ |
||
101 | public function getDividendPerStock() |
||
108 | |||
109 | /** |
||
110 | * @return string |
||
111 | */ |
||
112 | public function getEarningsPerStock() |
||
119 | |||
120 | /** |
||
121 | * @return string |
||
122 | */ |
||
123 | public function getPayoutRatio() |
||
130 | |||
131 | /** |
||
132 | * @return string |
||
133 | */ |
||
134 | public function getDividendRatio() |
||
141 | |||
142 | /** |
||
143 | * @return string |
||
144 | */ |
||
145 | public function getRetentionRatio() |
||
152 | |||
153 | } |
||
154 | } |
||
155 |