Skip to content
This repository has been archived by the owner on Jan 6, 2020. It is now read-only.

[minor] Conversion to "int" and "bool" for Doctrine generated entities #396

Merged
merged 1 commit into from
Jul 22, 2015

Conversation

phansys
Copy link
Contributor

@phansys 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

@javiereguiluz
Copy link
Contributor

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 😕

@phansys
Copy link
Contributor Author

phansys commented Jul 20, 2015

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:

@javiereguiluz
Copy link
Contributor

👍 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"),
Copy link
Contributor

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?

Copy link
Contributor Author

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        |
@phansys phansys force-pushed the entities_bool_int branch from 9c07bc8 to 6ff93e9 Compare July 21, 2015 15:41
@javiereguiluz
Copy link
Contributor

Thanks @phansys.

@javiereguiluz javiereguiluz merged commit 6ff93e9 into sensiolabs:master Jul 22, 2015
javiereguiluz added a commit that referenced this pull request Jul 22, 2015
…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
@phansys phansys deleted the entities_bool_int branch July 22, 2015 13:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants