Skip to content

Add rule for space after cast and space after Not #76

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

Merged
merged 5 commits into from
Nov 17, 2023
Merged

Conversation

antonioeatgoat
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)

What kind of change does this PR introduce?
New feature.

What is the current behavior?
There are no checks on spaces after cast or spaces after Not operator. All the following lines pass the test:

  • (string) $variable
  • (string)$variable
  • $variable = !$variable
  • $variable = ! $variable
  • if (!$variable)
  • if (! $variable)

What is the new behavior?
The space after cast and Not operator is mandatory. These are the only accepted cases:

  • (string) $variable
  • $variable = ! $variable
  • if (! $variable)

Does this PR introduce a breaking change?
No

Other information:
Both of the changes are addressable by phpcbf script.

@antonioeatgoat antonioeatgoat linked an issue Oct 27, 2023 that may be closed by this pull request
1 task
There will be a lot of fun.
@gmazzap
Copy link
Contributor

gmazzap commented Nov 15, 2023

@antonioeatgoat Thank you for the PR.
Can we split the space after the cast from the space after the "not" operator?

@antonioeatgoat
Copy link
Contributor Author

@gmazzap done 👍

@gmazzap gmazzap merged commit b109e05 into version/2 Nov 17, 2023
@gmazzap gmazzap deleted the feature/55 branch November 17, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Add check for whitespace after type casting
2 participants