public function validatePhpFile($file)
    {
        if (!$this->canValidatePhpCode()) {
            return null;
        }

        $output = shell_exec('php -l ' . escapeshellarg($file));

        $count = 0;
        $error = preg_replace('/Errors parsing.*$/', '', $output, -1, $count);
        return $count > 0 ? trim("$error") : true;
    }
public function validatePhpFile($file)
    {
        if (!$this->canValidatePhpCode()) {
            return null;
        }

        $output = shell_exec('php -l ' . escapeshellarg($file));

        $count = 0;
        $error = preg_replace('/Errors parsing.*$/', '', $output, -1, $count);
        return $count > 0 ? trim("$error") : true;
    }
public function validatePhpFile ( $ file ) { if ( ! $ this -> canValidatePhpCode ( ) ) { return null ; } $ output = shell_exec ( 'php -l ' . escapeshellarg ( $ file ) ) ; $ count = 0 ; $ error = preg_replace ( '/Errors parsing.*$/' , '' , $ output , - 1 , $ count ) ; return $ count > 0 ? trim ( "$error" ) : true ; }
Tries to validate syntax of a PHP file
@param string $file
@return mixed
Tries to validate syntax of a PHP file