Skip to content

[Feature Request]: Add check for Emacs UTF-8 file header #50

@tyrann0us

Description

@tyrann0us

Is your feature request related to a problem? Please describe.
At Inpsyde, PHP files used to have the following file header:

<?php # -*- coding: utf-8 -*-

or

<?php declare(strict_types=1); // -*- coding: utf-8 -*-

As of 2021-06-25, there are more than 15.000 PHP files with this header. It originates from Emacs and including it was adapted by developers undiscussed for years.

However, (nowadays) it doesn't make any sense to keep it. In fact, it is no longer used in most new packages and should be removed gradually from legacy packages too.

Describe the solution you'd like

  • Add a coding standard check for the header that warns the user if the header is present.
  • Make sure that phpcbf deletes it.

Describe alternatives you've considered
None.

Additional context
None.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions