Skip to content

Commit a1a0c17

Browse files
committed
Remove API property
1 parent 4f90650 commit a1a0c17

File tree

4 files changed

+1
-31
lines changed

4 files changed

+1
-31
lines changed

src/Command/Generator.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,6 @@ public function getLabel(): string {
216216
return $this->label;
217217
}
218218

219-
/**
220-
* {@inheritdoc}
221-
*/
222-
public static function getApi(): int {
223-
return static::$api ?? 1;
224-
}
225-
226219
/**
227220
* Asks a question.
228221
*

src/Command/GeneratorInterface.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,4 @@ interface GeneratorInterface {
1212
*/
1313
public function getLabel(): string;
1414

15-
/**
16-
* Returns supported API version.
17-
*/
18-
public static function getApi(): int;
19-
2015
}

src/GeneratorFactory.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ public function __construct(ClassResolverInterface $class_resolver, LoggerInterf
3030
* Directories to look up for commands.
3131
* @param string $namespace
3232
* The namespace to filter out commands.
33-
* @param int|null $required_api
34-
* (Optional) API version to check.
3533
*
3634
* @return \Symfony\Component\Console\Command\Command[]
3735
* Array of generators.
3836
*/
39-
public function getGenerators(array $directories, string $namespace, ?int $required_api = NULL): array {
37+
public function getGenerators(array $directories, string $namespace): array {
4038
$commands = [];
4139

4240
foreach ($directories as $directory) {
@@ -68,15 +66,6 @@ public function getGenerators(array $directories, string $namespace, ?int $requi
6866
continue;
6967
}
7068

71-
/* @noinspection PhpUndefinedMethodInspection */
72-
if ($required_api && $class::getApi() !== $required_api) {
73-
$this->logger->notice(
74-
'Class {class} does not support required API version {required_api}.',
75-
['class' => $class, 'required_api' => $required_api],
76-
);
77-
continue;
78-
}
79-
8069
$commands[] = $this->classResolver->getInstance($class);
8170
}
8271
}

tests/dcg/ValidatorTraitTest.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ public function getLabel(): string {
3232
return '';
3333
}
3434

35-
/**
36-
* {@inheritdoc}
37-
*/
38-
public static function getApi(): int {
39-
return 2;
40-
}
41-
4235
};
4336
}
4437

0 commit comments

Comments
 (0)