Skip to content
Snippets Groups Projects
Commit abd80f28 authored by Daniel Kurowski's avatar Daniel Kurowski
Browse files

Allow definitions to be iterable

parent 0e782457
No related branches found
No related tags found
1 merge request!37Allow definitions to be iterable
Pipeline #33944 passed
......@@ -122,7 +122,7 @@ final class GenerateClassCommand extends Command
/**
* @return ClassDefinition[]
*/
private function loadDefinitions(string $definitionFile): array
private function loadDefinitions(string $definitionFile): iterable
{
$definitionFile = Path::canonicalize($definitionFile);
if ( ! \file_exists($definitionFile)) {
......@@ -133,7 +133,7 @@ final class GenerateClassCommand extends Command
}
$definitions = require $definitionFile;
if (!\is_array($definitions)) {
if ( ! \is_iterable($definitions)) {
$definitions = [$definitions];
}
foreach($definitions as $definition) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment