Open KorvinSzanto opened 6 years ago
These keywords aren't functions and afaict they aren't effected by that fixer. For example:
<?php
function foo(String $bar, Iterable $list)
{
...
}
should become foo(string $bar, iterable $list)
.
From what I was able to find out last year is that the SPL tokenizer doesn't recognize those keywords
I think we have to wait for concrete5 version 9 in order to use the native_function_type_declaration_casing
fixer, since it has been introduced in PHP-CS-Fixer 2.15, which requires PHP 5.6+.
What I'd do is to adopt the rules defined in https://github.com/concrete5/concrete5/pull/7810 which cover many rules (see here) that we currently don't follow.
When we'll be able to use a newer PHP-CS-Fixer option, we can add more rules there.
Most reserved types are covered, but
iterable
and scalar type hints are not. This likely needs a new fixer that can parse theT_STRING
values and detect these missing types and lowercase them. From what I can tell, the SPL tokenizer doesn't recognize them.