coding-standard icon indicating copy to clipboard operation
coding-standard copied to clipboard

SlevomatCodingStandard.TypeHints.DeclareStrictTypes and Squiz.Commenting.FileComment.SpacingAfterComment

Open kkmuffme opened this issue 7 months ago • 0 comments

	<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
		<properties>
			<property name="declareOnFirstLine" value="false"/>
			<property name="linesCountBeforeDeclare" value="0"/>
			<property name="linesCountAfterDeclare" value="1"/>
			<property name="spacesCountAroundEqualsSign" value="0"/>
		</properties>
	</rule>

If I have a file like:

<?php
declare(strict_types=1);

echo 'hello';

This makes sense. However if there is a PHPDoc

<?php
/**
 * foo
 */
declare(strict_types=1);

echo 'hello';

This will clash with Squiz.Commenting.FileComment.SpacingAfterComment and report an error Maybe add an option <property name="linesCountBeforeDeclareAfterDocblock" value="1"/> to prevent this?

kkmuffme avatar Apr 29 '25 11:04 kkmuffme