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

PSR2 indentation inside a method #370

Closed
ahonnecke opened this issue Sep 1, 2017 · 6 comments
Closed

PSR2 indentation inside a method #370

ahonnecke opened this issue Sep 1, 2017 · 6 comments
Assignees
Labels

Comments

@ahonnecke
Copy link

    if ($productData->getVendorId()) {
        $vendorVariant->setVendor(
            $this->entityManager
            ->getReference(Vendor::class, $productData->getVendorId())
        );
    }

Should be:

    if ($productData->getVendorId()) {
        $vendorVariant->setVendor(
            $this->entityManager
                ->getReference(Vendor::class, $productData->getVendorId())
        );
    }
ejmr added a commit that referenced this issue Sep 2, 2017
GitHub-Issue: #370
Signed-off-by: Eric James Michael Ritz <[email protected]>
@ejmr
Copy link
Collaborator

ejmr commented Sep 2, 2017

@ahonnecke There is now a branch called fix-psr2-indent-inside-methods. Could you please do me the favor of fetching the latest code and testing out that change? I do not have a large codebase on hand that is meant to adhere to the PSR2 style, and so I do not want to merge that change into master without first making sure it doesn't break anything else---God knows that wouldn't be the first time that happened in a patch fixing an indentation problem, heh.

If everything seems to work ok with the version on that branch then I will further document the patch and merge it. But again, I would greatly appreciate you (or anyone) first testing it on a large set of PHP code meant to adhere to PSR2, to see if anything else is now incorrectly indented as a result.

Thanks for the bug report and thank you in advanced for any help with testing.

@ahonnecke
Copy link
Author

Thanks! It looks like it fixed the code I pasted, but had the side effect of indenting other code that should not be indented.

protected function resetEntityManager()
    {
        $this->entityManager = $this->getEntityManager()->create(
            $this->getEntityManager()->getConnection(),
                $this->getEntityManager()->getConfiguration()
        );
    }

Should be:

protected function resetEntityManager()
    {
        $this->entityManager = $this->getEntityManager()->create(
            $this->getEntityManager()->getConnection(),
            $this->getEntityManager()->getConfiguration()
        );
    }

@ejmr
Copy link
Collaborator

ejmr commented Sep 5, 2017

...but had the side effect of indenting other code that should not be indented.

Yeah, that's exactly what I was worried would happen, heh. Thank you for testing it and posting the new code that now does not indent correctly; that will help me figure out a better solution. I am sorry this is causing you problems and apologize that I (probably) will not have a quick fix, and will want your help testing again, but thank you again for both being patient and providing very helpful examples I can use for testing purposes.

@ahonnecke
Copy link
Author

Absolutely regarding helping. No worries :) I'm happy to help any way I can my lisp is pretty rusty but if there's a spot where it would be helpful for me to iterate on something I'd be happy to give it a shot.

@ejmr
Copy link
Collaborator

ejmr commented Sep 6, 2017

Just to provide a simple update, I am going to attempt to fix this simultaneously along with the recently reported #371 issue, since there is a reasonable chance they are related in one way or another.

@zonuexe zonuexe self-assigned this May 11, 2019
@zonuexe zonuexe added the Bug label May 11, 2019
@zonuexe
Copy link
Member

zonuexe commented Sep 17, 2022

Resolved in #703

@zonuexe zonuexe closed this as completed Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants