@@ -169,7 +169,7 @@ public function inOptions($options, $prompt = null, $default = null) {
169
169
$ valid = false ;
170
170
$ max = count ($ options );
171
171
while (!$ valid ) {
172
- $ len = strlen (( count ($ options )+ 1 ) );
172
+ $ len = strlen (count ($ options ) + 1 );
173
173
foreach ($ options as $ i => $ option ) {
174
174
$ this ->out (sprintf ("% $ {len}d. %s " , $ i + 1 , $ option ));
175
175
}
@@ -410,14 +410,15 @@ public function fieldValidation($fieldName, $metaData, $primaryKey = 'id') {
410
410
$ this ->out (__d ('cake_console ' , 'Please select one of the following validation options: ' ));
411
411
$ this ->hr ();
412
412
413
+ $ optionText = '' ;
413
414
for ($ i = 1 , $ m = $ defaultChoice / 2 ; $ i < $ m ; $ i ++) {
414
- $ strAux = sprintf ("%2d. %s " , $ i , $ this ->_validations [$ i ]);
415
- $ strAux = $ strAux . str_repeat (" " , 31 - strlen ($ strAux ));
416
- $ strAux .= sprintf ("%2d. %s " , $ m + $ i , $ this ->_validations [$ m + $ i ]);
417
- $ this -> out ( $ strAux );
418
- }
419
- $ this ->out (__d ('cake_console ' , "%s - Do not do any validation on this field. " , $ defaultChoice ));
420
- $ this ->hr ();
415
+ $ line = sprintf ("%2d. %s " , $ i , $ this ->_validations [$ i ]);
416
+ $ optionText . = $ line . str_repeat (" " , 31 - strlen ($ line ));
417
+ $ optionText .= sprintf ("%2d. %s " , $ m + $ i , $ this ->_validations [$ m + $ i ]);
418
+ }
419
+ $ this -> out ( $ optionText );
420
+ $ this ->out (__d ('cake_console ' , "%s - Do not do any validation on this field. " , $ defaultChoice ));
421
+ $ this ->hr ();
421
422
}
422
423
423
424
$ prompt = __d ('cake_console ' , "... or enter in a valid regex validation string. \n" );
@@ -848,7 +849,7 @@ public function listAll($useDbConfig = null) {
848
849
}
849
850
if ($ this ->interactive === true ) {
850
851
$ this ->out (__d ('cake_console ' , 'Possible Models based on your current database: ' ));
851
- $ len = strlen (( $ count + 1 ) );
852
+ $ len = strlen ($ count + 1 );
852
853
for ($ i = 0 ; $ i < $ count ; $ i ++) {
853
854
$ this ->out (sprintf ("% $ {len}d. %s " , $ i + 1 , $ this ->_modelNames [$ i ]));
854
855
}
0 commit comments