8000 SlevomatCodingStandard.TypeHints.DeclareStrictTypes and Squiz.Commenting.FileComment.SpacingAfterComment · Issue #1747 · slevomat/coding-standard · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
SlevomatCodingStandard.TypeHints.DeclareStrictTypes and Squiz.Commenting.FileComment.SpacingAfterComment #1747
Open
@kkmuffme

Description

@kkmuffme
	<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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0