opensourcepos icon indicating copy to clipboard operation
opensourcepos copied to clipboard

PSR-2 Compliance issue: Closing `?>` tag in files that contain only PHP

Open objecttothis opened this issue 4 years ago • 3 comments

Background information

According to the PSR-2 coding standard (which CI code adhere's to), we should be leaving off the closing ?> tag in files that only contain PHP (i.e., Models, Controllers, Helpers, Libraries)

See Section 2.2 (https://www.php-fig.org/psr/psr-2/)

  • PHPStorm is complaining about it.
  • The accepted answer in this stackoverflow question gives some really good reasons to do it: https://stackoverflow.com/questions/4410704/why-would-one-omit-the-close-tag. It's an old answer, but I think it's still relevant.

objecttothis avatar Sep 23 '21 09:09 objecttothis

Fine by me.

jekkos avatar Sep 30 '21 19:09 jekkos

If we consider doing these kind of changes, then it might be best to do it in one go and one commit.

jekkos avatar Sep 30 '21 19:09 jekkos

Agreed. We need to make it a single commit in it's own PR rather than piggybacking on another PR.

objecttothis avatar Sep 30 '21 19:09 objecttothis

Looks like this is done in ci4-branch

objecttothis avatar Dec 12 '23 08:12 objecttothis