Skip to content

Commit ac0dbe7

Browse files
committed
Fix the build
1 parent 1bbbaeb commit ac0dbe7

Some content is hidden

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

47 files changed

+134
-500
lines changed

composer-dependency-analyser.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@
44

55
return (new Configuration())
66
->addPathToExclude(__DIR__ . '/tests')
7+
->ignoreUnknownClasses([
8+
League\Flysystem\FileNotFoundException::class,
9+
League\Flysystem\FilesystemInterface::class,
10+
League\Flysystem\RootViolationException::class,
11+
])
712
;

composer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@
1818
"setono/doctrine-orm-batcher": "^0.6",
1919
"setono/doctrine-orm-batcher-bundle": "^0.3.4",
2020
"spatie/enum": "^3.7",
21+
"sylius/channel": "^1.0",
22+
"sylius/channel-bundle": "^1.0",
23+
"sylius/core": "^1.0",
24+
"sylius/core-bundle": "^1.0",
25+
"sylius/inventory": "^1.0",
26+
"sylius/locale": "^1.0",
2127
"sylius/resource-bundle": "^1.6",
28+
"sylius/ui-bundle": "^1.0",
2229
"symfony/config": "^6.4 || ^7.4",
2330
"symfony/console": "^6.4 || ^7.4",
2431
"symfony/dependency-injection": "^6.4 || ^7.4",
2532
"symfony/event-dispatcher": "^6.4 || ^7.4",
26-
"symfony/event-dispatcher-contracts": "^1.1 || ^2.2 || ^3.0",
2733
"symfony/form": "^6.4 || ^7.4",
2834
"symfony/http-foundation": "^6.4 || ^7.4",
2935
"symfony/http-kernel": "^6.4 || ^7.4",

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: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,11 @@
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-
38-
public function __construct(
39-
BatcherFactoryInterface $batcherFactory,
40-
QueryRebuilderInterface $queryRebuilder,
41-
EventDispatcherInterface $eventDispatcher,
42-
ManagerRegistry $managerRegistry,
43-
string $class,
44-
int $batchSize = 100,
45-
) {
46-
$this->batcherFactory = $batcherFactory;
47-
$this->queryRebuilder = $queryRebuilder;
48-
$this->eventDispatcher = $eventDispatcher;
49-
$this->managerRegistry = $managerRegistry;
50-
$this->class = $class;
51-
$this->batchSize = $batchSize;
26+
public function __construct(private readonly BatcherFactoryInterface $batcherFactory, private readonly QueryRebuilderInterface $queryRebuilder, private readonly EventDispatcherInterface $eventDispatcher, private readonly ManagerRegistry $managerRegistry, private readonly string $class, private readonly int $batchSize = 100)
27+
{
5228
}
5329

5430
public function getClass(): string
@@ -69,10 +45,10 @@ public function getBatchCount(ChannelInterface $channel, LocaleInterface $locale
6945
return $this->getBatcher($channel, $locale)->getBatchCount($this->batchSize);
7046
}
7147

72-
/** @psalm-suppress MixedReturnTypeCoercion */
48+
/**
7349
public function getItems(BatchInterface $batch): iterable
7450
{
75-
/** @psalm-suppress MixedReturnTypeCoercion */
51+
/**
7652
return $this->queryRebuilder->rebuild($batch)->getResult();
7753
}
7854

src/DependencyInjection/Configuration.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919

2020
final class Configuration implements ConfigurationInterface
2121
{
22-
/**
23-
* @psalm-suppress MixedMethodCall
24-
* @psalm-suppress UndefinedInterfaceMethod
25-
*/
2622
public function getConfigTreeBuilder(): TreeBuilder
2723
{
2824
$treeBuilder = new TreeBuilder('setono_sylius_feed');
@@ -56,9 +52,6 @@ public function getConfigTreeBuilder(): TreeBuilder
5652
return $treeBuilder;
5753
}
5854

59-
/**
60-
* @psalm-suppress MixedMethodCall, UndefinedInterfaceMethod
61-
*/
6255
private function addResourcesSection(ArrayNodeDefinition $node): void
6356
{
6457
$node

src/Event/BatchGeneratedEvent.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@
88

99
final class BatchGeneratedEvent
1010
{
11-
private FeedInterface $feed;
12-
13-
public function __construct(FeedInterface $feed)
11+
public function __construct(private readonly FeedInterface $feed)
1412
{
15-
$this->feed = $feed;
1613
}
1714

1815
public function getFeed(): FeedInterface

0 commit comments

Comments
 (0)