Skip to content

Commit 0d4e2db

Browse files
committed
Fix some of the build
1 parent f3be7a4 commit 0d4e2db

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+154
-491
lines changed

.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,5 @@
1414
/infection.json.dist export-ignore
1515
/node_modules export-ignore
1616
/phpunit.xml.dist export-ignore
17-
/psalm-baseline.xml export-ignore
18-
/psalm.xml export-ignore
1917
/rector.php export-ignore
2018
/tests export-ignore

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
/.phpunit.result.cache
99

10+
/.claude/*.local.json
11+
1012
# Symfony CLI https://symfony.com/doc/current/setup/symfony_server.html#different-php-settings-per-project
1113
/.php-version
1214
/php.ini

phpstan.neon

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ parameters:
2626

2727
ignoreErrors:
2828
-
29-
identifier: missingType.iterableValue
29+
identifiers:
30+
- missingType.iterableValue
31+
- doctrine.associationType
32+
- doctrine.columnType
33+
- missingType.generics
3034
-
31-
identifier: doctrine.associationType
32-
-
33-
identifier: doctrine.columnType
34-
-
35-
identifier: missingType.generics
36-
path: src/Form
35+
identifier: class.notFound
36+
message: '#League\\Flysystem\\#'

rector.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,9 @@
2222
$rectorConfig->sets([
2323
LevelSetList::UP_TO_PHP_81,
2424
]);
25+
26+
$rectorConfig->skip([
27+
\Rector\Php81\Rector\Class_\SpatieEnumClassToEnumRector::class,
28+
\Rector\Php81\Rector\MethodCall\SpatieEnumMethodCallToEnumConstRector::class,
29+
]);
2530
};

src/Command/ProcessFeedsCommand.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,9 @@ final class ProcessFeedsCommand extends Command
1414
{
1515
protected static $defaultName = 'setono:sylius-feed:process';
1616

17-
private FeedProcessorInterface $feedProcessor;
18-
19-
public function __construct(FeedProcessorInterface $feedProcessor)
17+
public function __construct(private readonly FeedProcessorInterface $feedProcessor)
2018
{
2119
parent::__construct();
22-
23-
$this->feedProcessor = $feedProcessor;
2420
}
2521

2622
protected function configure(): void

src/Controller/Action/Admin/ProcessFeedAction.php

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,14 @@
1313
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
1414
use Symfony\Contracts\Translation\TranslatorInterface;
1515

16-
/**
17-
* @psalm-suppress UndefinedClass
18-
* @psalm-suppress MixedArgument
19-
* @psalm-suppress UndefinedInterfaceMethod
20-
* @psalm-suppress MixedAssignment
21-
*/
2216
final class ProcessFeedAction
2317
{
24-
private MessageBusInterface $commandBus;
25-
26-
private UrlGeneratorInterface $urlGenerator;
27-
28-
private FlashBagInterface|RequestStack $flashBag;
29-
30-
private TranslatorInterface $translator;
31-
3218
public function __construct(
33-
MessageBusInterface $commandBus,
34-
UrlGeneratorInterface $urlGenerator,
35-
FlashBagInterface|RequestStack $requestStackOrFlashBag,
36-
TranslatorInterface $translator,
19+
private readonly MessageBusInterface $commandBus,
20+
private readonly UrlGeneratorInterface $urlGenerator,
21+
private readonly FlashBagInterface|RequestStack $flashBag,
22+
private readonly TranslatorInterface $translator,
3723
) {
38-
$this->commandBus = $commandBus;
39-
$this->urlGenerator = $urlGenerator;
40-
$this->flashBag = $requestStackOrFlashBag;
41-
$this->translator = $translator;
4224
}
4325

4426
public function __invoke(int $id): RedirectResponse

src/Controller/Action/Admin/SeverityCountAction.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,10 @@
1010

1111
final class SeverityCountAction
1212
{
13-
private ViolationRepositoryInterface $violationRepository;
14-
15-
private Environment $twig;
16-
17-
public function __construct(ViolationRepositoryInterface $violationRepository, Environment $twig)
18-
{
19-
$this->violationRepository = $violationRepository;
20-
$this->twig = $twig;
13+
public function __construct(
14+
private readonly ViolationRepositoryInterface $violationRepository,
15+
private readonly Environment $twig,
16+
) {
2117
}
2218

2319
public function __invoke(int $feed = null): Response

src/Controller/Action/Shop/ShowFeedAction.php

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,22 @@
1616
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
1717
use Symfony\Component\Mime\MimeTypesInterface;
1818

19-
/**
20-
* @psalm-suppress UndefinedDocblockClass
21-
* @psalm-suppress UndefinedClass
22-
*/
2319
final class ShowFeedAction
2420
{
25-
private FeedRepositoryInterface $repository;
26-
27-
private ChannelContextInterface $channelContext;
28-
29-
private LocaleContextInterface $localeContext;
30-
31-
private FeedPathGeneratorInterface $feedPathGenerator;
32-
3321
/** @var FilesystemInterface|FilesystemOperator */
3422
private $filesystem;
3523

36-
private MimeTypesInterface $mimeTypes;
37-
3824
/**
39-
* @psalm-suppress UndefinedDocblockClass
40-
*
4125
* @param FilesystemInterface|FilesystemOperator $filesystem
4226
*/
4327
public function __construct(
44-
FeedRepositoryInterface $repository,
45-
ChannelContextInterface $channelContext,
46-
LocaleContextInterface $localeContext,
47-
FeedPathGeneratorInterface $feedPathGenerator,
28+
private readonly FeedRepositoryInterface $repository,
29+
private readonly ChannelContextInterface $channelContext,
30+
private readonly LocaleContextInterface $localeContext,
31+
private readonly FeedPathGeneratorInterface $feedPathGenerator,
4832
$filesystem,
49-
MimeTypesInterface $mimeTypes,
33+
private readonly MimeTypesInterface $mimeTypes,
5034
) {
51-
$this->repository = $repository;
52-
$this->channelContext = $channelContext;
53-
$this->localeContext = $localeContext;
54-
$this->feedPathGenerator = $feedPathGenerator;
5535
if (interface_exists(FilesystemInterface::class) && $filesystem instanceof FilesystemInterface) {
5636
$this->filesystem = $filesystem;
5737
} elseif ($filesystem instanceof FilesystemOperator) {
@@ -63,7 +43,6 @@ public function __construct(
6343
FilesystemOperator::class,
6444
));
6545
}
66-
$this->mimeTypes = $mimeTypes;
6746
}
6847

6948
public function __invoke(string $code): StreamedResponse

src/DTO/SeverityCount.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@
66

77
final class SeverityCount
88
{
9-
private string $severity;
10-
11-
private int $count;
12-
13-
public function __construct(string $severity, int $count)
9+
public function __construct(private readonly string $severity, private readonly int $count)
1410
{
15-
$this->severity = $severity;
16-
$this->count = $count;
1711
}
1812

1913
public function getSeverity(): string

src/DataProvider/DataProvider.php

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,17 @@
2020

2121
class DataProvider implements DataProviderInterface
2222
{
23-
private BatcherFactoryInterface $batcherFactory;
24-
25-
private QueryRebuilderInterface $queryRebuilder;
26-
27-
private EventDispatcherInterface $eventDispatcher;
28-
29-
private ManagerRegistry $managerRegistry;
30-
31-
private string $class;
32-
3323
/** @var CollectionBatcherInterface[] */
3424
private array $batchers = [];
3525

36-
private int $batchSize;
37-
3826
public function __construct(
39-
BatcherFactoryInterface $batcherFactory,
40-
QueryRebuilderInterface $queryRebuilder,
41-
EventDispatcherInterface $eventDispatcher,
42-
ManagerRegistry $managerRegistry,
43-
string $class,
44-
int $batchSize = 100,
27+
private readonly BatcherFactoryInterface $batcherFactory,
28+
private readonly QueryRebuilderInterface $queryRebuilder,
29+
private readonly EventDispatcherInterface $eventDispatcher,
30+
private readonly ManagerRegistry $managerRegistry,
31+
private readonly string $class,
32+
private readonly int $batchSize = 100,
4533
) {
46-
$this->batcherFactory = $batcherFactory;
47-
$this->queryRebuilder = $queryRebuilder;
48-
$this->eventDispatcher = $eventDispatcher;
49-
$this->managerRegistry = $managerRegistry;
50-
$this->class = $class;
51-
$this->batchSize = $batchSize;
5234
}
5335

5436
public function getClass(): string
@@ -69,10 +51,8 @@ public function getBatchCount(ChannelInterface $channel, LocaleInterface $locale
6951
return $this->getBatcher($channel, $locale)->getBatchCount($this->batchSize);
7052
}
7153

72-
/** @psalm-suppress MixedReturnTypeCoercion */
7354
public function getItems(BatchInterface $batch): iterable
7455
{
75-
/** @psalm-suppress MixedReturnTypeCoercion */
7656
return $this->queryRebuilder->rebuild($batch)->getResult();
7757
}
7858

0 commit comments

Comments
 (0)