php-coding-standards icon indicating copy to clipboard operation
php-coding-standards copied to clipboard

Add check for Emacs UTF-8 file header

Open tyrann0us opened this issue 4 years ago • 0 comments
trafficstars

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.

tyrann0us avatar Jun 25 '21 14:06 tyrann0us