PHP Code Beautifier and Fixer (phpcbf)

Authored by

All of us PHP developers should be very well familiar with WordPress Coding Standards for PHP_CodeSniffer (phpcs). It automatically finds problems in WordPress code, both in terms of code style but also in terms of performance and security. It should be configured in your IDE and called in your repos’ pre-commit hooks.

Did you also know that PHP_CodeSniffer includes a tool called phpcbf (PHP Code Beautifier and Fixer) that can automatically fix a lot of the issues that PHPCS discovers?

So to do an initial pass to fix a plugin’s PHP code, you can just run:

phpcbf --standard=WordPress-Core php/*.php

This is great for automating the accommodation for WordPress’s affection for whitespace 🙂

Check out Using the PHP Code Beautifier and Fixer.

#cli #phpcs

14 thoughts on “PHP Code Beautifier and Fixer (phpcbf)”

  1. Your web page has given myself a lot of very helpful guidance, and
    for which I thank you very much. This post is the best I have
    read so far on your website, and so I felt I had to take time to post a comment.
    You’ve provided myself a few tips that could aid me down the road.

  2. So as to keep your office and devices in check, electronic
    medical data software program could conserve you time, cash and room.
    Electronic medical report software program moreover has the option of CPT
    codes lookup. The CPT indicates current procedural terminology.
    Most of the electronic medical document packages routinely make the most of the CPT lookup.
    As in all other spot of existence, the medical records location is being
    modified and challenged by the at any time shifting electronic entire world.

    Furthermore the overhead associated with maintaining an assembly operation operating can poorly affect
    a company’s backside line-particularly when their merchandise are low quantity, and high combine which may lead to numerous idle time for his or her in-house assembly operation. The time it takes to smoke a cigarette and the time chosen to smoke can be deep seeded to thoughts as an emotional crutch, a de-stressor, a artistic affiliation or
    something to do for fidgety hands throughout considering or conversing.
    You don’t have to create or stock a product, you don’t must deal with sophisticated payment processors,
    you don’t must spend extra time on assist or processing refunds and you continue to get to be
    taught the basics of web advertising. Secondly, it is going to allow them to
    get one of the best product and the very best service provider by reading opinions and
    rankings, and eventually additionally they get various reductions affords,
    free shipping and cash back guarantee for their purchases.

  3. The dish is eaten with a stage wood stick which slides below the cake making it easy to
    ladle out from the bowl. Within the Vietnamese, folks known as it like Saigon Nho, as
    a result of it represents massive Saigon in Vietnam.

  4. Oh my goodness! Amazing article dude! Tһank yoս, Нowever Ι am having probⅼems ᴡith yօur RSS.
    I ⅾߋn’t know wһү I ccannot join іt. Is theге anybody gettіng identical RSS
    issues? Anyօne thyat knows the solution wilol you kindly respond?

  5. hello!,I love your writing so a lot! share we communicate extra approximately your post on AOL?
    I need an expert on this area to resolve my problem. Maybe that is you!

    Having a look forward to peer you.

  6. I just like the valuable info you provide for your articles.
    I’ll bookmark your blog and check again here regularly.
    I am fairly sure I’ll learn many new stuff right here! Best of luck for the

  7. For most up-to-date information you have to pay a quick visit world wide web and on world-wide-web I found this website as a best website for
    most up-to-date updates.

  8. Live Game adalah judi di mana cara praktek perjudiannya seperti di
    casino sebenarnya. Casino di perkenalkan sejak beratus tahun yang lalu lamanya.
    Hingga kini casino masih di gemari banyak orang. Bahkan casino
    sendiri sudah ada kota khusus perjudian yaitu LAS VEGAS di amerika serikat.
    Perjudian casino sangat di gemari bagi kalangan dewasa pasalnya selain perjudian membuahkan sebuah kemenangan. Judi
    juga membuahkan sebuah kepuasan dan hibuaran tersendiri
    bagi masyarakat luas bahkan judi sendiri menjadi
    pundi pundi untuk mencari uang bagi sebagian orang.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.