carthage-software/mago
Mago is an extremely fast PHP linter, formatter, and static analyzer written in Rust. It brings Rust-inspired speed and reliability to PHP projects with a modern toolchain and great developer experience, plus multiple install options (script, Homebrew, Composer).
Integrate Mago directly with the Helix editor for fast, reliable, and automatic code formatting.
PATH Configured: The mago executable must be available in your system's PATH. The recommended installation scripts handle this for you. You can verify this by running which mago in your terminal.You only need to add a few lines to your Helix languages.toml file.
Locate your languages.toml file:
~/.config/helix/languages.toml.%AppData%\helix\languages.toml.
If the file doesn't exist, you can create it.Add the Mago formatter configuration: Add the following TOML block to the end of the file. This will override the default formatter for PHP and enable formatting on save.
# ~/.config/helix/languages.toml
[[language]]
name = "php"
# Set Mago as the formatter.
# This assumes your mago.toml file is in your current working directory.
# If you work on multiple projects, consider using a .helix/languages.toml file in your project directory.
formatter = { command = "mago", args = ["format", "--stdin-input"] }
# Set to true to format automatically on save.
auto-format = true
Once configured, Helix is ready to use Mago.
auto-format = true, your PHP files will be formatted by Mago every time you save (:write or :w).:format (or :fmt) command in Helix's command mode.To verify the setup, open a .php file, misalign some code, and save the file. The code should snap into place as Mago formats it.
How can I help you explore Laravel packages today?