Release 2.38.0 (#5563)

This commit is contained in:
Kevin Papst
2025-08-08 23:25:42 +02:00
committed by GitHub
parent f3890691ce
commit 04331420ae
88 changed files with 1319 additions and 697 deletions

View File

@@ -0,0 +1,25 @@
<?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\Entity\Invoice;
use Symfony\Contracts\EventDispatcher\Event;
class AbstractInvoiceEvent extends Event
{
public function __construct(private readonly Invoice $invoice)
{
}
public function getInvoice(): Invoice
{
return $this->invoice;
}
}

View File

@@ -9,9 +9,9 @@
namespace App\Event;
/**
* Triggered for activity instances, which were just saved.
*/
use App\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'activity.created', description: 'Triggered after a new activity was created', payload: 'object.getActivity()')]
final class ActivityCreatePostEvent extends AbstractActivityEvent
{
}

View File

@@ -9,9 +9,9 @@
namespace App\Event;
/**
* Triggered right before a activity will be deleted.
*/
use App\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'activity.deleted', description: 'Triggered right before an activity will be deleted', payload: 'object.getActivity()')]
final class ActivityDeleteEvent extends AbstractActivityEvent
{
}

View File

@@ -9,9 +9,9 @@
namespace App\Event;
/**
* Triggered for activity instances, which were updated.
*/
use App\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'activity.updated', description: 'Triggered after an activity was updated', payload: 'object.getActivity()')]
final class ActivityUpdatePostEvent extends AbstractActivityEvent
{
}

View File

@@ -9,9 +9,9 @@
namespace App\Event;
/**
* Triggered for customer instances, which were just saved.
*/
use App\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'customer.created', description: 'Triggered after a customer was created', payload: 'object.getCustomer()')]
final class CustomerCreatePostEvent extends AbstractCustomerEvent
{
}

View File

@@ -9,9 +9,9 @@
namespace App\Event;
/**
* Triggered right before a customer will be deleted.
*/
use App\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'customer.deleted', description: 'Triggered right before a customer will be deleted', payload: 'object.getCustomer()')]
final class CustomerDeleteEvent extends AbstractCustomerEvent
{
}

View File

@@ -9,9 +9,9 @@
namespace App\Event;
/**
* Triggered for customer instances, which were just updated.
*/
use App\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'customer.updated', description: 'Triggered after a customer was updated', payload: 'object.getCustomer()')]
final class CustomerUpdatePostEvent extends AbstractCustomerEvent
{
}

View File

@@ -11,17 +11,14 @@ namespace App\Event;
use App\Entity\Invoice;
use App\Invoice\InvoiceModel;
use Symfony\Contracts\EventDispatcher\Event;
use App\Webhook\Attribute\AsWebhook;
final class InvoiceCreatedEvent extends Event
#[AsWebhook(name: 'invoice.created', description: 'Triggered after an invoice was created', payload: 'object.getInvoice()')]
final class InvoiceCreatedEvent extends AbstractInvoiceEvent
{
public function __construct(private readonly Invoice $invoice, private readonly InvoiceModel $model)
public function __construct(Invoice $invoice, private readonly InvoiceModel $model)
{
}
public function getInvoice(): Invoice
{
return $this->invoice;
parent::__construct($invoice);
}
public function getInvoiceModel(): InvoiceModel

View File

@@ -9,17 +9,9 @@
namespace App\Event;
use App\Entity\Invoice;
use Symfony\Contracts\EventDispatcher\Event;
use App\Webhook\Attribute\AsWebhook;
final class InvoiceDeleteEvent extends Event
#[AsWebhook(name: 'invoice.deleted', description: 'Triggered after an invoice was deleted', payload: 'object.getInvoice()')]
final class InvoiceDeleteEvent extends AbstractInvoiceEvent
{
public function __construct(private Invoice $invoice)
{
}
public function getInvoice(): Invoice
{
return $this->invoice;
}
}

View File

@@ -20,9 +20,9 @@ final class PermissionSectionsEvent extends Event
/**
* @var array<PermissionSectionInterface>
*/
private array $sections = [];
private array $sections = []; // @phpstan-ignore property.deprecatedInterface
public function addSection(PermissionSectionInterface $section): PermissionSectionsEvent
public function addSection(PermissionSectionInterface $section): PermissionSectionsEvent // @phpstan-ignore parameter.deprecatedInterface
{
$this->sections[] = $section;
@@ -32,7 +32,7 @@ final class PermissionSectionsEvent extends Event
/**
* @return PermissionSectionInterface[]
*/
public function getSections(): array
public function getSections(): array // @phpstan-ignore return.deprecatedInterface
{
return $this->sections;
}

View File

@@ -9,9 +9,9 @@
namespace App\Event;
/**
* Triggered for project instances, which were just saved.
*/
use App\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'project.created', description: 'Triggered after a project was created', payload: 'object.getProject()')]
final class ProjectCreatePostEvent extends AbstractProjectEvent
{
}

