Phalcon\Build\Generator_File_PhalconH::getCleanHeaderFileContent PHP Method

getCleanHeaderFileContent() protected method

Overall, removing comments is not necessary for putting result to a merged file, we just don't want to put license notices for every included file.
protected getCleanHeaderFileContent ( string $file ) : string
$file string
return string
    protected function getCleanHeaderFileContent($file)
    {
        $result = '';
        $openComment = false;
        foreach (file($file) as $line) {
            // Skip comments
            $trimLine = trim($line);
            if ($trimLine == '/*' || $trimLine == '/**') {
                $openComment = true;
                continue;
            }
            if ($openComment) {
                if ($trimLine == '*/' || $trimLine == '**/') {
                    $openComment = false;
                }
                continue;
            }
            // Add line to result
            $result .= $this->cleanExtern($line);
        }
        return $result;
    }