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

Equal sign alignment check broken when list syntax used before assignment operator #1922

Closed
linaori opened this issue Mar 6, 2018 · 3 comments · Fixed by #1924
Closed

Equal sign alignment check broken when list syntax used before assignment operator #1922

linaori opened this issue Mar 6, 2018 · 3 comments · Fixed by #1924
Milestone

Comments

@linaori
Copy link

linaori commented Mar 6, 2018

After updating from 3.2.2 to 3.2.3, the code fixer produces the following patches due to the codestyle check failing all of the sudden. It seems to only be when using [] = (http://php.net/manual/en/function.list.php)

      */
     public function invoicesOverviewAction(Request $request, Client $client)
     {
-        $handler = $this->handler_factory->create(InvoicePaymentHandlerType::class);
+        $handler                       = $this->handler_factory->create(InvoicePaymentHandlerType::class);
 
         [$payable_invoices, $invoices] = $this->getInvoices($client);
      */
     public function buildForm(FormBuilderInterface $builder, array $options)
     {
-        $transformer = new ContractTransformer($options['contracts']);
-        $types       = ['support.contact.question' => ContactData::QUESTION];
+        $transformer                                    = new ContractTransformer($options['contracts']);
+        $types                                          = ['support.contact.question' => ContactData::QUESTION];
 
         [$important, $questions, $incidents, $requests] = $this->createContractBuckets($options['contracts']);

My best guess is that the blank line is now ignored, while it shouldn't be.

@jrfnl
Copy link
Contributor

jrfnl commented Mar 6, 2018

@iltar Thanks for reporting this. I can confirm the issues.

The problem is with the list syntax before the assignment operator. I'm looking into fixing this now.

@jrfnl
Copy link
Contributor

jrfnl commented Mar 6, 2018

@iltar PR #1924 should fix this.

@gsherwood gsherwood added this to the 3.3.0 milestone Mar 6, 2018
@gsherwood gsherwood changed the title Equal sign alignment check broke after updating to 3.2.3 Equal sign alignment check broken when list syntax used before assignment operator Mar 6, 2018
gsherwood added a commit that referenced this issue Mar 6, 2018
@gsherwood
Copy link
Member

Thanks for this report, and thanks @jrfnl for the fix

gsherwood added a commit that referenced this issue Mar 7, 2018
…ing assignments within closures

I had to revert the patch to fix #1922 because it wouldn't allow for the sniff to do recursion, which is what it now does when it finds a closure or anon class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants