Formatting for arrays
8 posts
• Page 1 of 1
Formatting for arrays
Hi there,
When I past the following code it looks like this:
Then I have to do all this indenting to make it look more readable, like this:
It would be fantastic if PHP Tools did this formatting for me.
Regards,
Scott
When I past the following code it looks like this:
- Code: Select all
public $components = array(
'Session',
'Auth' => array(
'loginAction' => array(
'controller' => 'users',
'action' => 'login'
),
array('authorize' => array('Controller'))
)
);
Then I have to do all this indenting to make it look more readable, like this:
- Code: Select all
public $components = array(
'Session',
'Auth' => array(
'loginAction' => array(
'controller' => 'users',
'action' => 'login'
),
array('authorize' => array('Controller'))
)
);
It would be fantastic if PHP Tools did this formatting for me.
Regards,
Scott
- codeowl
- Posts: 51
- Joined: February 10th, 2013, 10:05 am
Re: Formatting for arrays
Good Idea and I also vote for "configurable brakets placement", as I like the ( on a new line ...
- CFI
- Posts: 66
- Joined: December 13th, 2012, 1:29 pm
Re: Formatting for arrays
Hi Guys,
Formatting in the current version defines all multiline expressions (e.g. function call or array definition) as user defined formatting. That means we just respect how user formats this as everyone wants it little bit differently. So during formating we just move whole block but won't interfere with the formating that user used.
In the next stage of formatting engine when we can provide more options to choose from we will include formatting of these expressions.
Thanks,
Miloslav
Formatting in the current version defines all multiline expressions (e.g. function call or array definition) as user defined formatting. That means we just respect how user formats this as everyone wants it little bit differently. So during formating we just move whole block but won't interfere with the formating that user used.
In the next stage of formatting engine when we can provide more options to choose from we will include formatting of these expressions.
Thanks,
Miloslav
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
Re: Formatting for arrays
Miloslav,
Thanks for the response mate. I don't see that happening here. In VS, on a .php page in a <?php ?> element, if I write and array formatted like the second code block in my post, eg; indented, and then copy that formatted code to the clipboard, and then paste it back two lines down from the original, it will be completely un-formatted, like the first block of code in my post...
So how does your statement:
"So during formatting we just move whole block but won't interfere with the formatting that user used."
apply to this scenario?
Regards,
Scott
Thanks for the response mate. I don't see that happening here. In VS, on a .php page in a <?php ?> element, if I write and array formatted like the second code block in my post, eg; indented, and then copy that formatted code to the clipboard, and then paste it back two lines down from the original, it will be completely un-formatted, like the first block of code in my post...
So how does your statement:
"So during formatting we just move whole block but won't interfere with the formatting that user used."
apply to this scenario?
Regards,
Scott
- codeowl
- Posts: 51
- Joined: February 10th, 2013, 10:05 am
Re: Formatting for arrays
Scott,
Thanks for reporting this. It's a bug when array is directly used as a class member initialization, will be fixed for the next minor update.
Regards,
Miloslav
Thanks for reporting this. It's a bug when array is directly used as a class member initialization, will be fixed for the next minor update.
Regards,
Miloslav
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
Re: Formatting for arrays
Miloslav,
Great work mate, thanks for following this up
Regards,
Scott
Great work mate, thanks for following this up
Regards,
Scott
- codeowl
- Posts: 51
- Joined: February 10th, 2013, 10:05 am
Re: Formatting for arrays
Thanks Scott,
This has been fixed and it will be available in the following update.
Btw. Thanks for a great review on vs gallery! It made my day.
This has been fixed and it will be available in the following update.
Btw. Thanks for a great review on vs gallery! It made my day.
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
Re: Formatting for arrays
Miloslav,
Thanks for following up on this mate.
You guys earned the good review, keep up the great work
Regards,
Scott
Thanks for following up on this mate.
You guys earned the good review, keep up the great work
Regards,
Scott
- codeowl
- Posts: 51
- Joined: February 10th, 2013, 10:05 am
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 4 guests