Skip to content

How to preserve new lines in method body? #61

@matak

Description

@matak

Hi, wonderfull library, but after several hours, i realize that i cant use it.

I would like to use this library to scaffolding my code. With help of AutoIt I want to replace the whole code in text window with scaffolded dependency injection of use statements etc.

But the problem is, that it is not possible to preserve the new lines and whitespaces in the body of methods, is it true? Am I right?

So when i want to update this code

public function renderDefault()
{
	$stockinRow = $this->stockinRepositoryService->findById($this->stockin_id);
		
	$pageHeader = $this['pageHeader'];
	$pageHeader->setTitle("Naskladnění [" . $stockinRow->id . "] " . $stockinRow->dateArrival->format("d.m.Y") . " , profil dodavatele: " . $stockinRow->supplierProfile->name);

	$template = $this->template;
	$template->dataStockinItems = $this->stockinItemRepositoryService->selectAll()->where("stockin_id = ?", $this->stockin_id)->order("EAN ASC")->fetchAll();
}

I get this code,

public function renderDefault() {
	$stockinRow = $this->stockinRepositoryService->findById($this->stockin_id);
	$pageHeader = $this['pageHeader'];
	$pageHeader->setTitle("Naskladnění [" . $stockinRow->id . "] " . $stockinRow->dateArrival->format("d.m.Y") . " , profil dodavatele: " . $stockinRow->supplierProfile->name);
	$template = $this->template;
	$template->dataStockinItems = $this->stockinItemRepositoryService->selectAll()->where("stockin_id = ?", $this->stockin_id)->order("EAN ASC")->fetchAll();
}

so quite messy. Can I somehow prevent it?

As i searched in code, it seems that builder knows that originally the row was on line 31 and next row was on line 33, so there should be new line string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions