-
Notifications
You must be signed in to change notification settings - Fork 281
[minor] Conversion to "int" and "bool" for Doctrine generated entities #396
Conversation
phansys
commented
Jul 20, 2015
Q | A |
---|---|
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | |
License | MIT |
Doc PR |
Thanks for this commit. I like the idea behind it, but it looks like a hack. Apparently the code we are fixing is the same code that we generated (via Doctrine libraries). It's strange that we generate wrong code in the first place 😕 |
Thank you for the feedback @javiereguiluz. I've created a PR last week against Doctrine in order to "fix" this into the library itself: doctrine/orm#1457. I'm quoting fix because this CS rule isn't part of Doctrine's CSs: |
👍 then it looks like this is the only safe way to solve this issue. Thanks. |
@@ -88,6 +88,11 @@ public function generate(BundleInterface $bundle, $entity, $format, array $field | |||
$entityGenerator->setGenerateAnnotations(false); | |||
$entityCode = $entityGenerator->generateEntityClass($class); | |||
} | |||
$entityCode = str_replace( | |||
array("@var integer\n", "@var boolean\n", "@param integer\n", "@param boolean\n", "return integer\n", "return boolean\n"), | |||
array("@var int\n", "@var bool\n", "@param int\n", "@param bool\n", "return int\n", "return bool\n"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why didn't you put a @
in front of return
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know @xabbuh :P (copy - paste typo). Fixed.
… entities | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR |
9c07bc8
to
6ff93e9
Compare
Thanks @phansys. |
…ted entities (phansys) This PR was merged into the 3.0.x-dev branch. Discussion ---------- [minor] Conversion to "int" and "bool" for Doctrine generated entities | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 6ff93e9 [minor] Conversion to ```int``` and ```bool``` for Doctrine generated entities