Release 2.0.32 (#4256)
This commit is contained in:
@@ -18,7 +18,7 @@ abstract class AbstractMetaDisplayEvent extends Event implements MetaDisplayEven
|
||||
/**
|
||||
* @var MetaTableTypeInterface[]
|
||||
*/
|
||||
private $fields = [];
|
||||
private array $fields = [];
|
||||
|
||||
public function __construct(private BaseQuery $query, private string $location)
|
||||
{
|
||||
|
||||
@@ -14,16 +14,9 @@ use App\Model\ActivityStatistic;
|
||||
|
||||
final class ActivityStatisticEvent extends AbstractActivityEvent
|
||||
{
|
||||
private $statistic;
|
||||
private $begin;
|
||||
private $end;
|
||||
|
||||
public function __construct(Activity $activity, ActivityStatistic $statistic, \DateTime $begin = null, \DateTime $end = null)
|
||||
public function __construct(Activity $activity, private ActivityStatistic $statistic, private ?\DateTime $begin = null, private ?\DateTime $end = null)
|
||||
{
|
||||
parent::__construct($activity);
|
||||
$this->statistic = $statistic;
|
||||
$this->begin = $begin;
|
||||
$this->end = $end;
|
||||
}
|
||||
|
||||
public function getStatistic(): ActivityStatistic
|
||||
|
||||
@@ -25,7 +25,7 @@ final class CalendarConfigurationEvent extends Event
|
||||
return $this->configuration;
|
||||
}
|
||||
|
||||
public function setConfiguration(array $configuration)
|
||||
public function setConfiguration(array $configuration): void
|
||||
{
|
||||
foreach ($configuration as $key => $value) {
|
||||
if (\array_key_exists($key, $this->configuration)) {
|
||||
|
||||
@@ -18,7 +18,7 @@ final class CalendarDragAndDropSourceEvent extends Event
|
||||
/**
|
||||
* @var DragAndDropSource[]
|
||||
*/
|
||||
private $sources = [];
|
||||
private array $sources = [];
|
||||
|
||||
public function __construct(private User $user, private int $maxEntries)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ final class CalendarGoogleSourceEvent extends Event
|
||||
/**
|
||||
* @var GoogleSource[]
|
||||
*/
|
||||
private $sources = [];
|
||||
private array $sources = [];
|
||||
|
||||
public function __construct(private User $user)
|
||||
{
|
||||
|
||||
44
src/Event/CalendarSourceEvent.php
Normal file
44
src/Event/CalendarSourceEvent.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Event;
|
||||
|
||||
use App\Calendar\CalendarSource;
|
||||
use App\Entity\User;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
final class CalendarSourceEvent extends Event
|
||||
{
|
||||
/**
|
||||
* @var CalendarSource[]
|
||||
*/
|
||||
private array $sources = [];
|
||||
|
||||
public function __construct(private User $user)
|
||||
{
|
||||
}
|
||||
|
||||
public function getUser(): User
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function addSource(CalendarSource $source): void
|
||||
{
|
||||
$this->sources[] = $source;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return CalendarSource[]
|
||||
*/
|
||||
public function getSources(): array
|
||||
{
|
||||
return $this->sources;
|
||||
}
|
||||
}
|
||||
@@ -14,16 +14,9 @@ use App\Model\CustomerStatistic;
|
||||
|
||||
final class CustomerStatisticEvent extends AbstractCustomerEvent
|
||||
{
|
||||
private $statistic;
|
||||
private $begin;
|
||||
private $end;
|
||||
|
||||
public function __construct(Customer $customer, CustomerStatistic $statistic, \DateTime $begin = null, \DateTime $end = null)
|
||||
public function __construct(Customer $customer, private CustomerStatistic $statistic, private ?\DateTime $begin = null, private ?\DateTime $end = null)
|
||||
{
|
||||
parent::__construct($customer);
|
||||
$this->statistic = $statistic;
|
||||
$this->begin = $begin;
|
||||
$this->end = $end;
|
||||
}
|
||||
|
||||
public function getStatistic(): CustomerStatistic
|
||||
|
||||
@@ -17,7 +17,7 @@ final class DashboardEvent extends Event
|
||||
/**
|
||||
* @var array<string>
|
||||
*/
|
||||
private $widgets = [];
|
||||
private array $widgets = [];
|
||||
|
||||
public function __construct(private User $user)
|
||||
{
|
||||
|
||||
@@ -14,10 +14,6 @@ use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
final class InvoiceDocumentsEvent extends Event
|
||||
{
|
||||
/**
|
||||
* @var array<InvoiceDocument>
|
||||
*/
|
||||
private array $documents;
|
||||
/**
|
||||
* Maximum amount of allowed invoice documents.
|
||||
*/
|
||||
@@ -26,9 +22,8 @@ final class InvoiceDocumentsEvent extends Event
|
||||
/**
|
||||
* @param InvoiceDocument[] $documents
|
||||
*/
|
||||
public function __construct(array $documents)
|
||||
public function __construct(private array $documents)
|
||||
{
|
||||
$this->documents = $documents;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,9 +18,9 @@ use Symfony\Contracts\EventDispatcher\Event;
|
||||
final class PermissionSectionsEvent extends Event
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
* @var array<PermissionSectionInterface>
|
||||
*/
|
||||
private $sections;
|
||||
private array $sections = [];
|
||||
|
||||
public function addSection(PermissionSectionInterface $section): PermissionSectionsEvent
|
||||
{
|
||||
|
||||
@@ -17,9 +17,9 @@ use Symfony\Contracts\EventDispatcher\Event;
|
||||
final class PermissionsEvent extends Event
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
* @var array<string, array<string>>
|
||||
*/
|
||||
private $sections = [];
|
||||
private array $sections = [];
|
||||
|
||||
/**
|
||||
* @param string $section
|
||||
|
||||
@@ -14,16 +14,9 @@ use App\Model\ProjectStatistic;
|
||||
|
||||
final class ProjectStatisticEvent extends AbstractProjectEvent
|
||||
{
|
||||
private $statistic;
|
||||
private $begin;
|
||||
private $end;
|
||||
|
||||
public function __construct(Project $project, ProjectStatistic $statistic, \DateTime $begin = null, \DateTime $end = null)
|
||||
public function __construct(Project $project, private ProjectStatistic $statistic, private ?\DateTime $begin = null, private ?\DateTime $end = null)
|
||||
{
|
||||
parent::__construct($project);
|
||||
$this->statistic = $statistic;
|
||||
$this->begin = $begin;
|
||||
$this->end = $end;
|
||||
}
|
||||
|
||||
public function getStatistic(): ProjectStatistic
|
||||
|
||||
@@ -13,15 +13,9 @@ use App\Entity\Timesheet;
|
||||
|
||||
final class TimesheetDuplicatePostEvent extends AbstractTimesheetEvent
|
||||
{
|
||||
/**
|
||||
* @var Timesheet
|
||||
*/
|
||||
private $original;
|
||||
|
||||
public function __construct(Timesheet $new, Timesheet $original)
|
||||
public function __construct(Timesheet $new, private Timesheet $original)
|
||||
{
|
||||
parent::__construct($new);
|
||||
$this->original = $original;
|
||||
}
|
||||
|
||||
public function getOriginalTimesheet(): Timesheet
|
||||
|
||||
@@ -13,15 +13,9 @@ use App\Entity\Timesheet;
|
||||
|
||||
final class TimesheetDuplicatePreEvent extends AbstractTimesheetEvent
|
||||
{
|
||||
/**
|
||||
* @var Timesheet
|
||||
*/
|
||||
private $original;
|
||||
|
||||
public function __construct(Timesheet $new, Timesheet $original)
|
||||
public function __construct(Timesheet $new, private Timesheet $original)
|
||||
{
|
||||
parent::__construct($new);
|
||||
$this->original = $original;
|
||||
}
|
||||
|
||||
public function getOriginalTimesheet(): Timesheet
|
||||
|
||||
@@ -13,15 +13,9 @@ use App\Entity\Timesheet;
|
||||
|
||||
final class TimesheetRestartPostEvent extends AbstractTimesheetEvent
|
||||
{
|
||||
/**
|
||||
* @var Timesheet
|
||||
*/
|
||||
private $original;
|
||||
|
||||
public function __construct(Timesheet $new, Timesheet $original)
|
||||
public function __construct(Timesheet $new, private Timesheet $original)
|
||||
{
|
||||
parent::__construct($new);
|
||||
$this->original = $original;
|
||||
}
|
||||
|
||||
public function getOriginalTimesheet(): Timesheet
|
||||
|
||||
@@ -13,15 +13,9 @@ use App\Entity\Timesheet;
|
||||
|
||||
final class TimesheetRestartPreEvent extends AbstractTimesheetEvent
|
||||
{
|
||||
/**
|
||||
* @var Timesheet
|
||||
*/
|
||||
private $original;
|
||||
|
||||
public function __construct(Timesheet $new, Timesheet $original)
|
||||
public function __construct(Timesheet $new, private Timesheet $original)
|
||||
{
|
||||
parent::__construct($new);
|
||||
$this->original = $original;
|
||||
}
|
||||
|
||||
public function getOriginalTimesheet(): Timesheet
|
||||
|
||||
Reference in New Issue
Block a user