Code Duplication    Length = 5-6 lines in 2 locations

src/Scaffolder/Compilers/Core/MigrationCompiler.php 1 location

@@ 113-117 (lines=5) @@
110
			{
111
				if ($field->type->db == "enum") {
112
					$items = '';
113
					foreach ($field->options as $key => $option) {
114
						$items .= "'" . $option . "'";
115
						if ($key < (count($field->options) - 1))
116
							$items .= ", ";
117
					}
118
119
					$fields .= sprintf("\t\t\t\$table->%s('%s', array(%s));" . PHP_EOL, $field->type->db, $field->name, $items);
120
				}

src/Scaffolder/Compilers/Core/ModelCompiler.php 1 location

@@ 128-133 (lines=6) @@
125
			if ($field->type->db == "enum") {
126
				$items = '';
127
				
128
				foreach ($field->options as $key => $option) {
129
					$items .= "'" . $option . "'";
130
					if ($key < (count($field->options) - 1))
131
						$items .= ", ";
132
133
				}
134
135
136
				$enumStub = str_replace('{{field_options}}', $items, $enumStub);