I have configured my PhpStorm to use Zend for Code Style
PhpStorm | Preferences | Editor | Code Style | PHP | Set from Zend
The result for PhpStorm reformat looks like this:
<?php
return [
'url_images' => '/img',
'url_images_email' => 'http://website.mine.amazonaws.com/img/mail',
'url_images_profile' => '//test.http://website.mine',
'url_images_editorial_team' => '//http://website.mine/images/tips1',
'url_images_profile_product' => '//http://website.mine/images/tips1',
'url_images_cms' => 'https://http://website.mine/wp-content/uploads',
];
For my existing codebase, with hundreds of files, I want to reformat the code to also follow Zend code style, so I am running
./vendor/bin/phpcbf --standard=Zend config/autoload/image.development.php
The result of running this command looks like this:
<?php
return [
'url_images' => '/img',
'url_images_email' => 'http://website.mine.amazonaws.com/img/mail',
'url_images_profile' => '//test.http://website.mine',
'url_images_editorial_team' => '//http://website.mine/images/tips1',
'url_images_profile_product' => '//http://website.mine/images/tips1',
'url_images_cms' => 'https://http://website.mine/wp-content/uploads',
];
So the alignment after the equal sign is obviously different.
Now I know there are many options to configure phpcs using phpcs.xml, but the ones I have have tried, did not bring any improvements...
Here is my existing phpcs.xml
file (in case it is needed):
<ruleset name="Zend Framework Coding Standard">
<description>Zend Framework Coding Standard</description>
<!-- display progress -->
<arg value="p"/>
<arg name="colors"/>
<!-- inherit rules from: -->
<rule ref="PSR2"/>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.Formatting.SpaceAfterNot"/>
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>
<file>config</file>
</ruleset>
My question is: How do I get the phpcs/phpcbf exactly to be like the default setting for Zend on PhpStorm?