Skip to content

Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value #53612

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

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 5.4
Bug fix? no
New feature? no
Deprecations? no
Issues -
License MIT

This one is important to make on 5.4 because it will likely fix a deprecation in a future PHP version, see https://externals.io/message/122214

(do not squash while merging)

@nicolas-grekas
Copy link
Member Author

/cc @keradus FYI

I think we should also make the null default value explicit for untyped properties. What's the fixer for that? 👼

@@ -0,0 +1,2 @@
# Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
f4118e110a46de3ffb799e7d79bf15128d1646ea
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😮

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lyrixx
Copy link
Member

lyrixx commented Jan 23, 2024

I really prefer this way! Thanks 👍🏼

@nicolas-grekas nicolas-grekas force-pushed the nullable_type_declaration_for_default_null_value branch from a0f56ce to fb9fa26 Compare January 23, 2024 14:28
@nicolas-grekas nicolas-grekas merged commit 2a31f2d into symfony:5.4 Jan 23, 2024
@nicolas-grekas nicolas-grekas deleted the nullable_type_declaration_for_default_null_value branch January 23, 2024 14:31
@OskarStark
Copy link
Contributor

I really prefer this way! Thanks 👍🏼

Same here, this also makes diffs less noisy when converting to CPP 👏

@nicolas-grekas
Copy link
Member Author

Now merged up to 7.1, help wanted to fix tests :)

@keradus
Copy link
Member

keradus commented Jan 24, 2024

@nicolas-grekas , if you wonder about such fixer, I don't think it exists, feel encouraged to drop the PR for it

 <?php
 
 class X {
-    public string $name;
+    public ?string $name;
 }

@nicolas-grekas
Copy link
Member Author

-    public string $name;
+    public ?string $name;

Be careful this wouldn't be equivalent! So no, I won't want this rule anytime :)

@kbond kbond mentioned this pull request Feb 3, 2024
lyrixx added a commit to lyrixx/PHP-CS-Fixer that referenced this pull request Feb 6, 2024
weaverryan added a commit to symfony/ux that referenced this pull request Feb 7, 2024
This PR was merged into the 2.x branch.

Discussion
----------

CS Update

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Issues        | n/a
| License       | MIT

Updates to the latest Symfony CS rules.

Refs: PHP-CS-Fixer/PHP-CS-Fixer#7773 & symfony/symfony#53612

Commits
-------

aad4e17 minor: update cs
symfony-splitter pushed a commit to symfony/ux-turbo that referenced this pull request Feb 7, 2024
This PR was merged into the 2.x branch.

Discussion
----------

CS Update

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Issues        | n/a
| License       | MIT

Updates to the latest Symfony CS rules.

Refs: PHP-CS-Fixer/PHP-CS-Fixer#7773 & symfony/symfony#53612

Commits
-------

aad4e17d minor: update cs
symfony-splitter pushed a commit to symfony/ux-twig-component that referenced this pull request Feb 7, 2024
This PR was merged into the 2.x branch.

Discussion
----------

CS Update

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Issues        | n/a
| License       | MIT

Updates to the latest Symfony CS rules.

Refs: PHP-CS-Fixer/PHP-CS-Fixer#7773 & symfony/symfony#53612

Commits
-------

aad4e17d minor: update cs
symfony-splitter pushed a commit to symfony/stimulus-bundle that referenced this pull request Feb 7, 2024
This PR was merged into the 2.x branch.

Discussion
----------

CS Update

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Issues        | n/a
| License       | MIT

Updates to the latest Symfony CS rules.

Refs: PHP-CS-Fixer/PHP-CS-Fixer#7773 & symfony/symfony#53612

Commits
-------

aad4e17d minor: update cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy