Skip to content

Commit 95c3d75

Browse files
enabled new coding standards to enforce strict types (#4396)
2 parents 02a0c26 + 1735ea5 commit 95c3d75

38 files changed

Lines changed: 6 additions & 366 deletions

src/Application.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ public function __construct()
3737
]);
3838
}
3939

40-
/**
41-
* @return \Symfony\Component\DependencyInjection\ContainerBuilder
42-
*/
4340
private function buildContainer(): ContainerBuilder
4441
{
4542
$container = new ContainerBuilder();

src/Command/ConfigureCommand.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ class ConfigureCommand extends Command
3030
private const string OPTION_MODIFICATIONS = 'modifications';
3131
private const string ARGUMENT_PATH = 'path';
3232

33-
/**
34-
* @param \Shopsys\Cli\Worker\WorkerRunner $workerRunner
35-
* @param \Shopsys\Cli\Input\InteractiveInputCollector $interactiveInputCollector
36-
* @param \Shopsys\Cli\Input\YamlConfigLoader $yamlConfigLoader
37-
*/
3833
public function __construct(
3934
private readonly WorkerRunner $workerRunner,
4035
private readonly InteractiveInputCollector $interactiveInputCollector,
@@ -83,11 +78,6 @@ protected function configure(): void
8378
);
8479
}
8580

