function parse(string $zen) { if (strlen($zen) === 0) { throw new \InvalidArgumentException('htmlgen\\html expects a non-empty string'); } else { return \htmlgen\element\element(parseTag($zen), ['id' => parseId($zen), 'class' => parseClass($zen)]); } }
function createFile($filePath, $className) { $content = file_get_contents($filePath); $pattern = '/(\\{[\\s\\S]*\\/\\*\\*[\\s\\S]*?public function action.*\\(\\))/'; preg_match($pattern, $content, $matches); if (empty($matches)) { return array(); } $pattern2 = '/(\\/\\*\\*[\\s\\S]*?public function action.*\\(\\))/'; preg_match_all($pattern2, $matches[0], $matches2); $ret = array(); if (count($matches2[0])) { foreach ($matches2[0] as $val) { preg_match('/.*public function action(.*)/', $val, $matches3); $ret[parseFunction($matches3[1])] = trim(parseDescription($val, $matches3[1])); } } $ret = array('class' => parseClass($className), 'func' => $ret); return $ret; }
private function getFQCNfromFile($file, $file_fqcn) { if (array_key_exists($file, $this->file_fqcn)) { return $this->file_fqcn[$file]; } else { $parsedData = parseClass($file); $classLineData = $parsedData['class_line_data']; $className = $classLineData['classname']; if (array_key_exists('file', $parsedData['namespaces'])) { $fqcn = $parsedData['namespaces']['file'] . "\\" . $className; } else { $fqcn = $className; } return $fqcn; } }
function printHistory($history) { echo "<table class ='pure-table pure-table-bordered'>"; echo "<thead><tr><th>Reservation Id</th><th>Date of Departure (GMT)</th><th>Depart City</th>" . "<th>Depart Country</th><th>Arrival City</th><th>Arrival Country</th>" . "<th>Class</th><th>Number of tickets</th><th>Credit card #</th>" . "<th>COST (CAD)</th></thead>"; $it = 0; while ($tuple = OCI_Fetch_Array($history, OCI_ASSOC)) { $numFlights = 1; if (array_key_exists("FID3", $tuple)) { $numFlights = 3; } else { if (array_key_exists("FID2", $tuple) && array_key_exists("FID3", $tuple) != TRUE) { $numFlights = 2; } } $details = getDetails($tuple, $numFlights); echo "<tr><td>" . $tuple['RESID'] . "</td><td>" . $details['DEPARTDATE'] . "</td><td>" . $details['DEPARTCITY'] . "</td><td>" . $details['DEPARTCOUNTRY'] . "</td><td>" . $details['ARRIVALCITY'] . "</td><td>" . $details['ARRIVALCOUNTRY'] . "</td><td>" . parseClass($tuple['PCLASS']) . "</td><td>" . $tuple['TICKET_NUM'] . "</td><td>" . parseCard($tuple['CREDITCARD']) . "</td><td>" . $tuple['TOTAL_COST'] . "</td></tr>"; echo "<tr><td>"; $flight = array("FIRSTID" => $tuple['FID1']); if ($numFlights >= 2) { $flight["SECONDID"] = $tuple['FID2']; } if ($numFlights == 3) { $flight["THIRDID"] = $tuple['FID3']; } printDetails($flight, $it, 1); echo "</td></tr>"; $it++; } echo "</table>"; }