-
Notifications
You must be signed in to change notification settings - Fork 26
Spaces in type casting #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Currently there's no requirement for it. |
Maybe create this requirement?
|
@Crell, @KorvinSzanto thoughts? |
I've only ever seen it without a space: |
php-cs-fixer adds a space by default: https://cs.symfony.com/doc/rules/cast_notation/cast_spaces.html. |
PSR-12, Laminas, and the PHP docs all also add spaces. I can't really think of a good reason to omit this so I'd be okay with adding this for typecasts. Something like
|
If that's the de facto consensus, I don't have a strong argument to not follow it on this one. Sounds like we need a PR. |
Are there any requirements regarding spaces in type casting? There is the requirement:
Type casting operators MUST NOT have any space within the parentheses
But what about the space between the type and the expression? I.e.
$intValue = (int) $input;
or
$intValue = (int)$input;
The text was updated successfully, but these errors were encountered: