-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #4880 HeredocIndentationFixer - config option for indentation…
… level (gharlan) This PR was merged into the 2.17-dev branch. Discussion ---------- HeredocIndentationFixer - config option for indentation level We discussed the best indentation level for the HeredocIndentationFixer [here](#3697 (comment)) and [here](#3915). But now since I'm actually using it, I changed my mind. I would like to write code like this: ```php public function foo() { return $this->createQuery(<<<'DQL' SELECT foo FROM App\Entity\Foo foo WHERE ... DQL)->getResult(); } ``` and NOT: ```php public function foo() { return $this->createQuery(<<<'DQL' SELECT foo FROM App\Entity\Foo foo WHERE ... DQL)->getResult(); } ``` So I suggest to add a config option `indentation` with possible values `start_plus_one` (default; same as current behavior) and `same_as_start` (new behavior). (Ideas for better names?) The fixer will remain non-risky, so it does not change the actual string result. This input: ```php $dql = <<<'DQL' SELECT foo FROM App\Entity\Foo foo DQL; ``` will be changed with the new behavior (`same_as_start`) to: ```php $dql = <<<'DQL' SELECT foo FROM App\Entity\Foo foo DQL; ``` Adding one more indentation level inside string content is not part of this fixer (as it would be risky). Commits ------- b03554d HeredocIndentationFixer - config option for indentation level
- Loading branch information
Showing
3 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters