@@ -122,7 +122,7 @@ public function execute(Arguments $args, ConsoleIo $io): ?int
122122 return static ::CODE_SUCCESS ;
123123 }
124124
125- $ table = $ args ->getOption ('table ' ) ?? '' ;
125+ $ table = ( string ) $ args ->getOption ('table ' );
126126 $ model = $ this ->_camelize ($ name );
127127 $ this ->bake ($ model , $ table , $ args , $ io );
128128
@@ -285,16 +285,19 @@ protected function _generateSchema(TableSchemaInterface $table): string
285285 {
286286 $ cols = $ indexes = $ constraints = [];
287287 foreach ($ table ->columns () as $ field ) {
288+ /** @var array $fieldData */
288289 $ fieldData = $ table ->getColumn ($ field );
289290 $ properties = implode (', ' , $ this ->_values ($ fieldData ));
290291 $ cols [] = " ' $ field' => [ $ properties], " ;
291292 }
292293 foreach ($ table ->indexes () as $ index ) {
294+ /** @var array $fieldData */
293295 $ fieldData = $ table ->getIndex ($ index );
294296 $ properties = implode (', ' , $ this ->_values ($ fieldData ));
295297 $ indexes [] = " ' $ index' => [ $ properties], " ;
296298 }
297299 foreach ($ table ->constraints () as $ index ) {
300+ /** @var array $fieldData */
298301 $ fieldData = $ table ->getConstraint ($ index );
299302 $ properties = implode (', ' , $ this ->_values ($ fieldData ));
300303 $ constraints [] = " ' $ index' => [ $ properties], " ;
@@ -360,6 +363,7 @@ protected function _generateRecords(TableSchemaInterface $table, int $recordCoun
360363 for ($ i = 0 ; $ i < $ recordCount ; $ i ++) {
361364 $ record = [];
362365 foreach ($ table ->columns () as $ field ) {
366+ /** @var array $fieldInfo */
363367 $ fieldInfo = $ table ->getColumn ($ field );
364368 $ insert = '' ;
365369 switch ($ fieldInfo ['type ' ]) {
0 commit comments