for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace AmineBenHariz\Attendance;
/**
* Class Pause
* @package AmineBenHariz\Attendance
*/
class Pause
{
* @var \DateTime
private $start;
private $end;
* Pause constructor.
* @param \DateTime $start
* @param \DateTime $end
public function __construct(\DateTime $start, \DateTime $end)
if ($start > $end) {
throw new \InvalidArgumentException("Pause can't start after ending");
}
if ($start->format('Y-m-d') !== $end->format('Y-m-d')) {
throw new \InvalidArgumentException("Pause must end in the same day");
$this->start = $start;
$this->end = $end;
* @return \DateTime
public function getStart()
return $this->start;
public function getEnd()
return $this->end;