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;
    }