View File

@@ -9,9 +9,9 @@
namespace App\Event;
/**
* Triggered right before a project will be deleted.
*/
use App\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'project.deleted', description: 'Triggered right before a project will be deleted', payload: 'object.getProject()')]
final class ProjectDeleteEvent extends AbstractProjectEvent
{
}

View File

@@ -9,9 +9,9 @@
namespace App\Event;
/**
* Triggered for project instances, which were just updated.
*/
use App\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'project.updated', description: 'Triggered after a project was updated', payload: 'object.getProject()')]
final class ProjectUpdatePostEvent extends AbstractProjectEvent
{
}

View File

@@ -13,7 +13,7 @@ use App\Form\Model\SystemConfiguration;
use Symfony\Contracts\EventDispatcher\Event;
/**
* This event should be used, if system configurations should be changed/added dynamically.
* Adjust system configurations dynamically.
*/
final class SystemConfigurationEvent extends Event
{
@@ -32,10 +32,6 @@ final class SystemConfigurationEvent extends Event
return $this->configurations;
}
/**
* @param SystemConfiguration $configuration
* @return SystemConfigurationEvent
*/
public function addConfiguration(SystemConfiguration $configuration): SystemConfigurationEvent
{
$this->configurations[] = $configuration;

View File

@@ -9,6 +9,9 @@
namespace App\Event;
use App\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'timesheet.created', description: 'Triggered after a timesheet was created', payload: 'object.getTimesheet()')]
final class TimesheetCreatePostEvent extends AbstractTimesheetEvent
{
}

View File

@@ -9,6 +9,9 @@
namespace App\Event;
use App\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'timesheet.stopped', description: 'Triggered after a timesheet was stopped', payload: 'object.getTimesheet()')]
final class TimesheetStopPostEvent extends AbstractTimesheetEvent
{
}

View File

@@ -9,6 +9,9 @@
namespace App\Event;
use App\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'timesheet.updated', description: 'Triggered after a timesheet was updated', payload: 'object.getTimesheet()')]
final class TimesheetUpdatePostEvent extends AbstractTimesheetEvent
{
}

View File

@@ -9,9 +9,9 @@
namespace App\Event;
/**
* Triggered for new user instances, which were just saved.
*/
use App\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'user.created', description: 'Triggered after a user was created', payload: 'object.getUser()')]
final class UserCreatePostEvent extends AbstractUserEvent
{
}

View File

@@ -9,9 +9,9 @@
namespace App\Event;
/**
* Triggered for user instances which were just deleted.
*/
use App\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'user.deleted', description: 'Triggered after a user was deleted', payload: 'object.getUser()')]
final class UserDeletePostEvent extends UserDeleteEvent
{
}

View File

@@ -9,9 +9,9 @@
namespace App\Event;
/**
* Triggered for user instances, which were just updated.
*/
use App\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'user.updated', description: 'Triggered after a user was updated', payload: 'object.getUser()')]
final class UserUpdatePostEvent extends AbstractUserEvent
{
}