Skip to content

ReturnTypeWillChange attribute triggers error, false positive #99

Open
@dafeder

Description

@dafeder

#[\ReturnTypeWillChange] is an attribute added in PHP 8.1, which "signals that a mismatching tentative return type should not emit a deprecation notice". In my local environment, this is not throwing any errors in PHPCS, but CodeClimate reports it as an error:

image

The actual attribute can't be seen there, but the code being checked looks like this:

  /**
   * {@inheritDoc}
   */
  #[\ReturnTypeWillChange]
  public function jsonSerialize() {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions