Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SlevomatCodingStandard.Commenting.DocCommentSpacing crashes when using annotation groups and double quotes in text before annotations #1643

Open
kkmuffme opened this issue Dec 2, 2023 · 0 comments

Comments

@kkmuffme
Copy link

kkmuffme commented Dec 2, 2023

composer show | grep -E "(parser|slevomat)"
nikic/php-parser v4.17.1 A PHP parser written in PHP
phpstan/phpdoc-parser 1.24.4 PHPDoc parser with support for nullable, intersection and generic types
slevomat/coding-standard 8.14.1 Slevomat Coding Standard for PHP_CodeSniffer compl

PHP_CodeSniffer version 3.7.2 (stable)

Running phpcbf with config:

<?xml version="1.0"?>
<ruleset name="debug">
	<description>debugging</description>
	<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
		<properties>
			<property name="annotationsGroups" type="array">
				<element value="@param"/>
			</property>
		</properties>
	</rule>
</ruleset>

For file: (this seems weird, but this is the minimal reproducer, in reality the code comment makes more sense, but I removed everything that isn't strictly necessary to reproduce the issue)

<?php
/**
 * x - y"
 * z - m"
 *
 * @param string $a
 * @param string $b
 */
function foo($a, $b) {}

It seems similar to #1608 that the issue happens with the double quotes " (but no backtick in this case, additionally the config is slightly different)

Afaik this issue didn't happen at the time I reported the other issue, so it might be a bug introduced since parse 4.16.0 und 4.17.1 or something in slevomat between 8.13.4 and 8.14.1, but I'm not 100% sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant