PHP array declaration indentation

Is it possible to configure PHPStorm to format array declarations using standard indents as opposed to continuation indents? I am a Moodle developer and need to do this in order to adhere to Moodle's coding style guidelines on line wrapping at https://docs.moodle.org/dev/Coding_style#Wrapping_lines.

Currently I have PHPStorm configured with a standard indent of 4 spaces and a continuation indent of 8 spaces, but this causes array declarations to indent by 8 spaces, like a wrapped line, but I need them to indent by 4 spaces. NetBeans has an additional setting specifically for array declarations (screen shot below) and I was wondering if the same thing existed somewhere in PHPStorm.

Thanks,
Tony

2 comments

I wasn't able to find a quick way to workaround this and we do not have such setting.

You can request to add this setting at https://youtrack.jetbrains.com/issue/WI-33643

0

@Dmitry I think that is something different (special case for a single line array declaration). Seems like either a separate setting for "Array Declaration Indentation" (as per screenshot) or a checkbox like "Use continuation indent for array declarations" (on by default for backwards compat) would do the job.

1

Please sign in to leave a comment.