Method wrapping not working as I expect

I am having trouble figuring out how to get the code to stop trying to wrap the function on a new line after an access modifier.

Here's what I want the code to look like...

public function doAction($iParam1, $iParam2, $iParam3,
                                       $iParam4, $iParam5, $iParam6,
                                       $iParam7) {
         ....
}

It's reformatting code to look like this...

public
     function doAction($iParam1, $iParam2, $iParam3,
                                 $iParam4, $iParam5, $iParam6,
                                 $iParam7
) {
         ....
}

Close but no cigar!

4 comments
Comment actions Permalink

Is the function inside a class? The formatting may get broken if you have an invalid syntax, for example, if "public" keyword is not allowed in this context.

0
Comment actions Permalink

It's definitely inside a class.  The class has no access modifer

ie:
class ClassName
{
     ....
}

Would that make a difference?  This is pretty crufty code, and a fairly large code base so it'll be a near impossible to fix if it.  Hopefully you can find a way to make it deal with little nuances like this.  I'm a huge Resharper fan and I am hoping this tool will give me the ability to start cleaning up stuff as I worked on files.  But with this particular issue I can't use the code-cleanup option at the moment.

Hopefully it's just a setting I am missing, I'll keep waiting for more potential answers.

0
Comment actions Permalink

Thanks for reporting the issue. I think I've finally got your point. So you already have the "function" keyword on
the next line in your existing code and you would like the formatter to remove this extra EOL between "public" and "function". Am I right?

0

Please sign in to leave a comment.