-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PropertyInfo] Import the component #15858
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
Conversation
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* (c) Kévin Dunglas <dunglas@gmail.com> |
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.
Not sure if it is required or not as this code was in the wild previously but I'm ok to remove this line if necessary.
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'm no license expert, but I think it would be better to be consistent with everything. We can talk about that on the phone.
f6252c3
to
e16db41
Compare
👍 this is realy useful |
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\PropertyInfo\Extractors; |
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.
we generally use singular for namespaces in Symfony
👍 |
what about the doctrine variants (mongo, phpcr)? can they provide their own extractor in their symfony bundle? |
return array(new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, 'DateTime')); | ||
|
||
case 'array': | ||
return array(new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true, new Type(Type::BUILTIN_TYPE_INT))); |
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.
this supports string keys too
@dbu IMO it could even be added directly in the Doctrine bridge. |
3fc5195
to
a8f643c
Compare
composer require symfony/property-info | ||
|
||
To use the PHPDoc extractor, install the [phpDocumentator's Reflection](https://github.com/phpDocumentor/Reflection) library. | ||
To use the Doctrine extractor, install the [Doctrine ORM](http://www.doctrine-project.org/projects/orm.html). |
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.
You should mention that you also need the Doctrine bridge.
Can you rebase to get rid of all the merge commits that we don't want to keep when merging? |
LGTM |
before the merge here, I would like to see the documentation PR being opened, which will help us see how this component is mean to be used (as we will be able to read the documentation) |
a8f643c
to
12339f4
Compare
The AppVeyor error is unrelated. |
@fabpot I can still see some licenses that should be fixed. Regarding the history, external contributions are minimal, so loosing the history should not be a problem; especially because there are a lot of noise in there (including the Hack patch that was later reverted). |
12339f4
to
e696f5d
Compare
ping @symfony/deciders |
@@ -76,7 +77,11 @@ | |||
"monolog/monolog": "~1.11", | |||
"ircmaxell/password-compat": "~1.0", | |||
"ocramius/proxy-manager": "~0.4|~1.0", | |||
"egulias/email-validator": "~1.2" | |||
"egulias/email-validator": "~1.2", | |||
"phpdocumentor/reflection": "~1.0" |
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.
You've added a conflict
block below for versions < 1.0.7. Shouldn't we change the version constraint instead to ^1.0.7
and drop the conflict
block?
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.
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.
Oh, I've just found the other composer.json with the discussion about this topic. I'll join there. Nevermind. ;-)
Let's test this Carson thingy… Status: Reviewed |
🎉 |
@carsonbot ... Status: Reviewed |
Issues raised by @derrabus and @OskarStark fixed. |
Reading the documentation, here are some thoughts:
|
|
Another solution for the number of arguments: the constructor as is but provide a factory method with only one parameter (the It looks overkill for such a low level component but I can add it if you think it's better in term of DX. |
|
Class and interfaces renamed accordingly. |
👍 |
Thank you @dunglas. |
This PR was merged into the 2.8 branch. Discussion ---------- [PropertyInfo] Add Component Documentation | Q | A | ------------- | --- | Doc fix? | no | New docs? | yes (symfony/symfony#15858) | Applies to | `2.8`, `3.0` | Fixed tickets | N/A This is still a *work in progress*, but I'd like feedback from anyone regarding structure, grammar and any other improvements while I continue. After speaking with @dunglas, I'm creating a new PR due our branches differing by about 400 commits. Commits ------- a0409d7 Update Reference to Service Container Tags 78ea4a5 Update PropertyAccess Component Path 7b786af Fix Incorrect Indent 96b139b Suggested Changes cf7a0ea Add PropertyInfo Component Documentation
As discussed with @fabpot (see #14844), this PR moves dunglas/php-property-info under the Symfony umbrella.
Rationale behind this new component (extracted from README.md):
PHP doesn't support explicit type definition. This is annoying, especially when doing meta programming.
Various libraries including but not limited to Doctrine ORM and the Symfony Validator provide their own type managing
system.
This library extracts various information including the type and documentation from PHP class property from metadata of popular sources:
Usage:
Output: