users weekly stats as bar-chart in dashboard (#847)
This commit is contained in:
@@ -24,7 +24,6 @@ class Year
|
||||
protected $months = [];
|
||||
|
||||
/**
|
||||
* Year constructor.
|
||||
* @param string $year
|
||||
*/
|
||||
public function __construct($year)
|
||||
@@ -40,22 +39,14 @@ class Year
|
||||
return $this->year;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Month $month
|
||||
* @return $this
|
||||
*/
|
||||
public function setMonth(Month $month)
|
||||
public function setMonth(Month $month): Year
|
||||
{
|
||||
$this->months[(int) $month->getMonth()] = $month;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $month
|
||||
* @return null|Month
|
||||
*/
|
||||
public function getMonth(int $month)
|
||||
public function getMonth(int $month): ?Month
|
||||
{
|
||||
if (isset($this->months[$month])) {
|
||||
return $this->months[$month];
|
||||
@@ -67,7 +58,7 @@ class Year
|
||||
/**
|
||||
* @return Month[]
|
||||
*/
|
||||
public function getMonths()
|
||||
public function getMonths(): array
|
||||
{
|
||||
return array_values($this->months);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user