Skip to content

Last 3.x minor | Hard deprecate sniffs setting the $supportedTokenizers property #740

Closed
@jrfnl

Description

@jrfnl

Support for the JS and CSS Tokenizers will be removed in PHPCS 4.0.

This was announced in squizlabs/PHP_CodeSniffer#2448 and has been formalized via a soft deprecation (documentation and changelog only) in the PHPCS 3.9.0 release (see #276).

A deprecation notice should be shown for sniffs which comply with these conditions:

  1. Set the (public) $supportedTokenizers property on a sniff to a value which does not include PHP.
  2. Do not implement the DeprecatedSniff interface (see ✨ Native handling of sniff deprecations #281).

To be determined

I'm not yet sure what to do about sniffs which set the property to a value which includes both PHP as well as CSS and/or JS.
Throwing a deprecation notice for those feels noisy, as removing support for CSS/JS from the sniff would be a breaking change and would therefore require a new major release, so a deprecation notice would not be actionable for sniff maintainers (including for PHPCS itself).

Opinions welcome.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions