upgraded to phpunit 8 (#1155)
This commit is contained in:
@@ -46,7 +46,7 @@ class DurationStringToSecondsTransformer implements DataTransformerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $formatToInt
|
||||
* @param string|null $formatToInt
|
||||
* @return int|null
|
||||
*/
|
||||
public function reverseTransform($formatToInt)
|
||||
|
||||
@@ -11,49 +11,35 @@ namespace App\Form\Model;
|
||||
|
||||
use DateTime;
|
||||
|
||||
class DateRange
|
||||
final class DateRange
|
||||
{
|
||||
/**
|
||||
* @var DateTime
|
||||
*/
|
||||
protected $begin;
|
||||
private $begin;
|
||||
/**
|
||||
* @var DateTime
|
||||
*/
|
||||
protected $end;
|
||||
private $end;
|
||||
|
||||
/**
|
||||
* @return DateTime
|
||||
*/
|
||||
public function getBegin(): ?DateTime
|
||||
{
|
||||
return $this->begin;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DateTime $begin
|
||||
* @return DateRange
|
||||
*/
|
||||
public function setBegin(DateTime $begin)
|
||||
public function setBegin(DateTime $begin): DateRange
|
||||
{
|
||||
$this->begin = $begin;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DateTime
|
||||
*/
|
||||
public function getEnd(): ?DateTime
|
||||
{
|
||||
return $this->end;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DateTime $end
|
||||
* @return DateRange
|
||||
*/
|
||||
public function setEnd(DateTime $end)
|
||||
public function setEnd(DateTime $end): DateRange
|
||||
{
|
||||
$this->end = $end;
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ class TimesheetEditForm extends AbstractType
|
||||
$builder->addEventListener(
|
||||
FormEvents::POST_SET_DATA,
|
||||
function (FormEvent $event) {
|
||||
/** @var Timesheet $data */
|
||||
/** @var Timesheet|null $data */
|
||||
$data = $event->getData();
|
||||
if (null === $data || null === $data->getEnd()) {
|
||||
$event->getForm()->get('duration')->setData(null);
|
||||
|
||||
Reference in New Issue
Block a user