-function foo(sTrIng $str): sTrIng {}
+function foo(string $str): string {}
-function foo(ITERABLE $arr): ITERABLE {}
+function foo(iterable $arr): iterable {}
-function foo(Int $num): Int {}
+function foo(int $num): int {}
-function foo(fLOAT $num): fLOAT {}
+function foo(float $num): float {}
Maybe in type castings as well:
-$foo = (sTrInG) $foo;
+$foo = (string) $foo;
There is already https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/2.10/src/Fixer/CastNotation/LowercaseCastFixer.php for that
Ah right, I searched in the Casing namespace only :)
Then I would deprecate this one in favor of the new one, which would cover both type hints and type castings, WDYT?
I'm ok: before spending time on code I need @keradus feedback if he's ok with this approach.
better not call it lowercase something, as you could fix the casing of stdClass (and other predefined classes as well)
If we are able to prepare general solution that will fix casing everywhere for built-in types, I'm :+1:
Like we do for true/false/null constants, we don't care where they are used, we always fix casing.
@SpacePossum this should be tagged with has PR