RedundantCast
A value is cast to a type it already has.
Example
Section titled “Example”<?phpfunction wrap(int $n): int { return (int) $n; // $n is already an int}How to fix
Section titled “How to fix”Remove the unnecessary cast.
A value is cast to a type it already has.
<?phpfunction wrap(int $n): int { return (int) $n; // $n is already an int}Remove the unnecessary cast.