diff --git a/tests/system/API/ResponseTraitTest.php b/tests/system/API/ResponseTraitTest.php index fd2ff44a27ac..8701922e734c 100644 --- a/tests/system/API/ResponseTraitTest.php +++ b/tests/system/API/ResponseTraitTest.php @@ -102,11 +102,11 @@ public function testNoFormatterJSON() $this->assertEquals('A Custom Reason', $this->response->getReason()); $this->assertEquals(201, $this->response->getStatusCode()); - $expected = <<assertEquals($expected, $this->response->getBody()); } @@ -124,11 +124,11 @@ public function testAssociativeArrayPayload() $this->formatter = null; $controller = $this->makeController(); $payload = ['answer' => 42]; - $expected = <<respond($payload); $this->assertEquals($expected, $this->response->getBody()); } @@ -142,13 +142,13 @@ public function testArrayPayload() 2, 3, ]; - $expected = <<respond($payload); $this->assertEquals($expected, $this->response->getBody()); } @@ -160,12 +160,12 @@ public function testPHPtoArrayPayload() $payload = new stdClass(); $payload->name = 'Tom'; $payload->id = 1; - $expected = <<respond((array) $payload); $this->assertEquals($expected, $this->response->getBody()); } @@ -479,11 +479,11 @@ public function testXMLFormatter() $this->assertEquals('CodeIgniter\Format\XMLFormatter', get_class($this->formatter)); $controller->respondCreated(['id' => 3], 'A Custom Reason'); - $expected = << -3 + $expected = <<<'EOH' + + 3 -EOH; + EOH; $this->assertEquals($expected, $this->response->getBody()); } diff --git a/tests/system/Database/Builder/DeleteTest.php b/tests/system/Database/Builder/DeleteTest.php index c802eacb1a61..52ca78cc2f4d 100644 --- a/tests/system/Database/Builder/DeleteTest.php +++ b/tests/system/Database/Builder/DeleteTest.php @@ -42,9 +42,9 @@ public function testGetCompiledDelete() $sql = $builder->getCompiledDelete(); $expectedSQL = <<<'EOL' - DELETE FROM "jobs" - WHERE "id" = 1 - EOL; + DELETE FROM "jobs" + WHERE "id" = 1 + EOL; $this->assertSame($expectedSQL, $sql); } @@ -55,9 +55,9 @@ public function testGetCompiledDeleteWithLimit() $sql = $builder->where('id', 1)->limit(10)->getCompiledDelete(); $expectedSQL = <<<'EOL' - DELETE FROM "jobs" - WHERE "id" = 1 LIMIT 10 - EOL; + DELETE FROM "jobs" + WHERE "id" = 1 LIMIT 10 + EOL; $this->assertSame($expectedSQL, $sql); } } diff --git a/tests/system/Database/Builder/UpdateTest.php b/tests/system/Database/Builder/UpdateTest.php index 282dab29ba90..ea2fdf8412c2 100644 --- a/tests/system/Database/Builder/UpdateTest.php +++ b/tests/system/Database/Builder/UpdateTest.php @@ -120,28 +120,28 @@ public function testUpdateBatch() $space = ' '; $expected = <<assertSame($expected, $query->getOriginalQuery()); $expected = <<assertSame($expected, $query->getQuery() ); } diff --git a/tests/system/Format/XMLFormatterTest.php b/tests/system/Format/XMLFormatterTest.php index a3ca254270a4..7cedeb9acdf0 100644 --- a/tests/system/Format/XMLFormatterTest.php +++ b/tests/system/Format/XMLFormatterTest.php @@ -21,11 +21,11 @@ public function testBasicXML() 'foo' => 'bar', ]; - $expected = << -bar + $expected = <<<'EOH' + + bar -EOH; + EOH; $this->assertEquals($expected, $this->xmlFormatter->format($data)); } @@ -36,11 +36,11 @@ public function testFormatXMLWithMultilevelArray() 'foo' => ['bar'], ]; - $expected = << -bar + $expected = <<<'EOH' + + bar -EOH; + EOH; $this->assertEquals($expected, $this->xmlFormatter->format($data)); } @@ -51,11 +51,11 @@ public function testFormatXMLWithMultilevelArrayAndNumericKey() ['foo'], ]; - $expected = << -foo + $expected = <<<'EOH' + + foo -EOH; + EOH; $this->assertEquals($expected, $this->xmlFormatter->format($data)); } @@ -63,11 +63,11 @@ public function testFormatXMLWithMultilevelArrayAndNumericKey() public function testStringFormatting() { $data = ['Something']; - $expected = << -Something + $expected = <<<'EOH' + + Something -EOH; + EOH; $this->assertEquals($expected, $this->xmlFormatter->format($data)); } @@ -78,11 +78,11 @@ public function testValidatingXmlTags() 'BBB096630BD' => 'foo', '096630FR' => 'bar', ]; - $expected = << -foobar + $expected = <<<'EOH' + + foobar -EOH; + EOH; $this->assertEquals($expected, $this->xmlFormatter->format($data)); } @@ -96,10 +96,10 @@ public function testValidatingXmlTags() public function testValidatingInvalidTags(string $expected, array $input) { $expectedXML = << -<{$expected}>bar + + <{$expected}>bar -EOH; + EOH; $this->assertEquals($expectedXML, $this->xmlFormatter->format($input)); } @@ -171,43 +171,43 @@ public function testDeepNestedArrayToXml() ]; // do not change to tabs!! - $expectedXML = << - - - - Foo - foo@bar.com - - - - - - - - - - true - 2020-08-31 - 127.0.0.1 - - - - - - 1.0 - utf-8 - - - miscellaneous - - - miscellaneous data - - - - -EOF; + $expectedXML = <<<'EOF' + + + + + Foo + foo@bar.com + + + + + + + + + + true + 2020-08-31 + 127.0.0.1 + + + + + + 1.0 + utf-8 + + + miscellaneous + + + miscellaneous data + + + + + EOF; $dom = new DOMDocument('1.0'); $dom->preserveWhiteSpace = false; diff --git a/tests/system/Helpers/FormHelperTest.php b/tests/system/Helpers/FormHelperTest.php index d882a7836eb3..4bf1224b0b7e 100644 --- a/tests/system/Helpers/FormHelperTest.php +++ b/tests/system/Helpers/FormHelperTest.php @@ -33,15 +33,15 @@ public function testFormOpenBasic() $Value = csrf_hash(); $Name = csrf_token(); $expected = << - +
+ -EOH; + EOH; } else { - $expected = << + $expected = <<<'EOH' + -EOH; + EOH; } $attributes = [ @@ -62,10 +62,10 @@ public function testFormOpenHasLocale() $request->uri = new URI('http://example.com/'); Services::injectMock('request', $request); - $expected = << + $expected = <<<'EOH' + -EOH; + EOH; $attributes = [ 'name' => 'form', @@ -91,15 +91,15 @@ public function testFormOpenWithoutAction() $Value = csrf_hash(); $Name = csrf_token(); $expected = << - + + -EOH; + EOH; } else { - $expected = << + $expected = <<<'EOH' + -EOH; + EOH; } $attributes = [ 'name' => 'form', @@ -125,15 +125,15 @@ public function testFormOpenWithoutMethod() $Value = csrf_hash(); $Name = csrf_token(); $expected = << - + + -EOH; + EOH; } else { - $expected = << + $expected = <<<'EOH' + -EOH; + EOH; } $attributes = [ @@ -159,18 +159,18 @@ public function testFormOpenWithHidden() $Value = csrf_hash(); $Name = csrf_token(); $expected = << - - + + + -EOH; + EOH; } else { - $expected = << + $expected = <<<'EOH' + - + -EOH; + EOH; } $attributes = [ @@ -200,15 +200,15 @@ public function testFormOpenMultipart() $Value = csrf_hash(); $Name = csrf_token(); $expected = << - + + -EOH; + EOH; } else { - $expected = << + $expected = <<<'EOH' + -EOH; + EOH; } $attributes = [ 'name' => 'form', @@ -227,8 +227,8 @@ public function testFormHidden() { $expected = <<\n -EOH; + \n + EOH; $this->assertEquals($expected, form_hidden('username', 'johndoe')); } @@ -238,11 +238,11 @@ public function testFormHiddenArrayInput() $data = [ 'foo' => 'bar', ]; - $expected = << + -EOH; + EOH; $this->assertEquals($expected, form_hidden($data, null)); } @@ -252,11 +252,11 @@ public function testFormHiddenArrayValues() $data = [ 'foo' => 'bar', ]; - $expected = << + -EOH; + EOH; $this->assertEquals($expected, form_hidden('name', $data)); } @@ -264,8 +264,8 @@ public function testFormHiddenArrayValues() public function testFormInput() { $expected = <<\n -EOH; + \n + EOH; $data = [ 'name' => 'username', 'id' => 'username', @@ -280,8 +280,8 @@ public function testFormInput() public function testFormInputWithExtra() { $expected = <<\n -EOH; + \n + EOH; $data = [ 'id' => 'identity', 'name' => 'identity', @@ -297,8 +297,8 @@ public function testFormInputWithExtra() public function testFormPassword() { $expected = <<\n -EOH; + \n + EOH; $this->assertEquals($expected, form_password('password')); } @@ -306,8 +306,8 @@ public function testFormPassword() public function testFormUpload() { $expected = <<\n -EOH; + \n + EOH; $this->assertEquals($expected, form_upload('attachment')); } @@ -315,8 +315,8 @@ public function testFormUpload() public function testFormTextarea() { $expected = <<Notes\n -EOH; + \n + EOH; $this->assertEquals($expected, form_textarea('notes', 'Notes')); } @@ -327,10 +327,10 @@ public function testFormTextareaWithValueAttribute() 'name' => 'foo', 'value' => 'bar', ]; - $expected = <<bar + $expected = <<<'EOH' + -EOH; + EOH; $this->assertEquals($expected, form_textarea($data)); } @@ -342,8 +342,8 @@ public function testFormTextareaExtraRowsColsArray() 'rows' => '5', ]; $expected = <<Notes\n -EOH; + \n + EOH; $this->assertEquals($expected, form_textarea('notes', 'Notes', $extra)); } @@ -352,8 +352,8 @@ public function testFormTextareaExtraRowsColsString() { $extra = 'cols="30" rows="5"'; $expected = <<Notes\n -EOH; + \n + EOH; $this->assertEquals($expected, form_textarea('notes', 'Notes', $extra)); } @@ -361,13 +361,13 @@ public function testFormTextareaExtraRowsColsString() public function testFormDropdown() { $expected = << - - - - -\n -EOH; + \n + EOH; $options = [ 'small' => 'Small Shirt', 'med' => 'Medium Shirt', @@ -376,13 +376,13 @@ public function testFormDropdown() ]; $this->assertEquals($expected, form_dropdown('shirts', $options, 'large')); $expected = << - - - - -\n -EOH; + \n + EOH; $shirtsOnSale = [ 'small', 'large', @@ -399,17 +399,17 @@ public function testFormDropdown() ], ]; $expected = << - - - - - - - - -\n -EOH; + \n + EOH; $this->assertEquals($expected, form_dropdown('cars', $options, ['volvo', 'audi'])); } @@ -426,17 +426,17 @@ public function testFormDropdownUnselected() ], ]; $expected = << - - - - - - - - -\n -EOH; + \n + EOH; $this->assertEquals($expected, form_dropdown('cars', $options)); } @@ -453,17 +453,17 @@ public function testFormDropdownInferred() ], ]; $expected = << - - - - - - - - -\n -EOH; + \n + EOH; $_POST['cars'] = 'audi'; $this->assertEquals($expected, form_dropdown('cars', $options)); unset($_POST['cars']); @@ -472,12 +472,12 @@ public function testFormDropdownInferred() // ------------------------------------------------------------------------ public function testFormDropdownWithSelectedAttribute() { - $expected = << - - + $expected = <<<'EOH' + -EOH; + EOH; $data = [ 'name' => 'foo', 'selected' => 'bar', @@ -491,12 +491,12 @@ public function testFormDropdownWithSelectedAttribute() // ------------------------------------------------------------------------ public function testFormDropdownWithOptionsAttribute() { - $expected = << - - + $expected = <<<'EOH' + -EOH; + EOH; $data = [ 'name' => 'foo', 'options' => [ @@ -509,11 +509,11 @@ public function testFormDropdownWithOptionsAttribute() // ------------------------------------------------------------------------ public function testFormDropdownWithEmptyArrayOptionValue() { - $expected = << - + $expected = <<<'EOH' + -EOH; + EOH; $options = [ 'bar' => [], ]; @@ -524,13 +524,13 @@ public function testFormDropdownWithEmptyArrayOptionValue() public function testFormMultiselect() { $expected = << - - - - -\n -EOH; + \n + EOH; $options = [ 'small' => 'Small Shirt', 'med' => 'Medium Shirt', @@ -544,13 +544,13 @@ public function testFormMultiselect() public function testFormMultiselectArrayData() { $expected = << - - - - -\n -EOH; + \n + EOH; $options = [ 'small' => 'Small Shirt', 'med' => 'Medium Shirt', @@ -574,19 +574,19 @@ public function testFormMultiselectArrayData() public function testFormFieldset() { $expected = << -Address Information\n -EOH; +
+ Address Information\n + EOH; $this->assertEquals($expected, form_fieldset('Address Information')); } // ------------------------------------------------------------------------ public function testFormFieldsetWithNoLegent() { - $expected = << + $expected = <<<'EOH' +
-EOH; + EOH; $this->assertEquals($expected, form_fieldset()); } @@ -596,20 +596,20 @@ public function testFormFieldsetWithAttributes() $attributes = [ 'name' => 'bar', ]; - $expected = << -Foo + $expected = <<<'EOH' +
+ Foo -EOH; + EOH; $this->assertEquals($expected, form_fieldset('Foo', $attributes)); } // ------------------------------------------------------------------------ public function testFormFieldsetClose() { - $expected = << -EOH; + $expected = <<<'EOH' +
+ EOH; $this->assertEquals($expected, form_fieldset_close('')); } @@ -617,8 +617,8 @@ public function testFormFieldsetClose() public function testFormCheckbox() { $expected = <<\n -EOH; + \n + EOH; $this->assertEquals($expected, form_checkbox('newsletter', 'accept', true)); } @@ -630,10 +630,10 @@ public function testFormCheckboxArrayData() 'value' => 'bar', 'checked' => true, ]; - $expected = << + $expected = <<<'EOH' + -EOH; + EOH; $this->assertEquals($expected, form_checkbox($data)); } @@ -645,10 +645,10 @@ public function testFormCheckboxArrayDataWithCheckedFalse() 'value' => 'bar', 'checked' => false, ]; - $expected = << + $expected = <<<'EOH' + -EOH; + EOH; $this->assertEquals($expected, form_checkbox($data)); } @@ -656,8 +656,8 @@ public function testFormCheckboxArrayDataWithCheckedFalse() public function testFormRadio() { $expected = <<\n -EOH; + \n + EOH; $this->assertEquals($expected, form_radio('newsletter', 'accept', true)); } @@ -665,17 +665,17 @@ public function testFormRadio() public function testFormSubmit() { $expected = <<\n -EOH; + \n + EOH; $this->assertEquals($expected, form_submit('mysubmit', 'Submit Post!')); } // ------------------------------------------------------------------------ public function testFormLabel() { - $expected = <<What is your Name -EOH; + $expected = <<<'EOH' + + EOH; $this->assertEquals($expected, form_label('What is your Name', 'username')); } @@ -685,9 +685,9 @@ public function testFormLabelWithAttributes() $attributes = [ 'id' => 'label1', ]; - $expected = <<bar -EOH; + $expected = <<<'EOH' + + EOH; $this->assertEquals($expected, form_label('bar', 'foo', $attributes)); } @@ -695,8 +695,8 @@ public function testFormLabelWithAttributes() public function testFormReset() { $expected = <<\n -EOH; + \n + EOH; $this->assertEquals($expected, form_reset('myreset', 'Reset')); } @@ -704,8 +704,8 @@ public function testFormReset() public function testFormButton() { $expected = <<content\n -EOH; + \n + EOH; $this->assertEquals($expected, form_button('name', 'content')); } @@ -716,19 +716,19 @@ public function testFormButtonWithDataArray() 'name' => 'foo', 'content' => 'bar', ]; - $expected = <<bar + $expected = <<<'EOH' + -EOH; + EOH; $this->assertEquals($expected, form_button($data)); } // ------------------------------------------------------------------------ public function testFormClose() { - $expected = << -EOH; + $expected = <<<'EOH' + + EOH; $this->assertEquals($expected, form_close('')); } @@ -739,14 +739,14 @@ public function testFormDatalist() 'foo1', 'bar1', ]; - $expected = << + $expected = <<<'EOH' + - + -EOH; + EOH; $this->assertEquals($expected, form_datalist('foo', 'bar', $options)); } diff --git a/tests/system/Helpers/HTMLHelperTest.php b/tests/system/Helpers/HTMLHelperTest.php index 2355007e4090..a62bf5725a68 100755 --- a/tests/system/Helpers/HTMLHelperTest.php +++ b/tests/system/Helpers/HTMLHelperTest.php @@ -37,13 +37,13 @@ protected function setUp(): void public function testBasicUL() { - $expected = << -
  • foo
  • -
  • bar
  • - + $expected = <<<'EOH' +
      +
    • foo
    • +
    • bar
    • +
    -EOH; + EOH; $expected = ltrim($expected); $list = [ @@ -56,13 +56,13 @@ public function testBasicUL() public function testULWithClass() { - $expected = << -
  • foo
  • -
  • bar
  • - + $expected = <<<'EOH' +
      +
    • foo
    • +
    • bar
    • +
    -EOH; + EOH; $expected = ltrim($expected); $list = [ @@ -75,19 +75,19 @@ public function testULWithClass() public function testMultiLevelUL() { - $expected = << -
  • foo
  • -
  • bar
  • -
  • 2 -
      -
    • foo
    • -
    • bar
    • -
    -
  • - + $expected = <<<'EOH' +
      +
    • foo
    • +
    • bar
    • +
    • 2 +
        +
      • foo
      • +
      • bar
      • +
      +
    • +
    -EOH; + EOH; $expected = ltrim($expected); $list = [ @@ -106,13 +106,13 @@ public function testMultiLevelUL() public function testBasicOL() { - $expected = << -
  • foo
  • -
  • bar
  • - + $expected = <<<'EOH' +
      +
    1. foo
    2. +
    3. bar
    4. +
    -EOH; + EOH; $expected = ltrim($expected); $list = [ @@ -125,13 +125,13 @@ public function testBasicOL() public function testOLWithClass() { - $expected = << -
  • foo
  • -
  • bar
  • - + $expected = <<<'EOH' +
      +
    1. foo
    2. +
    3. bar
    4. +
    -EOH; + EOH; $expected = ltrim($expected); $list = [ @@ -144,19 +144,19 @@ public function testOLWithClass() public function testMultiLevelOL() { - $expected = << -
  • foo
  • -
  • bar
  • -
  • 2 -
      -
    1. foo
    2. -
    3. bar
    4. -
    -
  • - + $expected = <<<'EOH' +
      +
    1. foo
    2. +
    3. bar
    4. +
    5. 2 +
        +
      1. foo
      2. +
      3. bar
      4. +
      +
    6. +
    -EOH; + EOH; $expected = ltrim($expected); $list = [ @@ -299,12 +299,12 @@ public function testDocTypeInvalid() public function testVideo() { - $expected = << - Your browser does not support the video tag. - + $expected = <<<'EOH' + -EOH; + EOH; $target = 'http://www.codeigniter.com/test.mp4'; $message = 'Your browser does not support the video tag.'; @@ -314,14 +314,14 @@ public function testVideo() public function testVideoWithTracks() { - $expected = << - - - Your browser does not support the video tag. - + $expected = <<<'EOH' + -EOH; + EOH; $target = 'test.mp4'; $message = 'Your browser does not support the video tag.'; @@ -331,14 +331,14 @@ public function testVideoWithTracks() public function testVideoWithTracksAndIndex() { - $expected = << - - - Your browser does not support the video tag. - + $expected = <<<'EOH' + -EOH; + EOH; $target = 'test.mp4'; $message = 'Your browser does not support the video tag.'; @@ -348,18 +348,18 @@ public function testVideoWithTracksAndIndex() public function testVideoMultipleSources() { - $expected = << - - - - - - - Your browser does not support the video tag. - + $expected = <<<'EOH' + -EOH; + EOH; $sources = [ source('movie.mp4', 'video/mp4', 'class="test"'), @@ -377,16 +377,16 @@ public function testVideoMultipleSources() public function testAudio() { - $expected = << - - - - - Your browser does not support the audio tag. - + $expected = <<<'EOH' + -EOH; + EOH; $sources = [ source('sound.ogg', 'audio/ogg'), @@ -400,12 +400,12 @@ public function testAudio() public function testAudioSimple() { - $expected = << - Your browser does not support the audio tag. - + $expected = <<<'EOH' + -EOH; + EOH; $source = 'sound.mpeg'; $message = 'Your browser does not support the audio tag.'; @@ -416,12 +416,12 @@ public function testAudioSimple() public function testAudioWithSource() { - $expected = << - Your browser does not support the audio tag. - + $expected = <<<'EOH' + -EOH; + EOH; $source = 'http://codeigniter.com/sound.mpeg'; $message = 'Your browser does not support the audio tag.'; @@ -432,12 +432,12 @@ public function testAudioWithSource() public function testAudioWithIndex() { - $expected = << - Your browser does not support the audio tag. - + $expected = <<<'EOH' + -EOH; + EOH; $source = 'sound.mpeg'; $message = 'Your browser does not support the audio tag.'; @@ -448,14 +448,14 @@ public function testAudioWithIndex() public function testAudioWithTracks() { - $expected = << - - - Your browser does not support the audio tag. - + $expected = <<<'EOH' + -EOH; + EOH; $source = 'sound.mpeg'; $message = 'Your browser does not support the audio tag.'; @@ -468,23 +468,23 @@ public function testAudioWithTracks() public function testMediaNameOnly() { - $expected = << - + $expected = <<<'EOH' + + -EOH; + EOH; $this->assertEquals($expected, _media('av')); } public function testMediaWithSources() { - $expected = << - - - + $expected = <<<'EOH' + + + + -EOH; + EOH; $sources = [ source('sound.ogg', 'audio/ogg'), source('sound.mpeg', 'audio/mpeg'), @@ -502,10 +502,10 @@ public function testSource() public function testEmbed() { - $expected = << + $expected = <<<'EOH' + -EOH; + EOH; $type = 'video/quicktime'; $embed = embed('movie.mov', $type, 'class="test"'); @@ -514,10 +514,10 @@ public function testEmbed() public function testEmbedIndexed() { - $expected = << + $expected = <<<'EOH' + -EOH; + EOH; $type = 'video/quicktime'; $embed = embed('movie.mov', $type, 'class="test"', true); @@ -526,10 +526,10 @@ public function testEmbedIndexed() public function testObject() { - $expected = << + $expected = <<<'EOH' + -EOH; + EOH; $type = 'application/x-shockwave-flash'; $object = object('movie.swf', $type, 'class="test"'); @@ -539,13 +539,13 @@ public function testObject() public function testObjectWithParams() { - $expected = << - - - + $expected = <<<'EOH' + + + + -EOH; + EOH; $type = 'application/x-shockwave-flash'; $parms = [ @@ -558,10 +558,10 @@ public function testObjectWithParams() public function testObjectIndexed() { - $expected = << + $expected = <<<'EOH' + -EOH; + EOH; $type = 'application/x-shockwave-flash'; $object = object('movie.swf', $type, 'class="test"', [], true); diff --git a/tests/system/View/ParserFilterTest.php b/tests/system/View/ParserFilterTest.php index c8a5a387ac41..9e3e4001e6a1 100644 --- a/tests/system/View/ParserFilterTest.php +++ b/tests/system/View/ParserFilterTest.php @@ -180,12 +180,12 @@ public function testHighlightCode() $parser->setData($data); $template = '{ value1|highlight_code }'; - $expected = << -Sincerely  - - -EOF; + $expected = <<<'EOF' + + Sincerely  + + + EOF; $this->assertEquals($expected, $parser->renderString($template)); } diff --git a/tests/system/View/ParserTest.php b/tests/system/View/ParserTest.php index 1c2bf37a521b..299dfd6e5174 100644 --- a/tests/system/View/ParserTest.php +++ b/tests/system/View/ParserTest.php @@ -929,20 +929,20 @@ public function testParseLoopWithHashInPrecession(): void ]; $template = <<<'EOF' -

    #{heading}

    - {entries} -
    #{title}
    -

    {body}

    - {/entries} - EOF; +

    #{heading}

    + {entries} +
    #{title}
    +

    {body}

    + {/entries} + EOF; $expected = <<<'EOF' -

    #My Title

    +

    #My Title

    -
    #Subtitle
    -

    Lorem ipsum

    +
    #Subtitle
    +

    Lorem ipsum

    - EOF; + EOF; $this->parser->setData($data); $this->assertSame($expected, $this->parser->renderString($template)); diff --git a/utils/PhpCsFixer/CodeIgniter4.php b/utils/PhpCsFixer/CodeIgniter4.php index 95f4c0778bc2..86ac3aa7ca71 100644 --- a/utils/PhpCsFixer/CodeIgniter4.php +++ b/utils/PhpCsFixer/CodeIgniter4.php @@ -93,6 +93,8 @@ public function __construct() 'concat_space' => ['spacing' => 'one'], 'constant_case' => ['case' => 'lower'], 'function_to_constant' => true, + 'heredoc_indentation' => ['indentation' => 'start_plus_one'], + 'heredoc_to_nowdoc' => true, 'indentation_type' => true, 'line_ending' => true, 'list_syntax' => ['syntax' => 'short'], diff --git a/utils/Rector/RemoveErrorSuppressInTryCatchStmtsRector.php b/utils/Rector/RemoveErrorSuppressInTryCatchStmtsRector.php index 3f200868c7c1..7c8d97b8122a 100644 --- a/utils/Rector/RemoveErrorSuppressInTryCatchStmtsRector.php +++ b/utils/Rector/RemoveErrorSuppressInTryCatchStmtsRector.php @@ -18,15 +18,15 @@ public function getRuleDefinition(): RuleDefinition return new RuleDefinition('Remove error suppression operator `@` inside try...catch blocks', [ new CodeSample( <<<'CODE_SAMPLE' - try { - @rmdir($dirname); - } catch (Exception $e) {} - CODE_SAMPLE, + try { + @rmdir($dirname); + } catch (Exception $e) {} + CODE_SAMPLE, <<<'CODE_SAMPLE' - try { - rmdir($dirname); - } catch (Exception $e) {} - CODE_SAMPLE + try { + rmdir($dirname); + } catch (Exception $e) {} + CODE_SAMPLE ), ]); } diff --git a/utils/Rector/RemoveVarTagFromClassConstantRector.php b/utils/Rector/RemoveVarTagFromClassConstantRector.php index c579ca10abb6..93c0f9ea5155 100644 --- a/utils/Rector/RemoveVarTagFromClassConstantRector.php +++ b/utils/Rector/RemoveVarTagFromClassConstantRector.php @@ -18,18 +18,18 @@ public function getRuleDefinition(): RuleDefinition return new RuleDefinition('Remove @var tag from class constant', [ new CodeSample( <<<'CODE_SAMPLE' - class Foo - { - /** @var string */ - const X = 'test'; - } - CODE_SAMPLE, + class Foo + { + /** @var string */ + const X = 'test'; + } + CODE_SAMPLE, <<<'CODE_SAMPLE' - class Foo - { - const X = 'test'; - } - CODE_SAMPLE + class Foo + { + const X = 'test'; + } + CODE_SAMPLE ), ]); } diff --git a/utils/Rector/UnderscoreToCamelCaseVariableNameRector.php b/utils/Rector/UnderscoreToCamelCaseVariableNameRector.php index a78f934ddda6..479fa8acea59 100644 --- a/utils/Rector/UnderscoreToCamelCaseVariableNameRector.php +++ b/utils/Rector/UnderscoreToCamelCaseVariableNameRector.php @@ -51,24 +51,24 @@ public function getRuleDefinition(): RuleDefinition return new RuleDefinition('Change under_score names to camelCase', [ new CodeSample( <<<'CODE_SAMPLE' -final class SomeClass -{ - public function run($a_b) - { - $some_value = $a_b; - } -} -CODE_SAMPLE + final class SomeClass + { + public function run($a_b) + { + $some_value = $a_b; + } + } + CODE_SAMPLE , <<<'CODE_SAMPLE' -final class SomeClass -{ - public function run($aB) - { - $someValue = $aB; - } -} -CODE_SAMPLE + final class SomeClass + { + public function run($aB) + { + $someValue = $aB; + } + } + CODE_SAMPLE ), ]); }