private function prepareFileContent($fileContent)
    {
        // Remove 1 line comments
        $fileContent = preg_replace("#(.*)//(.*)#", " ", $fileContent);

        // Remove multi-line comments
        $fileContent = preg_replace("#/\*(.*)\*?/#", "", $fileContent);

        // Remove all new line characters
        $fileContent = preg_replace("/\n*/", "", $fileContent);

        // Add 2 new line characters after <?php
        $fileContent = str_replace("<?php", "<?php\n\n", $fileContent);

        // Add 1 new line characters after ;
        $fileContent = str_replace(";", ";\n", $fileContent);

        // Add 1 new line characters after {
        $fileContent = str_replace("{ ", "{\n", $fileContent);

        // Add 1 new line character after });
        $fileContent = str_replace("});", "});\n", $fileContent);

        return $fileContent;
    }
private function prepareFileContent($fileContent)
    {
        // Remove 1 line comments
        $fileContent = preg_replace("#(.*)//(.*)#", " ", $fileContent);

        // Remove multi-line comments
        $fileContent = preg_replace("#/\*(.*)\*?/#", "", $fileContent);

        // Remove all new line characters
        $fileContent = preg_replace("/\n*/", "", $fileContent);

        // Add 2 new line characters after <?php
        $fileContent = str_replace("<?php", "<?php\n\n", $fileContent);

        // Add 1 new line characters after ;
        $fileContent = str_replace(";", ";\n", $fileContent);

        // Add 1 new line characters after {
        $fileContent = str_replace("{ ", "{\n", $fileContent);

        // Add 1 new line character after });
        $fileContent = str_replace("});", "});\n", $fileContent);

        return $fileContent;
    }
private function prepareFileContent ( $ fileContent ) { // Remove 1 line comments $ fileContent = preg_replace ( "#(.*)//(.*)#" , " " , $ fileContent ) ; // Remove multi-line comments $ fileContent = preg_replace ( "#/\*(.*)\*?/#" , "" , $ fileContent ) ; // Remove all new line characters $ fileContent = preg_replace ( "/\n*/" , "" , $ fileContent ) ; // Add 2 new line characters after <?php $ fileContent = str_replace ( "<?php" , "<?php\n\n" , $ fileContent ) ; // Add 1 new line characters after ; $ fileContent = str_replace ( ";" , ";\n" , $ fileContent ) ; // Add 1 new line characters after { $ fileContent = str_replace ( "{ " , "{\n" , $ fileContent ) ; // Add 1 new line character after }); $ fileContent = str_replace ( "});" , "});\n" , $ fileContent ) ; return $ fileContent ; }
Prepare file content for parsing.

@param string $fileContent

@return string
Prepare file content for parsing .