While following PSR-12 implementation on PHP-CS-Fixer, a comment indicated
a possible inconsistency in the PSR-12 text:
https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/4502#issuecomment-578006523
The issue is in the fact that chapter 4 says:
The term “class” refers to all classes, interfaces, and traits.
[...]
When instantiating a new class, parentheses MUST always be present even
when there are no arguments passed to the constructor.
But chapter 8 for anonymous classes says:
Anonymous Classes MUST follow the same guidelines and principles as
closures in the above section.
<?php
$instance = new class {};
Should we make this clearer?
--
You received this message because you are subscribed to the Google Groups "PHP
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/php-fig/4f9352d1-f65b-47bb-9c08-e06ecc6ece1f%40googlegroups.com.