{"id":30450236,"url":"https://github.com/nochso/phormat","last_synced_at":"2026-06-15T21:32:02.128Z","repository":{"id":57027926,"uuid":"56384266","full_name":"nochso/phormat","owner":"nochso","description":"[ABANDONED] PHP source formatter with a single style - essentially gofmt for PHP","archived":false,"fork":false,"pushed_at":"2016-04-29T21:01:21.000Z","size":135,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T14:03:26.159Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nochso.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-16T13:12:43.000Z","updated_at":"2019-07-03T17:25:24.000Z","dependencies_parsed_at":"2022-08-23T16:20:42.622Z","dependency_job_id":null,"html_url":"https://github.com/nochso/phormat","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/nochso/phormat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nochso%2Fphormat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nochso%2Fphormat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nochso%2Fphormat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nochso%2Fphormat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nochso","download_url":"https://codeload.github.com/nochso/phormat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nochso%2Fphormat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34381759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-23T13:25:57.601Z","updated_at":"2026-06-15T21:32:02.112Z","avatar_url":"https://github.com/nochso.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nochso/phormat\n\n[![write me to read me](https://img.shields.io/badge/writeme-readme-blue.svg)](https://github.com/nochso/writeme)\n[![License](https://img.shields.io/github/license/nochso/phormat.svg)](https://packagist.org/packages/nochso/phormat)\n[![Latest tag on Github](https://img.shields.io/github/tag/nochso/phormat.svg)](https://github.com/nochso/phormat/tags)\n[![Travis CI build status](https://api.travis-ci.org/nochso/phormat.svg)](https://travis-ci.org/nochso/phormat)\n[![Coverage status](https://coveralls.io/repos/github/nochso/phormat/badge.svg)](https://coveralls.io/github/nochso/phormat)\n\nPhormat formats PHP source code.\n\nDifferences to other [fixers](https://github.com/FriendsOfPHP/PHP-CS-Fixer) or\n[PSR2](http://www.php-fig.org/psr/psr-2/):\n\n- You can not influence the style, [similar](https://blog.golang.org/go-fmt-your-code)\n  to [gofmt](https://golang.org/cmd/gofmt/).\n- Tabs for indentation.\n- Opening braces `{` on the same line: `) {`\n- No extra whitespacy lines in code or comments.\n- Use statements are always sorted.\n- Optional re-arranging of class level elements.\n- Fast. Check out the [benchmarks](http://nochso.github.io/phormat/benchmark/).\n\n* * *\n\n- [nochso/phormat](#nochsophormat)\n- [Introduction, goals and scope](#introduction-goals-and-scope)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n    - [Command line options](#command-line-options)\n- [Contributing](#contributing)\n- [Change log](#change-log)\n    - [Unreleased](#unreleased)\n    - [0.1.5 - 2016-04-23](#015---2016-04-23)\n    - [0.1.4 - 2016-04-23](#014---2016-04-23)\n- [License](#license)\n\n# Introduction, goals and scope\n\nPhormat is a pretty printer based on [nikic/php-parser](https://github.com/nikic/PHP-Parser).\nIt **discards** any formatting and prints source code in a **uniform** style. Custom\nformatting options are out of scope.\n\nThe chosen style is personal preference and attempts to keep the line count low\nwhile keeping the code readable.\n\n\u003e You're anti-PSR! Why do you hate FIG?\n\nI'm not. I don't. This is **not a replacement, improvement or critique of PSR2**\nbut merely an alternative you're free to ignore.\n\nPSR2 is quite widespread for a reason and has helped lots of projects decide on a common\nstyle. However it does not mean everybody loves it personally or that it is a\nde-facto standard you must adhere to. The questions of *tabs vs. spaces* or *placement of braces*\nwill always be part of a holy war as it comes down to personal preference.\n\nIn the end, it's **best for collaboration** if a project has a **well defined**\nstyle that is easy for contributors to adhere to. Which is easily possible for\nboth PSR2 and phormat.\n\nSee [php-cs-fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) for a great\nway to adhere to PSR2.\n\n# Requirements\nThis project is written for and tested with PHP 5.6, 7.0 and HHVM.\n\n# Installation\nFor end-users the PHAR version is preferred. To install it **globally**:\n\n1. Download the PHAR file from the\n   [latest release](https://github.com/nochso/phormat/releases).\n2. Make it executable: `chmod +x phormat.phar`\n3. Move it somewhere within your `PATH`: `sudo cp phormat.phar /usr/local/bin/phormat`\n\nAs **local Composer development** dependency per project:\n```\ncomposer require --dev nochso/phormat\n```\n\nAs **global** Composer dependency:\n```\ncomposer global require nochso/phormat\n```\n\n# Usage\n\nAs a local dependency `php vendor/bin/phormat` or if installed globally just `phormat`.\n\n    phormat [options] \u003cpath\u003e\n    phormat [options] \u003cpath1\u003e \u003cpath2\u003e ...\n\nBy default PHP files from the specified paths will be overwritten. See the\noptions below to override this behaviour.\n\nIf path is a folder it will be searched recursively for files ending with\n`*.php`.\n\nNative PHP templates will be skipped to avoid messing up their formatting.\nTemplates are detected by looking for [alternative syntax for control structures](http://php.net/manual/en/control-structures.alternative-syntax.php)\nlike `if (true): .. endif;`\n\n## Command line options\n```\nArguments\n    \u003cpaths\u003e\n        One or many paths to files or directories.\n\nOptions\n    -d, --diff\n        Preview diff of formatted code. Implies --no-output.\n\n    -s, --summary\n        Show a status summary for each file.\n\n    -o, --order\n        Change order of class elements:\n        constants \u003e properties \u003e methods\n        static \u003e abstract \u003e *\n        public \u003e protected \u003e private\n        __* \u003e has* \u003e is* \u003e get* \u003e set* \u003e add* \u003e remove* \u003e enable* \u003e disable* \u003e *\n\n    -p, --print\n        Print full output of formatted code. Implies --no-output.\n\n    -n, --no-output\n        Do not overwrite source files.\n\n    -h, --help\n        Show this help.\n\n    --version\n        Show version information.\n\n    --self-update\n        Update phormat to the latest version.\n```\n\n# Contributing\nFeedback, bug reports and pull requests are always welcome.\n\nPlease read the [contributing guide](CONTRIBUTING.md) for instructions.\n\n# Change log\nSee [CHANGELOG.md](CHANGELOG.md) for the full history of changes between\nreleases.\n\n## [Unreleased]\n\n### Changed\n- Improved line wrapping: Use a soft limit of 100 characters for lines made of `.`, `||` and `\u0026\u0026`.\n\n\n## [0.1.5] - 2016-04-23\n\n### Changed\n- Allow self-update without public key.\n\n\n## [0.1.4] - 2016-04-23\n\n### Added\n- Show warnings when xdebug or xdebug-profiling is enabled.\n\n\n### Changed\n- Put closing parenthesis of multiple lines on a new line.\n- Use statements are always sorted.\n- Separate classes, interfaces and traits.\n- Keep use and group-use statements together.\n\n\n\n\n# License\nThis project is released under the MIT license. See [LICENSE.md](LICENSE.md)\nfor the full text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnochso%2Fphormat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnochso%2Fphormat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnochso%2Fphormat/lists"}