Plugin-php: String concatenation

Created on 4 Mar 2018  路  4Comments  路  Source: prettier/plugin-php

Input:

            $this->view->textareaContentId = 'a' . $activationId . 'n' . $noticeTypeId;

Output:

            $this->view->textareaContentId = 'a' .
            $activationId .
            'n' .
            $noticeTypeId;

I'd suggest

            $this->view->textareaContentId = 
                 'a' . $activationId . 'n' . $noticeTypeId;

or (for longer cases)

            $this->view->textareaContentId = 'a' .
                $activationId .
                'n' .
                $noticeTypeId;
bug

All 4 comments

It seems that this needs to be fixed inside printBinaryExpression - @mgrip, could you take a look?

Will do!

So I think this is actually related to how we print assign nodes - here's how the JS printer handles it: https://github.com/prettier/prettier/blob/master/src/language-js/printer-estree.js#L4807

Fixed in #177

Was this page helpful?
0 / 5 - 0 ratings