used empty instead of ! to error like 'avoid Object of class SplFileInfo could not be converted to boolean'