Skip to content

AbstractPatternSniff::__construct(): remove the $ignoreComments property #974

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
AbstractPatternSniff::__construct(): remove the $ignoreComments property
PHPCS deprecated the `$ignoreComments` parameter of the `AbstractPatternSniff::__construct()` sniff in version 1.4.0.

> - AbstractPatternSniff now sets the ignoreComments option using a public var rather than through the constructor
>     - This allows the setting to be overwritten in ruleset.xml files
>     - Old method remains for backwards compatibility

Time to remove this dead code.

Related to 6
  • Loading branch information
jrfnl committed Apr 14, 2025
commit c38e7e4265f9d297932ac3f558c8b54d1d7b6f44
9 changes: 1 addition & 8 deletions src/Sniffs/AbstractPatternSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,9 @@ abstract class AbstractPatternSniff implements Sniff

/**
* Constructs a AbstractPatternSniff.
*
* @param boolean $ignoreComments If true, comments will be ignored.
*/
public function __construct($ignoreComments=null)
public function __construct()
{
// This is here for backwards compatibility.
if ($ignoreComments !== null) {
$this->ignoreComments = $ignoreComments;
}

$this->supplementaryTokens = $this->registerSupplementary();

}//end __construct()
Expand Down