1

I have read the documentation from both formatters and have tried different configurations using various coding styles with different arguments with no success. Here's a code snippet of how my configuration currently stands.

local present, null_ls = pcall(require, "null-ls")

if not present then
    return
end

local b = null_ls.builtins

local sources = {
    --php
    b.formatting.phpcbf.with({
        extra_args = { "--tab-width=2" },
    }),
    -- b.formatting.phpcsfixer.with {
    --   args = { "--no-interaction", "--quiet", "fix", "$FILENAME", "--using-cache=no" },
    -- },
    b.formatting.blade_formatter,
}

null_ls.setup({
    debug = true,
    sources = sources,
})

1 Answer 1

1

To achieve that in PHP CS Fixer you need to create config file, where you will be able to configure whitespaces. Theres, simply pass 2 spaces with setIndent method.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.