Skip to content

Commit e437e1b

Browse files
authored
enable dead code detection and remove dead code (#4744)
2 parents de18dd9 + 546fc66 commit e437e1b

8 files changed

Lines changed: 7 additions & 41 deletions

src/Command/ConfigureCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9494
$configFile = $input->getOption(self::OPTION_CONFIG);
9595

9696
if ($configFile !== null) {
97-
$config = $this->yamlConfigLoader->load($configFile, $projectPath);
97+
$config = $this->yamlConfigLoader->load($configFile);
9898
} else {
99-
$config = $this->interactiveInputCollector->collect($projectPath, $io);
99+
$config = $this->interactiveInputCollector->collect($io);
100100
}
101101
} catch (CancelledException) {
102102
$io->warning('Configuration cancelled by user.');

src/Config/ConfigSectionInterface.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ interface ConfigSectionInterface
1111
*/
1212
public static function getKey(): string;
1313

14-
/**
15-
* Order for interactive questions (higher = earlier)
16-
*/
17-
public static function getPriority(): int;
18-
1914
/**
2015
* Populate from parsed YAML/array data
2116
*

src/Config/CoreProjectConfig.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ final class CoreProjectConfig
1717
* @param array<\Shopsys\Cli\Config\CoreDomainConfig> $domains
1818
*/
1919
public function __construct(
20-
public readonly string $projectPath,
2120
public readonly array $domains = [],
2221
) {
2322
}
@@ -65,7 +64,7 @@ public function getAllDomainIds(): array
6564
/**
6665
* @param array<string, mixed> $data
6766
*/
68-
public static function fromArray(array $data, string $projectPath, ?ConfigSectionRegistry $registry = null): self
67+
public static function fromArray(array $data, ?ConfigSectionRegistry $registry = null): self
6968
{
7069
$domains = [];
7170

@@ -76,7 +75,6 @@ public static function fromArray(array $data, string $projectPath, ?ConfigSectio
7675
}
7776

7877
$projectConfig = new self(
79-
projectPath: $projectPath,
8078
domains: $domains,
8179
);
8280

src/Config/Section/MapSettingsSection.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ public static function getKey(): string
2626
return 'map_settings';
2727
}
2828

29-
/**
30-
* {@inheritdoc}
31-
*/
32-
#[Override]
33-
public static function getPriority(): int
34-
{
35-
return 50;
36-
}
37-
3829
/**
3930
* {@inheritdoc}
4031
*/

src/Config/Section/MetatagSiteNameSection.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ public static function getKey(): string
2222
return 'metatag_site_name';
2323
}
2424

25-
/**
26-
* {@inheritdoc}
27-
*/
28-
#[Override]
29-
public static function getPriority(): int
30-
{
31-
return 40;
32-
}
33-
3425
/**
3526
* {@inheritdoc}
3627
*/

src/Config/Section/SocialLoginSection.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,6 @@ public static function getKey(): string
2525
return 'social_login';
2626
}
2727

28-
/**
29-
* {@inheritdoc}
30-
*/
31-
#[Override]
32-
public static function getPriority(): int
33-
{
34-
return 30;
35-
}
36-
3728
/**
3829
* {@inheritdoc}
3930
*/

src/Input/InteractiveInputCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ public function __construct(
2020
) {
2121
}
2222

23-
public function collect(string $projectPath, SymfonyStyle $io): CoreProjectConfig
23+
public function collect(SymfonyStyle $io): CoreProjectConfig
2424
{
2525
$this->displayHeader($io);
2626

2727
$domains = $this->collectDomains($io);
2828

29-
$config = new CoreProjectConfig($projectPath, $domains);
29+
$config = new CoreProjectConfig($domains);
3030

3131
foreach ($this->registry->getProjectConfigSections() as $projectConfigSection) {
3232
$projectConfigSection->collectInteractive($io);

src/Input/YamlConfigLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function __construct(
1717
) {
1818
}
1919

20-
public function load(string $configPath, string $projectPath): CoreProjectConfig
20+
public function load(string $configPath): CoreProjectConfig
2121
{
2222
if (!file_exists($configPath)) {
2323
throw new InvalidArgumentException(sprintf('Configuration file not found: %s', $configPath));
@@ -39,6 +39,6 @@ public function load(string $configPath, string $projectPath): CoreProjectConfig
3939
throw new RuntimeException('At least one domain is required');
4040
}
4141

42-
return CoreProjectConfig::fromArray($data, $projectPath, $this->registry);
42+
return CoreProjectConfig::fromArray($data, $this->registry);
4343
}
4444
}

0 commit comments

Comments
 (0)