Skip to content
This repository was archived by the owner on Jul 12, 2020. It is now read-only.
This repository was archived by the owner on Jul 12, 2020. It is now read-only.

Unset operations are not seen as changing a value #71

Description

@AJenbo
    function test()
    {
        $userHelper = [1,2];
        unset($options[0]);
    }

Refactoring the secound line in the function will fail to take account for the unsetting changing $options and it needing to be retuned or passed by reference.

    function test()
    {
        $options = [1,2];
        $this->asd($options);
    }

    private function asd($options)
    {
        unset($options[0]);
    }

expected

    function test()
    {
        $options = [1,2];
        $options = $this->asd($options);
    }

    private function asd($options)
    {
        unset($options[0]);
        return $options;
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions