Skip to content

InlineControlStructureSniff does not handle auto-fixing for control structures that make function calls #1120

@benwaffle

Description

@benwaffle

Here is a small test case, run phpcbf with PSR2 on it:

<?php namespace App\Repositories\DB; use Carbon\Carbon; use Domain\Shared\Metrics; abstract class BaseMetrics { public function computeMetrics() { if ($level == 'district') \DB::update(<<<EOD update District_Metrics inner join District on district_id = District.uid set name = district_name EOD ); } }

Adding { } around the if body fixes it

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions