Format php puts a space after "empty" keyword, before paren

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.

  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;

Format php puts a space after "empty" keyword, before paren

Postby sootsnoot » Fri May 08, 2015 12:36 am

Using Rapid PHP 2015, 13.2.0.164

The following is just a copy-paste of this feature request, which got a reply saying that it's a confirmable bug so it should be posted in this forum instead of that one :-)
====================================================================================================

I don't know if this is a behavior change from any previous version, but I don't remember seeing this before (OTOH, I don't use the Format PHP code option very often). At any rate, I find it pretty annoying and would like to be able to turn it off if possible.

If I have this code:
Code: Select all
  if (!empty($var) || !foo($var))


Formatting turns it into:
Code: Select all
  if (!empty ($var) || !foo($var))


I don't see a way to post a screenshot here, but the "Add Space" tab on the "PHP Formatter Settings" dialog that pops up when you run the formatter has all boxes checked except for:
  • Before cemicolon (sic)
  • Inside expresison (sic) parenthesis
  • Inside method call parenthesis

I don't see any option that seems likely to be responsible for the reformatting done to insert a space between empty and left-parenthesis. It doesn't happen for function names.

I'm not actually familiar with the editorconfig tool mentioned in this topic, but if it handles that level of detailed options, maybe this is a vote for that topic. The current PHP code formatter with all its options is really very nice, don't get me wrong. It's just this one little thing that has suddenly caught my eye and become annoying :mrgreen:
sootsnoot
 
Posts: 26
Joined: Sun Feb 24, 2013 4:30 am

Re: Format php puts a space after "empty" keyword, before pa

Postby Aivars » Mon May 25, 2015 10:58 am

I'll add it to bug list. I'm not sure what's going on there and why that space is added, but it seems to have something to do with "empty" because if you change it to something else then this doesn't happen.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2456
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Support

Who is online

Users browsing this forum: No registered users and 3 guests

cron