Example #1
0
 /**
  * 
  */
 private function getFileContents()
 {
     $contents = file_get_contents($this->filename);
     $rows = explode("\n", $contents);
     for ($i = 1; $i < count($rows); $i++) {
         $row = trim($rows[$i]);
         if (substr($row, 0, 3) == "/**") {
             $field = Field::isField($rows, $i + 1);
             if ($field !== false) {
                 $this->fieldsinfile[$field->getName()] = $field;
                 while (!strstr($rows[$i], "protected \$" . $field->getName()) && $i < count($rows)) {
                     $i++;
                 }
             } else {
                 $this->rowstoexclude[] = array("before" => count($this->fieldsinfile) == 0 ? true : false, "content" => $rows[$i]);
             }
         } else {
             $this->rowstoexclude[] = array("before" => count($this->fieldsinfile) == 0 ? true : false, "" . "content" => $rows[$i]);
         }
     }
 }