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 Remainder of Calculation vs. Phpstan Issues #3108

Merged
merged 5 commits into from
Oct 13, 2022

Conversation

oleibman
Copy link
Collaborator

@oleibman oleibman commented Oct 7, 2022

I had tried to include these changes as part of an earlier effort, but something about them broke Phpstan. I removed them until I could determine the actual cause, which is ...

The array $phpSpreadsheetFunctions is a very large and very complicated array, typehinted as array. It is declared as private static; however, its content never changes (at least not now - there are some outstanding proposals that might change that). I have had some success with changing unmodifiable private static to private const. However, such a change here causes Phpstan to perform a lot more processing and eventually time out. So, leave it as static.

Having identified the cause of the problem, none of the other changes were problematic, so this PR applies the rest of them.

This is:

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

Checklist:

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.

I had tried to include these changes as part of an earlier effort, but something about them broke Phpstan. I removed them until I could determine the actual cause, which is ...

The array `$phpSpreadsheetFunctions` is a very large and very complicated array, typehinted as `array`. It is declared as private static; however, its content never changes (at least not now - there are some outstanding proposals that might change that). I have had some success with changing unmodifiable private static to private const. However, such a change here causes Phpstan to perform a lot more processing and eventually time out. So, leave it as static.

Having identified the cause of the problem, none of the other changes were problematic, so this PR applies the rest of them.
One problem.
@oleibman
Copy link
Collaborator Author

oleibman commented Oct 7, 2022

Not even remotely concerned by Scrutinizer failing due to complexity ratings, which Scrutinizer itself caused by requiring additional tests.

@oleibman oleibman merged commit befbc56 into PHPOffice:master Oct 13, 2022
@oleibman oleibman deleted the calcconst branch October 20, 2022 19: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.

1 participant