Skip to content

Commit 6a7e286

Browse files
committed
Remove deprecated classes
1 parent a2bd7e4 commit 6a7e286

File tree

6 files changed

+20
-203
lines changed

6 files changed

+20
-203
lines changed

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ All notable changes to this project will be documented in this file, in reverse
1414

1515
### Removed
1616

17-
* Nothing
17+
The following classes are removed (deprecated in 0.2.0).
18+
19+
* Class `\OpenCodeModeling\CodeGenerator\Config\ArrayConfig`
20+
* Class `\OpenCodeModeling\CodeGenerator\Config\Component`
21+
* Class `\OpenCodeModeling\CodeGenerator\Config\ComponentCollection`
22+
* Class `\OpenCodeModeling\CodeGenerator\Config\ComponentList`
1823

1924
### Fixed
2025

src/Config/ArrayConfig.php

-57
This file was deleted.

src/Config/Component.php

-26
This file was deleted.

src/Config/ComponentCollection.php

-18
This file was deleted.

src/Config/ComponentList.php

-80
This file was deleted.

src/Console/WorkflowCommand.php

+14-21
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@
1010

1111
namespace OpenCodeModeling\CodeGenerator\Console;
1212

13-
use OpenCodeModeling\CodeGenerator\Config\Component;
14-
use OpenCodeModeling\CodeGenerator\Config\ComponentCollection;
15-
use OpenCodeModeling\CodeGenerator\Config\Config;
16-
use OpenCodeModeling\CodeGenerator\Config\WorkflowCollection;
13+
use OpenCodeModeling\CodeGenerator\Config;
1714
use OpenCodeModeling\CodeGenerator\Config\WorkflowConfig;
15+
use OpenCodeModeling\CodeGenerator\Console;
1816
use OpenCodeModeling\CodeGenerator\Exception\RuntimeException;
1917
use OpenCodeModeling\CodeGenerator\Workflow\WorkflowContext;
2018
use OpenCodeModeling\CodeGenerator\Workflow\WorkflowEngine;
@@ -27,49 +25,44 @@
2725
*/
2826
final class WorkflowCommand extends Command
2927
{
30-
protected function configure()
28+
protected function configure(): void
3129
{
3230
$this
3331
->setName('ocmcg:workflow:run')
3432
->setDescription('Executes workflow from configuration file to generate code');
3533
}
3634

37-
protected function execute(InputInterface $input, OutputInterface $output)
35+
protected function execute(InputInterface $input, OutputInterface $output): int
3836
{
3937
/** @var WorkflowContext $workflowContext */
40-
$workflowContext = $this->getHelper(\OpenCodeModeling\CodeGenerator\Console\WorkflowContext::class)->context();
38+
$workflowContext = $this->getHelper(Console\WorkflowContext::class)->context();
4139

4240
$config = $this->loadConfig($workflowContext);
4341

44-
if ($config instanceof WorkflowConfig
45-
|| $config instanceof Component
46-
) {
42+
if ($config instanceof Config\WorkflowConfig) {
4743
$this->executeWorkflow($config, $workflowContext);
48-
} elseif ($config instanceof WorkflowCollection
49-
|| $config instanceof ComponentCollection
50-
) {
44+
} elseif ($config instanceof Config\WorkflowCollection) {
5145
foreach ($config as $workflowConfig) {
5246
$this->executeWorkflow($workflowConfig, $workflowContext);
5347
}
5448
} else {
5549
throw new RuntimeException(
56-
\sprintf('$config must implement %s or %s', WorkflowConfig::class, WorkflowCollection::class)
50+
\sprintf(
51+
'$config must implement %s or %s', Config\WorkflowConfig::class,
52+
Config\WorkflowCollection::class
53+
)
5754
);
5855
}
5956

6057
return 0;
6158
}
6259

63-
private function loadConfig(WorkflowContext $workflowContext): Config
60+
private function loadConfig(WorkflowContext $workflowContext): Config\Config
6461
{
65-
return $this->getHelper(\OpenCodeModeling\CodeGenerator\Console\Config::class)->resolver()->resolve($workflowContext);
62+
return $this->getHelper(Console\Config::class)->resolver()->resolve($workflowContext);
6663
}
6764

68-
/**
69-
* @param WorkflowConfig|Component $config
70-
* @param WorkflowContext $workflowContext
71-
*/
72-
private function executeWorkflow($config, WorkflowContext $workflowContext): void
65+
private function executeWorkflow(WorkflowConfig $config, WorkflowContext $workflowContext): void
7366
{
7467
$workflowEngine = new WorkflowEngine();
7568
$workflowEngine->run($workflowContext, ...$config->componentDescriptions());

0 commit comments

Comments
 (0)