Skip to content

Configure exceptions ignored for Squiz.Commenting.FunctionCommentThrowTag #3202

@ComiR

Description

@ComiR

I'd like to exclude specific exceptions from the Squiz.Commenting.FunctionCommentThrowTag sniff.

With this rule configuraion:

<rule ref="Squiz.Commenting.FunctionCommentThrowTag">
	<properties>
		<property name="excludedExceptions" type="array" value="\MyNamespace\NeverThrownException"/>
	</properties>
</rule>

The following should be valid:

class SomeClass
{
	/**
	 * @return \DateTime
	 */
	function someMethod()
	{
		try {
			return new \DateTime();
		} catch (\Exception $e) {
			throw new \MyNamespace\NeverThrownException(1611660216231, $e);
		}
	}
}

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