Skip to content

Commit

Permalink
Apply php-cs-fixer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcop1 authored and github-actions[bot] committed Jan 9, 2025
1 parent 66362b2 commit 7ca8fcf
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/CustomReport/Controller/CollectionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function getCustomReports(): JsonResponse
{
return $this->jsonResponse(
[
'items' => $this->customReportService->loadForCurrentUser()
'items' => $this->customReportService->loadForCurrentUser(),
]
);
}
Expand Down
8 changes: 2 additions & 6 deletions src/CustomReport/Hydrator/CustomReportHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 1 addition & 4 deletions src/CustomReport/Hydrator/CustomReportHydratorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
12 changes: 6 additions & 6 deletions src/CustomReport/Repository/CustomReportRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,30 @@
use Pimcore\Bundle\StudioBackendBundle\Security\Service\SecurityServiceInterface;
use Pimcore\Model\User;


/**
* @internal
*/
final readonly class CustomReportRepository implements CustomReportRepositoryInterface
{
public function __construct(
private SecurityServiceInterface $securityService
)
{
) {
}

public function loadForUser(User $user): array {
public function loadForUser(User $user): array
{
return (new Listing())->getDao()->loadForGivenUser(

Check failure on line 35 in src/CustomReport/Repository/CustomReportRepository.php

View workflow job for this annotation

GitHub Actions / static-analysis (8.3, highest, 11.x-dev as 11.99.9, true) / Static analysis with phpstan

Call to method loadForGivenUser() on an unknown class Pimcore\Bundle\CustomreportsBundle\Tool\Config\Listing\Dao.

Check failure on line 35 in src/CustomReport/Repository/CustomReportRepository.php

View workflow job for this annotation

GitHub Actions / static-analysis (8.3, highest, false) / Static analysis with phpstan

Call to method loadForGivenUser() on an unknown class Pimcore\Bundle\CustomreportsBundle\Tool\Config\Listing\Dao.

Check failure on line 35 in src/CustomReport/Repository/CustomReportRepository.php

View workflow job for this annotation

GitHub Actions / static-analysis (8.2, lowest, false) / Static analysis with phpstan

Call to method loadForGivenUser() on an unknown class Pimcore\Bundle\CustomreportsBundle\Tool\Config\Listing\Dao.
$user
);
}

public function loadForCurrentUser(): array {
public function loadForCurrentUser(): array
{
/** @var User $currentUser */
$currentUser = $this->securityService->getCurrentUser();

return $this->loadForUser(
$currentUser
$currentUser
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* @license http://www.pimcore.org/license GPLv3 and PCL
*/


namespace Pimcore\Bundle\StudioBackendBundle\CustomReport\Repository;

use Pimcore\Model\User;
Expand All @@ -25,6 +24,6 @@
interface CustomReportRepositoryInterface
{
public function loadForUser(User $user): array;
public function loadForCurrentUser(): array;

}
public function loadForCurrentUser(): array;
}
2 changes: 1 addition & 1 deletion src/CustomReport/Schema/CustomReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -51,6 +50,7 @@ public function __construct(
) {

}

public function getName(): string
{
return $this->name;
Expand Down
11 changes: 3 additions & 8 deletions src/CustomReport/Service/CustomReportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
);
Expand Down
5 changes: 1 addition & 4 deletions src/CustomReport/Service/CustomReportServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 7ca8fcf

Please sign in to comment.