badoo/phpcf

Annotations are formatted in a wrong way

aazon opened this issue · 3 comments

Input source code:

<?php
class Foo extends Bar
{
/**
* Execution callback
* @param string $world
* @return string
*/
public function hello($world)
{
return $world;
}
}

Applying formatter:

./phpcf apply ~/Projects/Foo.php

Result:

<?php
class Foo extends Bar
{
    /**
* Execution callback
* @param string $world
* @return string
*/
    public function hello($world)
    {
        return $world;
    }
}

Expected result:

<?php
class Foo extends Bar
{
    /**
     * Execution callback
     * @param string $world
     * @return string
     */
    public function hello($world)
    {
        return $world;
    }
}

In other words, you suggest phpcf to format contents of PHPDoc (not "regular") comments, am I right? It was actually a consious decision to ignore comments and string contents upon formatting so that we do not break any code that could potentially depend on their contents. Probably, we can safely format comment contents as we are formatting the rest of the code without too many problems.

Did you resolve the issue though :)?

aazon commented

Yeah we went for memio for one case and for simply templates for another case.