Fix issues raised by phpstan

Created on 8 April 2025, 10 days ago

Fix issues raised by phpstan.

πŸ“Œ Task
Status

Active

Version

5.1

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Liam Morland
  • Pipeline finished with Success
    10 days ago
    Total: 424s
    #468635
  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    The commit adding drupal:views_ui to test_dependencies was 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.

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    I 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.

        $this->chartPluginManager = $chart_plugin_manager ?: \Drupal::service('plugin.manager.charts');
        $this->chartTypePluginManager = $chart_type_plugin_manager ?: \Drupal::service('plugin.manager.charts_type');
        $this->moduleExtensionList = $module_extension_list ?: \Drupal::service('extension.list.module');
    
  • πŸ‡¨πŸ‡¦Canada nikathone Ontario

    @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.

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    I need to add tests.

  • Pipeline finished with Success
    6 days ago
    Total: 307s
    #472005
  • Pipeline finished with Success
    6 days ago
    Total: 179s
    #472006
  • Pipeline finished with Success
    6 days ago
    Total: 205s
    #472017
  • Pipeline finished with Success
    6 days ago
    Total: 195s
    #472019
  • Pipeline finished with Success
    6 days ago
    Total: 194s
    #472020
  • Pipeline finished with Success
    6 days ago
    Total: 383s
    #472026
  • Pipeline finished with Success
    6 days ago
    Total: 374s
    #472029
  • πŸ‡ΊπŸ‡ΈUnited States andileco

    @bluegeek9, I see everything is green. Is there more you wanted to do on this, or is it ready for review?

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    I 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.

  • Pipeline finished with Success
    4 days ago
    Total: 494s
    #473270
  • Pipeline finished with Success
    4 days ago
    Total: 270s
    #473333
  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9
  • Pipeline finished with Skipped
    4 days ago
    #473361
  • πŸ‡ΊπŸ‡ΈUnited States andileco
Production build 0.71.5 2024