承接 cresset/wick 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cresset/wick

Composer 安装命令:

composer require cresset/wick

包简介

An unconfigurable, Laravel Pint-style PHP formatter. Fetches a prebuilt Rust binary on demand; powered by Mago.

README 文档

README

An unconfigurable, Laravel Pint-style PHP formatter and linter — fast, single static binary, no PHP runtime required.

wick is to PHP what gofmt is to Go: one style, no knobs. There is no config file, no preset selection, no rule toggles. You point it at your code and it formats it. The only flags decide what to do with the result — write, check, or diff — never how the code is formatted.

wick check adds linting in the same spirit: it runs Mago's default rule set, unconfigured, at the PHP version your composer.json declares — no --select, no --ignore, no severities to tune. It mirrors ruff check: report by default, --fix to apply safe fixes, --fix --unsafe-fixes for the rest, --diff to preview.

Part of the cresset-tools family, alongside bougie.

Powered by Mago

wick does not parse or pretty-print PHP itself. All of that — the lexer, parser, AST, and the Wadler-style pretty-printer that does the actual formatting — is Mago, an excellent PHP toolchain written in Rust by Carthage Software. wick simply pins Mago's Pint style preset and default lint rules, targets the PHP version it detects, and wraps them in a deliberately minimal CLI.

If you want a configurable formatter or linter, rule selection, severities, framework integrations, or a static analyzer/type checker, use Mago directly — it does all of that and more. wick exists only for people who want "Laravel style, no decisions."

Mago is licensed MIT OR Apache-2.0. wick is grateful for it.

Install

# Unix
$ curl -LsSf https://bougie.tools/wick.sh | sh

# Windows (PowerShell)
> irm https://bougie.tools/wick.ps1 | iex

# or, from source
$ cargo install wick

Prebuilt binaries (Linux gnu/musl, macOS arm64, Windows x64) are attached to every GitHub Release and mirrored to cresset infrastructure.

In a PHP project (Composer)

wick is on Packagist as cresset/wick. The Composer package ships only a thin PHP launcher; on first run it downloads the prebuilt wick binary for your platform and caches it.

$ composer require --dev cresset/wick
$ vendor/bin/wick format          # format every .php under the current dir
$ vendor/bin/wick format --check  # CI: non-zero if anything is unformatted
$ vendor/bin/wick check           # lint

Without installing (bgx)

bougie's bgx (like npx) runs wick in an isolated, globally-cached environment without adding it to your project. Everything after the package is forwarded straight to wick:

$ bgx cresset/wick format
$ bgx cresset/wick check src tests

Usage

Like ruff, wick has no default action — pick format or check. Bare wick just prints help.

$ wick format                 # format every .php file under the current directory
$ wick format src tests       # format specific files or directories
$ wick format --check         # CI mode: exit non-zero if anything is unformatted
$ wick format --diff          # print what would change, write nothing
$ cat a.php | wick format -    # format stdin, write to stdout

Linting mirrors ruff check:

$ wick check                  # lint every .php file under the current directory
$ wick check src tests        # lint specific files or directories
$ wick check --fix            # apply safe fixes in place
$ wick check --fix --unsafe-fixes   # also apply behaviour-changing fixes
$ wick check --diff           # preview the fixes --fix would apply
$ cat a.php | wick check -     # lint stdin

Fixable problems are flagged with [*]. Directories are walked respecting .gitignore.

Compatibility note

wick is a from-scratch reprinter: it discards your existing whitespace and prints the AST anew (like gofmt/Prettier/Black). Laravel Pint is a token-fixer built on PHP-CS-Fixer that only edits what violates a rule. The output style matches Pint's conventions closely, but wick is not a byte-for-byte Pint drop-in — the first run on an existing Pint-formatted codebase will still produce a reformat diff.

License

EUPL-1.2 © Jelle Besseling

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Rust

其他信息

  • 授权协议: EUPL-1.2
  • 更新时间: 2026-06-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固