Skip to content

Releases: mibk/phpfmt

v0.2.0 — The Pipe Dream

25 Mar 08:53

Choose a tag to compare

New features

  • -s flag 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 and true/false/null to lowercase.
  • Pipe operator (|>) support.

Improvements

  • Handle keywords used as class, interface, trait, and enum names.
  • Handle namespace\Foo as 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): ReturnType syntax.
  • @phpstan-type aliases with = between name and type.
  • Empty array{} shape syntax.
  • Class::*_SUFFIX prefix-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 @method tags.
  • Parameters without PHP type in @method tags.
  • Fix handling of leading asterisks;
    remove leading/trailing/duplicate blank lines.

phpfmt v0.1.1 — A couple of bug fixes

12 Sep 08:58

Choose a tag to compare

This is a minor release that fixes a few issues.

phpfmt v0.1.0 — First Public Beta 🎉

10 Jul 19:48

Choose a tag to compare

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.