file_name = $file_name; $this->directory = $directory; } /** * Reads file and converts into data * * @return Alternc_Diagnostic_Data */ function build(){ $extension = pathinfo($this->file_name, PATHINFO_EXTENSION); $class_name = "Alternc_Diagnostic_Format_".ucfirst(strtolower($extension)); $format = new $class_name($this->directory); $dataInstance = $format->read($this->file_name); return $dataInstance; } }