NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
IDE does not indent chained methods ('->' at end or beg)


Joined: 23 Jan 2015
Posts: 21
Reply with quote
php chained methods code syntax is not getting indented on subsequent lines when '->' is at beginning or end of line. For example:
Code:

$prop= Prop::where('pmgr_id', '=', $pmgr->id)->
where('hapmlstid', '=', $loXml->hapmlstid)->firstOrFail();

The 2nd line does not get indented by phped. I couldn't find a setting for this in IDE options. Is this by design?
Thanks!
Love PhpEd BTW! I'm a new user.
View user's profileFind all posts by markh1Send private message


Joined: 06 Nov 2013
Posts: 54
Reply with quote
Yea, this part is a bit buggy, would be nice if they fix it tough.

but...

for ex if you indent yourself 2 ( or 3) of them next will became properly indented with "tab"

but also I have noticed the autocomplate doesnt work in some of those cases, which is also a bit annoying
View user's profileFind all posts by r1d3rSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
I think it is more likely by design rather than a bug. Personally I prefer the indentation aligning at the previous line, then I indent myself accordingly.

I haven't myself seen autocomplete fail; seems to work wherever I place the ->
View user's profileFind all posts by plugnplaySend private message


Joined: 23 Jan 2015
Posts: 21
Reply with quote
Yes, I agree it's fine to do your own indenting, but as soon as you use the "Re-indent Code" option, most of your continuation lines of the same statement line up with the starting line of that statement, rather than lines 2,3,4, etc. being indented 1 level.

It's not just when '->' is used in continuation lines as I mentioned in my original post. It seems PhpEd does this with many multi-line statements.

Code:
for example:
$n= 1 +
    2;

gets re-indented as (not what you'd expect):
$n= 1 +
2;

but:
$n= myfunc($a,
    $b);

does get re-indented as same (it indents the continuation line).


I think most people prefer continuation lines of the same statement to be indented 1 level, for obvious reasons of code readability.

I hope the developer chimes in please?? Smile
View user's profileFind all posts by markh1Send private message


Joined: 08 Apr 2015
Posts: 1
Reply with quote
I prefer the indentation aligning at the previous line,,,....!!!

_________________
SI
View user's profileFind all posts by anmolrani777Send private message


Joined: 23 Jan 2015
Posts: 21
Reply with quote
You prefer this?

Code:
$n= 1 +
$g;
$x= dosomething();
$g= 3 *
$v;
View user's profileFind all posts by markh1Send private message
IDE does not indent chained methods ('->' at end or beg)
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic