Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-855

[patch] EntityGenerator add an extra return line at each call ...

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA4
    • Fix Version/s: 2.0-RC1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      When using the php kooqit/console doctrine:generate:entities command (from the symfony2 framework), the EntityGenerator add an extra return line every time the command is called ....

      diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php
      index f2fa583..b0c8320 100644
      --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php
      +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php
      @@ -218,7 +218,7 @@ public function <methodName>()
               $body = str_replace('<spaces>', $this->_spaces, $body);
               $last = strrpos($currentCode, '}');
       
      -        return substr($currentCode, 0, $last) . $body . "\n}";
      +        return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : ''). "}";
           }
       
           /**
      
      

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Fixed.

        Show
        Benjamin Eberlei added a comment - Fixed.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Thomas Rabaix
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: