//check filetype of output file // // object of Salaries class // $data = new Salaries(); $data->baseSalary(); //set base salaries dates $data->bonusSalary(); //set bonus salaries dates $data->monthNames(); //set months names $write = new WriteFile(); //object of WriteFile class // // setting all parameters in WriteFile class // $write->setPath($argv[1]); $write->setMonths($data->getMonths()); $write->setBase($data->getBaseSalary()); $write->setBonus($data->getBonusSalary()); $write->writeAll(); //write all datas to output file } else { if ($argc > 2) { //if user enter 2 or more arguments die("Too many arguments!"); } else { //if user not enter any arguments die("You don't enter file!"); } }