Skip to content

[Issue] Cleanup: don't use void return value from method calls.  #882

Open
@m2-assistant

Description

This issue is automatically created based on existing pull request: #881: Cleanup: don't use void return value from method calls.


Description (*)

This is just some minor cleanup. We called a method that didn't return anything (void) and then used that result value. Which is really not needed.

Found issue while running phpstan on level 0 on the entire codebase:

$ vendor/bin/phpstan analyse -c ./dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon --level=0 . | grep -B3 'is used'
 20783/20783 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
 ------ ------------------------------------------------------------------------------------------------------
  Line   ext/magento/magento2-page-builder/app/code/Magento/PageBuilder/Controller/Adminhtml/Stage/Render.php
 ------ ------------------------------------------------------------------------------------------------------
  39     Result of method Magento\Backend\App\AbstractAction::__construct() (void) is used.
--

This is my ongoing effort on getting the entire Magento codebase clean so running phpstan on level 0 no longer gives any errors anymore (after this PR, we have about ~440 issues to go still ...)

Also see this related PR: magento/magento2#39516

Story

?

Bug

?

Task

?

Fixed Issues (if relevant)

N/A

Builds

?

Related Pull Requests

magento/magento2#39516

Manual testing scenarios (*)

  1. In theory, nothing should change at runtime by the changes introduced here, not sure what needs to be tested except for the phpstan check ...
  2. If you do want to test the output of PHPstan, maybe best run it on ext/magento/magento2-page-builder/ directory only, as running it on the entire Magento codebase might take a very long time (multiple hours sometimes, depending on how strong your machine is) ...

Questions or comments

Check the first commit to see the real changes, the second commit deals with fixing static test failures.

Checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions