{"id":18916812,"url":"https://github.com/dusterio/prettyhp","last_synced_at":"2025-10-14T22:10:58.294Z","repository":{"id":56973355,"uuid":"96986862","full_name":"dusterio/prettyhp","owner":"dusterio","description":"PrettyHP is an opinionated PHP code formatter","archived":false,"fork":false,"pushed_at":"2023-05-28T04:14:02.000Z","size":38,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-01T07:16:31.875Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dusterio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-12T08:58:26.000Z","updated_at":"2020-08-01T11:44:07.000Z","dependencies_parsed_at":"2024-11-08T10:35:36.705Z","dependency_job_id":null,"html_url":"https://github.com/dusterio/prettyhp","commit_stats":{"total_commits":47,"total_committers":1,"mean_commits":47.0,"dds":0.0,"last_synced_commit":"1a5aca93119873e3978d506cc2a42b06c3128e58"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dusterio/prettyhp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dusterio%2Fprettyhp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dusterio%2Fprettyhp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dusterio%2Fprettyhp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dusterio%2Fprettyhp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dusterio","download_url":"https://codeload.github.com/dusterio/prettyhp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dusterio%2Fprettyhp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279021742,"owners_count":26087053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"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":"2024-11-08T10:22:13.544Z","updated_at":"2025-10-14T22:10:58.261Z","avatar_url":"https://github.com/dusterio.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prettyhp\n![Logo](https://www.mysenko.com/images/prettyhp_logo_512_transp5.png)\n\n[![Build Status](https://travis-ci.org/dusterio/prettyhp.svg?branch=master)](https://travis-ci.org/dusterio/prettyhp)\n[![Code Climate](https://codeclimate.com/github/dusterio/prettyhp/badges/gpa.svg)](https://codeclimate.com/github/dusterio/prettyhp/badges)\n[![Latest Stable Version](https://poser.pugx.org/dusterio/prettyhp/v/stable)](https://packagist.org/packages/dusterio/prettyhp)\n[![Total Downloads](https://poser.pugx.org/dusterio/prettyhp/downloads)](https://packagist.org/packages/dusterio/prettyhp)\n[![License](https://poser.pugx.org/dusterio/prettyhp/license)](https://packagist.org/packages/dusterio/prettyhp)\n\nPrettyHP is an opinionated PHP code formatter\n\nIt removes all original styling and ensures that all outputted code conforms to a consistent style.\n\nPrettyHP will try to comply with PSR as much as possible.\n\nInspired by JavaScript's [prettier](https://github.com/prettier/prettier)\n\n## But why?\n\nYour IDE or editor may already have some basic formatting built-in, but:\n\n- At least PhpStorm cannot re-format code automatically before committing to VCS;\n- Different team members may have different editors, views and standards;\n- At least PhpStorm doesn't really enforce styling, it just does some basic indenting.\n\nWhy not use existing PHP code formatters?\n\n### phpfmt\n\nphpfmt is officially closed, the repo is deleted by the authors.\n\n### php-cs-fixer\n\nI'm a very experienced developer and Linux user, yet I couldn't get it up and running in 10+ minutes. Something is just wrong\nabout it. Since the tool's verbose mode is not implemented, I couldn't debug it any further.\n\n## Installation\n\n```bash\n$ composer require --dev dusterio/prettyhp\n```\n\nWe recommend to add a pre-commit Git hook so that any modified PHP files are\nprettified right before the commit:\n\n```bash\n$ cat .git/hooks/pre-commit\n\ngit diff --staged --diff-filter=dx --name-only HEAD | grep \".*\\.php$\" | xargs -I % sh -c 'vendor/bin/prettyhp format %; git add %'\n```\n\n## Manual usage\n\nPrettyHP is meant for PSR 4 compliant files – one file should contain one PHP class.\n\n```bash\n$ vendor/bin/prettyhp [filename]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdusterio%2Fprettyhp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdusterio%2Fprettyhp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdusterio%2Fprettyhp/lists"}