Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8656623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:19:23+00:00 2026-06-12T15:19:23+00:00

Possible Duplicate: Are there any free cmd-line scripts which can re-format PHP source-code? I’ve

  • 0

Possible Duplicate:
Are there any free cmd-line scripts which can re-format PHP source-code?

I’ve been evaluating several coding standards fixers to run on our code. This is to perform some auto-fixing on legacy code which uses deprecated things like perl-style comments.

The most useful fixer I have used so far is php-tidy which is found here: http://phptidy.berlios.de/

This tries to conform to the PEAR standard, which is almost exactly what I need, except that I want non-hanging braces for control structures.

Can anyone point me a (linux-based) command-line tool that can apply a fixer to use the ANSI style of braces?:

function nice_brace()
{
    if (isset($nicebrace))
    {
        // I like non-hanging braces
    }
}

Rather than the PEAR/Zend style:

function ugly_brace() {
    if (isset($ugly_brace)) {
        // I find this code harder to read
    }
}

Edit: For others looking for something similar, check this script out: https://raw.github.com/gist/366837/25713637b6f2f9e1ec63abf3233142765df4b931/phpbb-reformat.pl

Many thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:19:24+00:00Added an answer on June 12, 2026 at 3:19 pm

    I use the following command in Vim to fix it

    :g/^\s*{\s*$/normal kJ
    

    More details from this stackoverflow question

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: PHP pagination class are there any PHP/Class libraries that i can utilize
Possible Duplicate: Select xml node by attribute in php Is there any function like
Possible Duplicate: Is there a website where I can see which HTML 5 tags
Possible Duplicate: Is there an equivalent to Trac written in PHP? Are there any
Possible Duplicate: Is there any good and free Date AND Time Picker available for
Possible Duplicate: are there any O(1/n) algorithms? Is it ever possible for your code
Possible Duplicate: Reference: Comparing PHP's print and echo Is there any major and fundamental
Possible Duplicate: Is there any way to detect strings like putjbtghguhjjjanika? php check if
Possible Duplicate: Is there a PHP function to remove any/all key/value pairs that have
Possible Duplicate: Is there any danger in calling free() or delete instead of delete[]?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.