Closed (fixed)
Project:
Charts
Version:
5.1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
8 Apr 2025 at 19:31 UTC
Updated:
28 Apr 2025 at 21:04 UTC
Jump to comment: Most recent
Fix issues raised by phpstan.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
liam morlandThe commit adding
drupal:views_uitotest_dependencieswas intended to fix this error: "Function views_ui_build_form_url not found." It does not fix it.The other phpstan issues are all about adding dependency injection.
Comment #4
bluegeek9 commentedI have a question about: src/Form/ChartsConfigForm.php
Is the form referenced in other projects? I only see the form used once. I am not sure how it could be called and the services would be null.
Comment #5
nikathone@bluegeek9 we did that to make the config form backwards compatible in case another user/module have extended the module before we add those dependencies.
In the future major version upgrade of chart we will remove the ternary operators.
Comment #6
bluegeek9 commentedI need to add tests.
Comment #7
andileco commented@bluegeek9, I see everything is green. Is there more you wanted to do on this, or is it ready for review?
Comment #8
bluegeek9 commentedI want to add tests. I also want to add the file system service as a dependency to the form. I want to replace file_exists with the service so it can be mocked/tested.
It should need review by end of day.
P.S. I was able to resolve "Function views_ui_build_form_url not found." by adding views_ui to the phpstan.neon. It worked locally, but to work in gitlab it needed the full, not relative path. The full path changes with each issue. I resorted to using phpstan-ignore.
Comment #9
bluegeek9 commentedComment #11
andileco commented