86-
/**
87-
* @param \Symfony\Component\Console\Input\InputInterface $input
88-
* @param \Symfony\Component\Console\Output\OutputInterface $output
89-
* @return int
90-
*/
9181
#[Override]
9282
protected function execute(InputInterface $input, OutputInterface $output): int
9383
{
@@ -128,7 +118,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
128118
$results = $this->workerRunner->run(
129119
$config,
130120
$projectPath,
131-
function (WorkerInterface $worker, WorkerResult $result) use ($io, $input) {
121+
function (WorkerInterface $worker, WorkerResult $result) use ($io, $input): void {
132122
if ($result->success) {
133123
$io->section(sprintf('<fg=green>✓</> %s', $result->message));
134124

@@ -170,7 +160,6 @@ function (WorkerInterface $worker, WorkerResult $result) use ($io, $input) {
170160
}
171161

172162
/**
173-
* @param \Symfony\Component\Console\Style\SymfonyStyle $io
174163
* @param array<\Shopsys\Cli\Worker\WorkerResult> $results
175164
*/
176165
private function displayHints(SymfonyStyle $io, array $results): void
@@ -185,9 +174,6 @@ private function displayHints(SymfonyStyle $io, array $results): void
185174
$io->listing($hints);
186175
}
187176

188-
/**
189-
* @param \Symfony\Component\Console\Style\SymfonyStyle $io
190-
*/
191177
private function displayNextSteps(SymfonyStyle $io): void
192178
{
193179
$io->writeln('<info>Next steps:</info>');

src/Command/InitCommand.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ class InitCommand extends Command
2929
private const string OPTION_CONFIG = 'config';
3030
private const string BRANCH_STABLE = 'stable';
3131

32-
/**
33-
* @param \Shopsys\Cli\Model\GitHandler $gitHandler
34-
*/
3532
public function __construct(
3633
private readonly GitHandler $gitHandler,
3734
) {
@@ -83,11 +80,6 @@ protected function configure(): void
8380
);
8481
}
8582

86-
/**
87-
* @param \Symfony\Component\Console\Input\InputInterface $input
88-
* @param \Symfony\Component\Console\Output\OutputInterface $output
89-
* @return int
90-
*/
9183
#[Override]
9284
protected function execute(InputInterface $input, OutputInterface $output): int
9385
{
@@ -119,7 +111,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
119111
self::REPOSITORY_URL,
120112
$projectName,
121113
$branch,
122-
function ($type, $buffer) use ($io) {
114+
function ($type, $buffer) use ($io): void {
123115
$io->write($buffer);
124116
},
125117
);
@@ -144,10 +136,6 @@ function ($type, $buffer) use ($io) {
144136
return $this->getApplication()?->doRun(new ArrayInput($configureCommandParameters), $output);
145137
}
146138

147-
/**
148-
* @param string $branch
149-
* @return string
150-
*/
151139
private function resolveReference(string $branch): string
152140
{
153141
if ($branch === self::BRANCH_STABLE) {

src/Command/ListWorkersCommand.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,12 @@
2020
)]
2121
final class ListWorkersCommand extends Command
2222
{
23-
/**
24-
* @param \Shopsys\Cli\Worker\WorkerRunner $workerRunner
25-
*/
2623
public function __construct(
2724
private readonly WorkerRunner $workerRunner,
2825
) {
2926
parent::__construct();
3027
}
3128

32-
/**
33-
* @param \Symfony\Component\Console\Input\InputInterface $input
34-
* @param \Symfony\Component\Console\Output\OutputInterface $output
35-
* @return int
36-
*/
3729
#[Override]
3830
protected function execute(InputInterface $input, OutputInterface $output): int
3931
{
@@ -65,7 +57,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6557

6658
/**
6759
* @param array<\Shopsys\Cli\Worker\WorkerInterface> $workers
68-
* @param string $type
6960
* @return array<int, array<int, string>>
7061
*/
7162
private function getWorkersInfo(array $workers, string $type): array

src/Config/ConfigSectionInterface.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@ interface ConfigSectionInterface
88
{
99
/**
1010
* Unique key for YAML mapping (e.g., 'map_settings')
11-
*
12-
* @return string
1311
*/
1412
public static function getKey(): string;
1513

1614
/**
1715
* Order for interactive questions (higher = earlier)
18-
*
19-
* @return int
2016
*/
2117
public static function getPriority(): int;
2218

src/Config/ConfigSectionRegistry.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88

99
final class ConfigSectionRegistry
1010
{
11-
/**
12-
* @param \Symfony\Component\DependencyInjection\ServiceLocator $domainConfigSections
13-
* @param \Symfony\Component\DependencyInjection\ServiceLocator $projectConfigSections
14-
*/
1511
public function __construct(
1612
private readonly ServiceLocator $domainConfigSections,
1713
private readonly ServiceLocator $projectConfigSections,
@@ -41,7 +37,6 @@ public function getProjectConfigSections(): array
4137
}
4238

4339
/**
44-
* @param \Symfony\Component\DependencyInjection\ServiceLocator $configSectionLocator
4540
* @return \Shopsys\Cli\Config\ConfigSectionInterface[]
4641
*/
4742
private function getConfigSectionsBySectionLocator(ServiceLocator $configSectionLocator): array

src/Config/CoreDomainConfig.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,6 @@ final class CoreDomainConfig
1313
*/
1414
private array $configSections = [];
1515

16-
/**
17-
* @param int $id
18-
* @param string $name
19-
* @param string $locale
20-
* @param string $timezone
21-
* @param string $type
22-
* @param string $currencyCode
23-
* @param bool $loadDemoData
24-
*/
2516
public function __construct(
2617
public readonly int $id,
2718
public readonly string $name,
@@ -35,8 +26,6 @@ public function __construct(
3526

3627
/**
3728
* @param array<string, mixed> $data
38-
* @param \Shopsys\Cli\Config\ConfigSectionRegistry|null $registry
39-
* @return self
4029
*/
4130
public static function fromArray(array $data, ?ConfigSectionRegistry $registry = null): self
4231
{
@@ -94,9 +83,6 @@ public function getConfigSection(string $sectionClass): ConfigSectionInterface
9483
return $this->configSections[$sectionClass] ?? throw new LogicException(sprintf('Unknown section class: %s', $sectionClass));
9584
}
9685

97-
/**
98-
* @param \Shopsys\Cli\Config\ConfigSectionInterface $section
99-
*/
10086
public function addConfigSection(ConfigSectionInterface $section): void
10187
{
10288
$this->configSections[$section::class] = $section;

src/Config/CoreDomainConfigValidator.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ final class CoreDomainConfigValidator
1515
*/
1616
public const array SUPPORTED_DOMAIN_TYPES = ['b2c', 'b2b'];
1717

18-
/**
19-
* @param string $value
20-
* @return string
21-
*/
2218
public static function validateDomainName(string $value): string
2319
{
2420
if (trim($value) === '') {
@@ -28,10 +24,6 @@ public static function validateDomainName(string $value): string
2824
return $value;
2925
}
3026

31-
/**
32-
* @param string $value
33-
* @return string
34-
*/
3527
public static function validateLocale(string $value): string
3628
{
3729
if (mb_strlen(trim($value)) !== 2) {
@@ -41,10 +33,6 @@ public static function validateLocale(string $value): string
4133
return strtolower($value);
4234
}
4335

44-
/**
45-
* @param string $value
46-
* @return string
47-
*/
4836
public static function validateTimeZone(string $value): string
4937
{
5038
try {
@@ -56,10 +44,6 @@ public static function validateTimeZone(string $value): string
5644
return $value;
5745
}
5846

59-
/**
60-
* @param string $value
61-
* @return string
62-
*/
6347
public static function validateDomainType(string $value): string
6448
{
6549
if (!in_array($value, self::SUPPORTED_DOMAIN_TYPES, true)) {
@@ -73,10 +57,6 @@ public static function validateDomainType(string $value): string
7357
return $value;
7458
}
7559

76-
/**
77-
* @param string $value
78-
* @return string
79-
*/
8060
public static function validateCurrencyCode(string $value): string
8161
{
8262
if (!preg_match('/^[A-Za-z]{3}$/', $value)) {

src/Config/CoreProjectConfig.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ final class CoreProjectConfig
1414
private array $sections = [];
1515

1616
/**
17-
* @param string $projectPath
1817
* @param array<\Shopsys\Cli\Config\CoreDomainConfig> $domains
1918
*/
2019
public function __construct(
@@ -65,9 +64,6 @@ public function getAllDomainIds(): array
6564

6665
/**
6766
* @param array<string, mixed> $data
68-
* @param string $projectPath
69-
* @param \Shopsys\Cli\Config\ConfigSectionRegistry|null $registry
70-
* @return self
7167
*/
7268
public static function fromArray(array $data, string $projectPath, ?ConfigSectionRegistry $registry = null): self
7369
{
@@ -125,9 +121,6 @@ public function getConfigSection(string $sectionClass): ConfigSectionInterface
125121
return $this->sections[$sectionClass] ?? throw new LogicException(sprintf('Unknown section class: %s', $sectionClass));
126122
}
127123

128-
/**
129-
* @param \Shopsys\Cli\Config\ConfigSectionInterface $section
130-
*/
131124
public function addConfigSection(ConfigSectionInterface $section): void
132125
{
133126
$this->sections[$section::class] = $section;

src/Config/DomainConfigSectionInterface.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ interface DomainConfigSectionInterface extends ConfigSectionInterface
1010
{
1111
/**
1212
* Collect values interactively
13-
*
14-
* @param \Symfony\Component\Console\Style\SymfonyStyle $io
15-
* @param int $domainId
1613
*/
1714
public function collectInteractive(SymfonyStyle $io, int $domainId): void;
1815
}

0 commit comments

Comments
 (0)