Skip to content
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

fix: Allow vAlign and vMerge on Style\Cell to be set to null #2676

Conversation

SpraxDev
Copy link
Contributor

@SpraxDev SpraxDev commented Sep 13, 2024

Description

vAlign and vMerge are initialized as null until it is explicitly set. Right now, it is not possible to unset them, after it has been set once.

I've added a null-check to skip the validation, based on the default parameter value of null, which indicates to me that it once was intended to work like this.

I've also fixed the type-hints, which were wrong from the start.

Fixes #2673

Checklist:

  • My CI is 🟢
  • I have covered by unit tests my new code (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes (does not apply)
  • I have updated the changelog

@SpraxDev

This comment was marked as outdated.

@SpraxDev SpraxDev changed the title fix: Allow vAlign and vMerge on Style\Cell to be set to null (#2673) fix: Allow vAlign and vMerge on Style\Cell to be set to null Sep 13, 2024
@SpraxDev SpraxDev marked this pull request as ready for review September 13, 2024 10:04
@Progi1984
Copy link
Member

@SpraxDev #2675 is merged.

@coveralls
Copy link

coveralls commented Sep 13, 2024

Coverage Status

coverage: 96.918% (+0.002%) from 96.916%
when pulling 2226a11 on SpraxDev:fix/allow-unsetting-cell-style-vmerge-valign
into fa0cea0 on PHPOffice:master.

…ce#2673)

vAlign and vMerge are initialized as `null` in every style until it is explicitly set.
Right now, it is not possible to unset them, after it has been set once.

I've added a null-check to skip the validation, based on the default
parameter value of `null`, which indicates to me that it once was intended to work like this.

I've also fixed the type-hints, which were wrong from the start.
@SpraxDev SpraxDev force-pushed the fix/allow-unsetting-cell-style-vmerge-valign branch from 6ca43db to 116be46 Compare September 13, 2024 10:39
@SpraxDev
Copy link
Contributor Author

Thanks @Progi1984! I've pushed the test changes

This should fix the reduction in test coverage because of the
new null checking code in the Setter
@Progi1984 Progi1984 merged commit f0ec497 into PHPOffice:master Sep 13, 2024
13 checks passed
@Progi1984
Copy link
Member

@SpraxDev Thanks again for your contribution 🤟

@SpraxDev SpraxDev deleted the fix/allow-unsetting-cell-style-vmerge-valign branch September 13, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Style/Cell.php does not accept null values to unset some values
3 participants