-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated syntax for "integer" and "boolean" types #1457
Conversation
| Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Used short syntax for ```integer``` and ```boolean``` types. **Before** ```php /** * @var integer * * @Orm\Column(name="some_integer_field", type="integer") */ private $someIntegerField; /** * @var boolean * * @Orm\Column(name="some_boolean_field", type="boolean") */ private $someBooleanField; ``` **After** ```php /** * @var int * * @Orm\Column(name="some_integer_field", type="integer") */ private $someIntegerField; /** * @var bool * * @Orm\Column(name="some_boolean_field", type="boolean") */ private $someBooleanField; ```
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DDC-3824 We use Jira to track the state of pull requests and the versions they got |
This seems ready. |
Just wondering, what is the added value of 'going back to abbreviations'? Preparing for PHP7 type hinting? |
@holtkamp Might be. Consistency improves readability and also prevents confusion. It would be also easier to adapt PHP 7 type hinting, as you state. |
@TomasVotruba personally I regard abbreviations something that should only be used when needed (for example when there is insufficient space on a piece of paper, one uses an abbreviation). Alias functions like is_integer() triggered me to prefer the 'integer' over 'int' notation, hoping that one day we would also have an About the consistency:
I see 1x Might be my personal glitch, but I would say 👎 |
@holtkamp I have no opinion about this, it doesn't burn me. Just seems ready. |
@holtkamp these abbreviations are also used in the upcoming PSR-5: PHPDoc standard. So IMO this PR is a good thing. |
Updated syntax for "integer" and "boolean" types
How often do you add type name into the variable name? That seems crazy. In real world, you'd have something like: /**
* @var bool
* @ORM\Column(name="is_enabled", type="boolean")
*/
private $enabled; 1x bool and 1x boolean. It's sad that Doctrine doesn't support both variants, but that's for another discussion. |
👍 Thanks guys |
Meh, we have more relevant stuff to deal with anyway. |
Used short syntax for
integer
andboolean
types.Before
After