Bug 532269 - Code formatter can cycle between 2 line wrapping policies when formatting a php file
Summary: Code formatter can cycle between 2 line wrapping policies when formatting a p...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PHP Core CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-10 09:37 EST by Thierry BLIND CLA
Modified: 2020-05-14 11:24 EDT (History)
0 users

See Also:


Attachments
code formatter profile (22.47 KB, text/xml)
2018-03-10 09:39 EST, Thierry BLIND CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thierry BLIND CLA 2018-03-10 09:37:10 EST
Hi,
steps to reproduce:

1. import and define code formatter profile provided with this bug report
2. create a php file with following content:

<?php

class LineTest
{

    public function testStyleArray()
    {
        $oLine = new Line(array(
                                'width' => \PhpOffice\PhpWord\Shared\Converter::cmToPixel(14),
                                'height' => \PhpOffice\PhpWord\Shared\Converter::cmToPixel(4),
                                'positioning' => 'absolute',
                                'posHorizontalRel' => 'page',
                                'posVerticalRel' => 'page',
                                'flip' => true,
                                'marginLeft' => \PhpOffice\PhpWord\Shared\Converter::cmToPixel(5),
                                'marginTop' => \PhpOffice\PhpWord\Shared\Converter::cmToPixel(3),
                                'wrappingStyle' => \PhpOffice\PhpWord\Style\Image::WRAPPING_STYLE_SQUARE,
                                'beginArrow' => \PhpOffice\PhpWord\Style\Line::ARROW_STYLE_BLOCK,
                                'endArrow' => \PhpOffice\PhpWord\Style\Line::ARROW_STYLE_OVAL,
                                'dash' => \PhpOffice\PhpWord\Style\Line::DASH_STYLE_LONG_DASH_DOT_DOT
        ));
    }
}
?>

3. each time you format this file, the array() code formatting part will cycle between 2 presentations:

        $oLine = new Line(array(
                                'width' => \PhpOffice\PhpWord\Shared\Converter::cmToPixel(14),
                                ...
        ));

or

        $oLine = new Line(
            array(
                'width' => \PhpOffice\PhpWord\Shared\Converter::cmToPixel(14),
                ...
            ));


Thierry.

NB: that's probably a long-standing bug (and the problem happens before all my recent code formatter patches).
Comment 1 Thierry BLIND CLA 2018-03-10 09:39:35 EST
Created attachment 273077 [details]
code formatter profile
Comment 2 Eclipse Genie CLA 2018-03-10 11:07:50 EST
New Gerrit change created: https://git.eclipse.org/r/119152
Comment 4 Thierry BLIND CLA 2018-03-10 17:43:17 EST
Fixed.
Comment 5 Eclipse Genie CLA 2018-03-11 12:17:22 EDT
New Gerrit change created: https://git.eclipse.org/r/119178