Refactor Classes
This commit is contained in:
@@ -18,9 +18,8 @@ abstract class AbstractWorkingHoursViewRepository implements RepositoryReaderInt
|
||||
{
|
||||
|
||||
protected const SQL_SELECT = '';
|
||||
protected const SQL_WHERE = '';
|
||||
protected const SQL_WHERE = '';
|
||||
|
||||
protected PDO $database;
|
||||
protected PeriodDesignationEnum $periodDesignation;
|
||||
|
||||
/**
|
||||
@@ -28,9 +27,8 @@ abstract class AbstractWorkingHoursViewRepository implements RepositoryReaderInt
|
||||
*
|
||||
* @param PDO $database
|
||||
*/
|
||||
public function __construct(PDO $database)
|
||||
public function __construct(protected PDO $database)
|
||||
{
|
||||
$this->database = $database;
|
||||
$this->database->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
}
|
||||
|
||||
@@ -51,7 +49,7 @@ abstract class AbstractWorkingHoursViewRepository implements RepositoryReaderInt
|
||||
$model = new WorkingHoursView(
|
||||
$this->buildDateFromPeriod($row['period']),
|
||||
$this->periodDesignation,
|
||||
(int) $row['workingDays'],
|
||||
(int)$row['workingDays'],
|
||||
$this->buildDateInterval($row['totalHours']),
|
||||
$this->buildDateInterval($row['overtime'])
|
||||
);
|
||||
@@ -82,7 +80,7 @@ abstract class AbstractWorkingHoursViewRepository implements RepositoryReaderInt
|
||||
return new WorkingHoursView(
|
||||
$this->buildDateFromPeriod($row['period']),
|
||||
$this->periodDesignation,
|
||||
(int) $row['workingDays'],
|
||||
(int)$row['workingDays'],
|
||||
$this->buildDateInterval($row['totalHours']),
|
||||
$this->buildDateInterval($row['overtime'])
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user