Skip to content

Use Lowercase in Deprecation Annotations #3166

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

Closed
wants to merge 6 commits into from

Conversation

oleibman
Copy link
Collaborator

Fix #3162. There are 434 deprecation annotations in 24 source members. Of these, 405 annotations in 13 members use an uppercase D, which causes them to be ignored by IDE's and Scrutinizer. Some of the accompanying 'see' annotations also use uppercase and should be corrected. There is a blank line before some of the 'see' annotations which should be removed, some of the 'see' are not located near 'deprecated', and some of them have no blank between asterisk and at-sign. My initial commit will just make these changes, but I suspect that Scrutinizer will have a lot to say as a result.

This is:

- [x] a bugfix
- [ ] a new feature
- [ ] refactoring
- [ ] additional unit tests

Checklist:

  • Changes are covered by unit tests
    • Changes are covered by existing unit tests
    • New unit tests have been added
  • Code style is respected
  • Commit message explains why the change is made (see https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
  • CHANGELOG.md contains a short summary of the change
  • Documentation is updated as necessary

Why this change is needed?

Provide an explanation of why this change is needed, with links to any Issues (if appropriate).
If this is a bugfix or a new feature, and there are no existing Issues, then please also create an issue that will make it easier to track progress with this PR.

Fix PHPOffice#3162. There are 434 deprecation annotations in 24 source members. Of these, 405 annotations in 13 members use an uppercase D, which causes them to be ignored by IDE's and Scrutinizer. Some of the accompanying 'see' annotations also use uppercase and should be corrected. There is a blank line before some of the 'see' annotations which should be removed, some of the 'see' are not located near 'deprecated', and some of them have no blank between asterisk and at-sign. My initial commit will just make these changes, but I suspect that Scrutinizer will have a lot to say as a result.
@oleibman
Copy link
Collaborator Author

oleibman commented Nov 12, 2022

As predicted, Scrutinizer now finds 314 deprecation issues in 217 files. It'll take at least a day, and possibly several, to deal with those. Thankfully, only 8 of those are in source code. 1 is in a sample, and the rests are in tests.

217 files are now revealed to have deprecated code. This commit fixes the 8 source members and 1 sample. This will give me the option of fixing the test members in a separate PR or PRs.
Also include a small number of non-Calculation tests with this PR.
This might be as far as I go with this PR.
Performance opportunities.
I think both Scrutinizer and Documentor will handle these. No changes to anything but doc blocks in this commit.
oleibman added a commit to oleibman/PhpSpreadsheet that referenced this pull request Nov 16, 2022
I think it's best to install these before PR PHPOffice#3166. There are no changes to source code, only to test members which continue to inadvertently use calls to deprecated functions.
oleibman added a commit to oleibman/PhpSpreadsheet that referenced this pull request Nov 16, 2022
I think it's best to install these before PR PHPOffice#3166. There are no changes to source code, only to test members which continue to inadvertently use calls to deprecated functions.
oleibman added a commit to oleibman/PhpSpreadsheet that referenced this pull request Nov 16, 2022
I think it's best to install these before PR PHPOffice#3166. There are no changes to source code, only to test members which continue to inadvertently use calls to deprecated functions.
@oleibman oleibman marked this pull request as draft November 17, 2022 03:06
@oleibman
Copy link
Collaborator Author

Converting to draft. I think it is better to subdivide this change into several PRs. I have pushed 3 of those and expect at least 5 more.

oleibman added a commit to oleibman/PhpSpreadsheet that referenced this pull request Nov 17, 2022
I think it's best to install these before PR PHPOffice#3166. There are no changes to source code, only to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.
oleibman added a commit to oleibman/PhpSpreadsheet that referenced this pull request Nov 17, 2022
I think it's best to install these before PR PHPOffice#3166. There are no changes to source code, only to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.
oleibman added a commit to oleibman/PhpSpreadsheet that referenced this pull request Nov 17, 2022
I think it's best to install these before PR PHPOffice#3166. There are no changes to source code, only to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.
oleibman added a commit to oleibman/PhpSpreadsheet that referenced this pull request Nov 17, 2022
I think it's best to install these before PR PHPOffice#3166. There are no changes to source code, only to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.
oleibman added a commit to oleibman/PhpSpreadsheet that referenced this pull request Nov 17, 2022
I think it's best to install these before PR PHPOffice#3166. This one, which I hope to be the last in this series, does have some minor changes to source code, as well as to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.
oleibman added a commit that referenced this pull request Nov 22, 2022
* Fix Unintential Deprecated Calls in Tests - LOOKUPREF

I think it's best to install these before PR #3166. There are no changes to source code, only to test members which continue to inadvertently use calls to deprecated functions.

* Fix deprecation DocBlocks

Deprecated->deprecated, adjust see and comments

* One Intentional Deprecation

Annotate it.
oleibman added a commit that referenced this pull request Nov 22, 2022
* Fix Unintential Deprecated Calls in Tests - INFORMATION

I think it's best to install these before PR #3166. There are no changes to source code, only to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.

* Missed Some Deprecated Calls

Fix them now.
oleibman added a commit that referenced this pull request Nov 23, 2022
* Fix Unintential Deprecated Calls in Tests - DATABASE

I think it's best to install these before PR #3166. There are no changes to source code, only to test members which continue to inadvertently use calls to deprecated functions.

* Fix deprecation Blocks

Deprecated->deprecated, adjust see and comments

* Fix Deliberate Deprecated Tests

Add annotations.

* Change Unit Tests to Run in Spreadsheet Context

... rather than as direct calls. The major difference is that specifying an invalid column should result in an Excel error, not null. Minor code changes were needed, including to Statistical/Conditional which sometimes calls Database.

* Correct Some DocBlocks

Null is no longer a possible output for most of these functions.

* 2 Overlooked Tests

Change to run in spreadsheet context.

* T Function Should Return Null-String, not Null

Fix it.
oleibman added a commit that referenced this pull request Nov 23, 2022
* Fix Unintential Deprecated Calls in Tests - LOGICAL

I think it's best to install these before PR #3166. There are no changes to source code, only to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.

* Change Unit Tests to Run in Spreadsheet Context

They had been run as direct calls, which is not how most users would use them. Making this change exposed some minor coding errors - SWITCH needs to flatten its arguments, and IFERROR and IFNA were not handling a null testValue in the same manner as Excel.
oleibman added a commit that referenced this pull request Nov 24, 2022
* Fix Unintential Deprecated Calls in Tests - ENGINEERING

I think it's best to install these before PR #3166. There are no changes to source code, only to test members which continue to inadvertently use calls to deprecated functions.

* Fix deprecation DocBlocks

Deprecated->deprecated, adjust see and comments

* Fix Deliberate Deprecated Tests

Add annotations.

* Run Unit Tests in Spreadsheet Context

This turned up only one error, in IMSUB. The only group that still needs this is Statistical. Not sure if I will get to that quickly.
oleibman added a commit that referenced this pull request Nov 25, 2022
* Fix Unintential Deprecated Calls in Tests - FINANCIAL

I think it's best to install these before PR #3166. There are no changes to source code, only to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.

* Change Tests to Run in Spreadsheet Context

Found and fixed some problems with how MIRR handles errors.
oleibman added a commit that referenced this pull request Nov 25, 2022
* Fix Unintential Deprecated Calls - Everything Else

I think it's best to install these before PR #3166. This one, which I hope to be the last in this series, does have some minor changes to source code, as well as to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.

* Some Remaining Deprecations in Tests

Fix them now.

* Minor Docblock Updates

Worksheet::unprotectCellsByColumnAndRow was incorrect. Other changes are cosmetic, leading to slightly better documentation.

* Update Worksheet.php
oleibman added a commit that referenced this pull request Nov 25, 2022
* Fix Unintential Deprecated Calls in Tests - STATISTICAL

I think it's best to install these before PR #3166. There are no changes to source code, only to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.

* Missed One Deprecation

Fix it now.

* Run Tests in Spreadsheet Context

This is quite a bit more difficult for Statistical than for the other Calculation categories. This is partly because of the use of multi-dimensional matrices, and also because some arguments are interpreted differently when they come from a cell rather than entered directly in a formula. This push leaves 18 out of 89 test members unchanged, except that they are marked with a TODO to show that the work isn't finished. I will not revisit them as part of this PR, but probably will take a look in a subsequent ticket.
@oleibman
Copy link
Collaborator Author

Closing. All of the PRs intended to replace this one have now been merged.

@oleibman oleibman closed this Nov 25, 2022
@oleibman oleibman deleted the smalld1 branch December 4, 2022 01:22
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.

[Bug] @Deprecated annotations are not used by IDEs to show warnings
1 participant