diff --git a/src/CustomReport/Controller/CollectionController.php b/src/CustomReport/Controller/CollectionController.php index 85c84a60..21b754b2 100644 --- a/src/CustomReport/Controller/CollectionController.php +++ b/src/CustomReport/Controller/CollectionController.php @@ -74,7 +74,7 @@ public function getCustomReports(): JsonResponse { return $this->jsonResponse( [ - 'items' => $this->customReportService->loadForCurrentUser() + 'items' => $this->customReportService->loadForCurrentUser(), ] ); } diff --git a/src/CustomReport/Hydrator/CustomReportHydrator.php b/src/CustomReport/Hydrator/CustomReportHydrator.php index ab18c624..77496796 100644 --- a/src/CustomReport/Hydrator/CustomReportHydrator.php +++ b/src/CustomReport/Hydrator/CustomReportHydrator.php @@ -16,17 +16,13 @@ namespace Pimcore\Bundle\StudioBackendBundle\CustomReport\Hydrator; -use Pimcore\Bundle\CustomReportsBundle\Tool\Config\Listing; -use Pimcore\Bundle\StudioBackendBundle\Security\Service\SecurityService; -use Pimcore\Model\User; - - /** * @internal */ final readonly class CustomReportHydrator implements CustomReportHydratorInterface { - public function hydrate(array $reports): array { + public function hydrate(array $reports): array + { $hydratedReports = []; foreach ($reports as $report) { diff --git a/src/CustomReport/Hydrator/CustomReportHydratorInterface.php b/src/CustomReport/Hydrator/CustomReportHydratorInterface.php index 2484a8ba..82b1d5aa 100644 --- a/src/CustomReport/Hydrator/CustomReportHydratorInterface.php +++ b/src/CustomReport/Hydrator/CustomReportHydratorInterface.php @@ -14,15 +14,12 @@ * @license http://www.pimcore.org/license GPLv3 and PCL */ - namespace Pimcore\Bundle\StudioBackendBundle\CustomReport\Hydrator; -use Pimcore\Model\User; - /** * @internal */ interface CustomReportHydratorInterface { public function hydrate(array $reports): array; -} \ No newline at end of file +} diff --git a/src/CustomReport/Repository/CustomReportRepository.php b/src/CustomReport/Repository/CustomReportRepository.php index 4a3d67e9..a4c8b5d3 100644 --- a/src/CustomReport/Repository/CustomReportRepository.php +++ b/src/CustomReport/Repository/CustomReportRepository.php @@ -21,7 +21,6 @@ use Pimcore\Bundle\StudioBackendBundle\Security\Service\SecurityServiceInterface; use Pimcore\Model\User; - /** * @internal */ @@ -29,8 +28,7 @@ { public function __construct( private SecurityServiceInterface $securityService - ) - { + ) { } public function loadForUser(User $user): array { @@ -41,12 +39,13 @@ public function loadForUser(User $user): array { ); } - public function loadForCurrentUser(): array { + public function loadForCurrentUser(): array + { /** @var User $currentUser */ $currentUser = $this->securityService->getCurrentUser(); return $this->loadForUser( - $currentUser + $currentUser ); } } diff --git a/src/CustomReport/Repository/CustomReportRepositoryInterface.php b/src/CustomReport/Repository/CustomReportRepositoryInterface.php index 009e7242..393149d8 100644 --- a/src/CustomReport/Repository/CustomReportRepositoryInterface.php +++ b/src/CustomReport/Repository/CustomReportRepositoryInterface.php @@ -14,7 +14,6 @@ * @license http://www.pimcore.org/license GPLv3 and PCL */ - namespace Pimcore\Bundle\StudioBackendBundle\CustomReport\Repository; use Pimcore\Model\User; @@ -25,6 +24,6 @@ interface CustomReportRepositoryInterface { public function loadForUser(User $user): array; - public function loadForCurrentUser(): array; -} \ No newline at end of file + public function loadForCurrentUser(): array; +} diff --git a/src/CustomReport/Schema/CustomReport.php b/src/CustomReport/Schema/CustomReport.php index 37a664da..a03d59ce 100644 --- a/src/CustomReport/Schema/CustomReport.php +++ b/src/CustomReport/Schema/CustomReport.php @@ -16,7 +16,6 @@ namespace Pimcore\Bundle\StudioBackendBundle\CustomReport\Schema; -use OpenApi\Attributes\Items; use OpenApi\Attributes\Property; use OpenApi\Attributes\Schema; use Pimcore\Bundle\StudioBackendBundle\Util\Schema\AdditionalAttributesInterface; @@ -51,6 +50,7 @@ public function __construct( ) { } + public function getName(): string { return $this->name; diff --git a/src/CustomReport/Service/CustomReportService.php b/src/CustomReport/Service/CustomReportService.php index f15625aa..4ac2b104 100644 --- a/src/CustomReport/Service/CustomReportService.php +++ b/src/CustomReport/Service/CustomReportService.php @@ -16,13 +16,8 @@ namespace Pimcore\Bundle\StudioBackendBundle\CustomReport\Service; -use Pimcore\Bundle\CustomReportsBundle\Tool\Config\Listing; -use Pimcore\Bundle\StudioBackendBundle\CustomReport\Hydrator\CustomReportHydrator; use Pimcore\Bundle\StudioBackendBundle\CustomReport\Hydrator\CustomReportHydratorInterface; use Pimcore\Bundle\StudioBackendBundle\CustomReport\Repository\CustomReportRepositoryInterface; -use Pimcore\Bundle\StudioBackendBundle\Security\Service\SecurityService; -use Pimcore\Model\User; - /** * @internal @@ -32,11 +27,11 @@ public function __construct( private CustomReportHydratorInterface $customReportHydrator, private CustomReportRepositoryInterface $customReportRepository, - ) - { + ) { } - public function loadForCurrentUser(): array { + public function loadForCurrentUser(): array + { return $this->customReportHydrator->hydrate( $this->customReportRepository->loadForCurrentUser() ); diff --git a/src/CustomReport/Service/CustomReportServiceInterface.php b/src/CustomReport/Service/CustomReportServiceInterface.php index 3e1d94eb..33727b01 100644 --- a/src/CustomReport/Service/CustomReportServiceInterface.php +++ b/src/CustomReport/Service/CustomReportServiceInterface.php @@ -14,15 +14,12 @@ * @license http://www.pimcore.org/license GPLv3 and PCL */ - namespace Pimcore\Bundle\StudioBackendBundle\CustomReport\Service; -use Pimcore\Model\User; - /** * @internal */ interface CustomReportServiceInterface { public function loadForCurrentUser(): array; -} \ No newline at end of file +}