-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Code of Wizard need to refactoring
Codestyle must be changed
As is
$wizard->setAuthor('author');
$wizard->setLicense('license');
$wizard->setTime(time());
$wizard->addCSV('infoCSV','/path/to/cvs/info.csv',2);
$wizard->addCSV('networksCSV','/path/to/cvs/networks.csv',1);
$info = array(
'interval' => array(
'type' => 'int',
'column' => 1,
),
'caption' => array(
'type' => 'string',
'column' => 2,
'transform' => 'low',
),
'ext' => array(
'type' => 'string',
'column' => 3,
),
);
$wizard->addRegister('info','infoCSV',0, $info);
$networks = array(
'info' => 2,
);
$wizard->create($dbFile);To be
$info = (new \Ddrv\Iptool\Wizard\Register('info.csv'))
->addField('interval',1,new NumericField(0))
->addField('caption',2,new StringField(StringField::TRANSFORM_LOWER))
->addField('ext',3,new StringField())
->setFirstRow(2)
;
$net = (new \Ddrv\Iptool\Wizard\Network('networks.csv','ip',0,1))
->setCsv('UTF-8', ',', '"','\\')
->setFirstRow(1)
;
$wizard = (new Ddrv\Iptool\Wizard('/tmp'))
->setAuthor('author')
->setTime(time())
->setLicense('license')
->addRegister('info', $info)
->addNetwork($net, array(
2 => 'info'
))
->compile('iptool.test.dat')
;Reactions are currently unavailable