Releases: mibk/phpfmt
v0.2.0 — The Pipe Dream
New features
-sflag for code simplification:
currently normalizes string quoting
(double-quoted strings without interpolation → single-quoted).- Blank lines between class members:
automatically ensures blank lines between class member declarations. - Lowercase keywords:
normalizes all PHP keywords andtrue/false/nullto lowercase. - Pipe operator (
|>) support.
Improvements
- Handle keywords used as class, interface, trait, and enum names.
- Handle
namespace\Fooas a qualified name. - Handle leading backslash in namespace names.
- Support CRLF line endings.
Bug fixes
- Fix keyword-to-identifier demotion for LowercaseKeywords.
- Fix printing brace for anonymous class.
- Fix run-on statement issue.
- Fix formatting
new static. - Fix identifying next operator.
PHPDoc parser
- Conditional return types (
($param is Type ? T1 : T2)). Closure(params): ReturnTypesyntax.@phpstan-typealiases with=between name and type.- Empty
array{}shape syntax. Class::*_SUFFIXprefix-wildcard in const fetch expressions.- Variadic (
...) in array shapes. - Multiline type expressions.
- Nullable constant fetch.
- Number literals (e.g. floats).
[]as default parameter value in@methodtags.- Parameters without PHP type in
@methodtags. - Fix handling of leading asterisks;
remove leading/trailing/duplicate blank lines.
phpfmt v0.1.1 — A couple of bug fixes
This is a minor release that fixes a few issues.
phpfmt v0.1.0 — First Public Beta 🎉
Overview
After ten years of gradual evolution—and an especially intense sprint over the past few months—we’re thrilled to tag v0.1.0. This is the first public, versioned snapshot of a project that began as a naïvely simple PHP script and has matured into a robust, Go‑based tool.
See the README for more information about phpfmt.
Philosophy & Inspiration
A constant source of inspiration has been Go’s own gofmt. Robert Griesemer’s insistence on “one obvious way” to format code has shaped our thinking about configuration and defaults. We aim to offer the same predictability to the PHP ecosystem.
“Write it one way, and let the tool handle the rest.”
Not Set in Stone
v0.1.0 marks a milestone, not a monument. Our long‑term ambition is to crystallise this project into an authoritative PHP standard, but we’re not there—yet.
Thanks 🙌
Special thanks to Robert Griesemer, author of gofmt, whose work continues to inspire us.
We Want Your Feedback
Kick the tyres and tell us where it squeaks.
- Issues: https://github.com/mibk/phpfmt/issues
- Pull requests: https://github.com/mibk/phpfmt/pulls