1 | <?php |
||
21 | class ForecastOfOpportunities |
||
22 | { |
||
23 | /** @var RegistryInterface */ |
||
24 | protected $doctrine; |
||
25 | |||
26 | /** @var NumberFormatter */ |
||
27 | protected $numberFormatter; |
||
28 | |||
29 | /** @var DateTimeFormatter */ |
||
30 | protected $dateTimeFormatter; |
||
31 | |||
32 | /** @var AclHelper */ |
||
33 | protected $aclHelper; |
||
34 | |||
35 | /** @var TranslatorInterface */ |
||
36 | protected $translator; |
||
37 | |||
38 | /** @var DateHelper */ |
||
39 | protected $dateHelper; |
||
40 | |||
41 | /** @var array */ |
||
42 | protected $ownersValues; |
||
43 | |||
44 | /** |
||
45 | * @param RegistryInterface $doctrine |
||
46 | * @param NumberFormatter $numberFormatter |
||
47 | * @param DateTimeFormatter $dateTimeFormatter |
||
48 | * @param AclHelper $aclHelper |
||
49 | * @param TranslatorInterface $translator |
||
50 | * @param DateHelper $dateHelper |
||
51 | * @param OwnerHelper $ownerHelper |
||
52 | */ |
||
53 | public function __construct( |
||
70 | |||
71 | /** |
||
72 | * @param WidgetOptionBag $widgetOptions |
||
73 | * @param string $getterName |
||
74 | * @param string $dataType |
||
75 | * @param bool $lessIsBetter |
||
76 | * |
||
77 | * @return array |
||
78 | */ |
||
79 | public function getForecastOfOpportunitiesValues( |
||
118 | |||
119 | /** |
||
120 | * @param array $ownerIds |
||
121 | * @param \DateTime $start |
||
122 | * @param \DateTime $end |
||
123 | * @param \DateTime|string|int $compareToDate |
||
124 | * |
||
125 | * @return int |
||
126 | */ |
||
127 | protected function getInProgressValues($ownerIds, $start = null, $end = null, $compareToDate = null) |
||
133 | |||
134 | /** |
||
135 | * @param array $ownerIds |
||
136 | * @param \DateTime $start |
||
137 | * @param \DateTime $end |
||
138 | * @param \DateTime|string|int $compareToDate |
||
139 | * |
||
140 | * @return int |
||
141 | */ |
||
142 | protected function getTotalForecastValues($ownerIds, $start = null, $end = null, $compareToDate = null) |
||
148 | |||
149 | /** |
||
150 | * @param array $ownerIds |
||
151 | * @param \DateTime $start |
||
152 | * @param \DateTime $end |
||
153 | * @param \DateTime|string|int $compareToDate |
||
154 | * |
||
155 | * @return int |
||
156 | */ |
||
157 | protected function getWeightedForecastValues($ownerIds, $start = null, $end = null, $compareToDate = null) |
||
163 | |||
164 | /** |
||
165 | * @param array $ownerIds |
||
166 | * @param \DateTime $start |
||
167 | * @param \DateTime $end |
||
168 | * @param \DateTime|string|int $date |
||
169 | * |
||
170 | * @return mixed |
||
171 | */ |
||
172 | protected function getOwnersValues(array $ownerIds, $start = null, $end = null, $date = null) |
||
186 | |||
187 | /** |
||
188 | * @param mixed $value |
||
189 | * @param string $type |
||
190 | * @param bool $isDeviant |
||
191 | * |
||
192 | * @return string |
||
193 | */ |
||
194 | protected function formatValue($value, $type = '', $isDeviant = false) |
||
222 | |||
223 | /** |
||
224 | * @param $dataType |
||
225 | * @param $lessIsBetter |
||
226 | * @param $pastResult |
||
227 | * @param $deviation |
||
228 | * @param $result |
||
229 | * |
||
230 | * @return array |
||
231 | */ |
||
232 | protected function prepareData($dataType, $lessIsBetter, $pastResult, $deviation, $result) |
||
253 | |||
254 | /** |
||
255 | * Get is positive value |
||
256 | * |
||
257 | * @param $lessIsBetter |
||
258 | * @param $deviation |
||
259 | * |
||
260 | * @return bool |
||
261 | */ |
||
262 | protected function isPositive($lessIsBetter, $deviation) |
||
272 | |||
273 | /** |
||
274 | * @param array $dateRange |
||
275 | * @param bool $usePrevious |
||
276 | * |
||
277 | * @return array |
||
278 | */ |
||
279 | protected function prepareDateRange(array $dateRange, $usePrevious) |
||
316 | } |
||
317 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: