Skip to content

feat: Deprecate CompactNullableTypehintFixer and proxy to CompactNullableTypeDeclarationFixer#7339

Merged
keradus merged 3 commits intoPHP-CS-Fixer:masterfrom
localheinz:fix/compact-nullable-typehint
Sep 29, 2023
Merged

feat: Deprecate CompactNullableTypehintFixer and proxy to CompactNullableTypeDeclarationFixer#7339
keradus merged 3 commits intoPHP-CS-Fixer:masterfrom
localheinz:fix/compact-nullable-typehint

Conversation

@localheinz
Copy link
Copy Markdown
Member

This pull request

  • deprecates the CompactNullableTypehintFixer and proxies to CompactNullableTypeDeclarationFixer

Follows #7338.

💁‍♂️ Also see https://www.php.net/manual/en/language.types.declarations.php.

@localheinz localheinz self-assigned this Sep 27, 2023
@localheinz localheinz changed the title Fix: Deprecate CompactNullableTypehintFixer and proxy to CompactNullableTypeDeclarationFixer fix: Deprecate CompactNullableTypehintFixer and proxy to CompactNullableTypeDeclarationFixer Sep 27, 2023
@localheinz localheinz force-pushed the fix/compact-nullable-typehint branch from 91ba5fd to 8ea0554 Compare September 27, 2023 15:46
@localheinz localheinz marked this pull request as ready for review September 27, 2023 15:59
@localheinz localheinz removed their assignment Sep 27, 2023
@Wirone Wirone changed the title fix: Deprecate CompactNullableTypehintFixer and proxy to CompactNullableTypeDeclarationFixer feat: Deprecate CompactNullableTypehintFixer and proxy to CompactNullableTypeDeclarationFixer Sep 27, 2023
@Wirone
Copy link
Copy Markdown
Member

Wirone commented Sep 27, 2023

I am wondering if we should remove, or reduce test class for deprecated fixer, which now only acts as proxy 🤔. It does not make sense to run these test cases twice. @keradus what is the correct approach?

@keradus
Copy link
Copy Markdown
Member

keradus commented Sep 27, 2023

I'm OK to keep duplicated test cases (one under old fixer name, one under new fixer name) or integration tests for both, old and new fixer, so we ensure both works the same - if proxy fixer would get broken due to whatever reason, we want to detect that. and sometimes proxy fixers are easy, but sometimes they apply some configuration or multiple new fixers, and things can get messy. also, integration tests are helping us to ensure proper priorities.

if possible , I would consider to avoid code duplication for utests, eg maybe deprecated fixer can reuse the tests class from new fixer (CompactNullableTypehintFixerTest extends CompactNullableTypeDeclarationFixerTest)

@localheinz localheinz force-pushed the fix/compact-nullable-typehint branch from 8ea0554 to 0a6ba08 Compare September 27, 2023 18:55
@localheinz localheinz force-pushed the fix/compact-nullable-typehint branch from 18e173e to b6d367b Compare September 27, 2023 18:56
@localheinz
Copy link
Copy Markdown
Member Author

@keradus

if possible , I would consider to avoid code duplication for utests, eg maybe deprecated fixer can reuse the tests class from new fixer (CompactNullableTypehintFixerTest extends CompactNullableTypeDeclarationFixerTest)

How about b6d367b?

@coveralls
Copy link
Copy Markdown

coveralls commented Sep 27, 2023

Coverage Status

coverage: 94.652% (-0.009%) from 94.661% when pulling 390933e on localheinz:fix/compact-nullable-typehint into 48da0d6 on PHP-CS-Fixer:master.

@keradus keradus merged commit fad7e08 into PHP-CS-Fixer:master Sep 29, 2023
@localheinz localheinz deleted the fix/compact-nullable-typehint branch September 29, 2023 13:59
@localheinz
Copy link
Copy Markdown
Member Author

Thank you, @keradus and @Wirone!

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.

4 participants