-
-
Notifications
You must be signed in to change notification settings - Fork 294
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
Convert proxy factory auto generate mode to integer #816
Conversation
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.
LGTM, just two trivial things. :)
self::AUTOGENERATE_NEVER, | ||
self::AUTOGENERATE_ALWAYS, | ||
self::AUTOGENERATE_FILE_NOT_EXISTS, | ||
self::AUTOGENERATE_EVAL |
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 should be comma after last item.
*/ | ||
public function __construct(ProxyGenerator $proxyGenerator, ClassMetadataFactory $metadataFactory, $autoGenerate) | ||
{ | ||
$this->proxyGenerator = $proxyGenerator; | ||
$this->metadataFactory = $metadataFactory; | ||
$this->autoGenerate = (bool)$autoGenerate; | ||
|
||
if ( ! in_array($autoGenerate, self::AUTOGENERATE_MODES, false)) { |
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 don't need false here as it's default behavior.
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.
It is the default value, but I wanted to be explicit that we allow other values
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.
And why not casting it to int and making a strict comparison?
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.
Normally I don't set properties until they are validated. But I guess in this case makes no difference as it's the constructor
@dragosprotung there are some CS violations, I've just pushed #817 to update our build process and verify coding standard violations. Do you want me to point out the issues or do you prefer to wait for it to be merged and just use |
@lcobucci I can see them from your PR, but I will wait for it to be merged if it will not take too long |
@lcobucci let's not pick on CS if a massive conflicting PR is coming in anyway :-P |
@@ -69,6 +69,13 @@ | |||
*/ | |||
const AUTOGENERATE_EVAL = 3; | |||
|
|||
private const AUTOGENERATE_MODES = [ |
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.
YAY!
Clean PR based on #815