Skip to content
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

Merged
merged 1 commit into from Aug 31, 2017

Conversation

Projects
None yet
4 participants
@dragosprotung
Copy link
Contributor

dragosprotung commented Aug 30, 2017

Clean PR based on #815

@Majkl578
Copy link
Member

Majkl578 left a comment

LGTM, just two trivial things. :)

self::AUTOGENERATE_NEVER,
self::AUTOGENERATE_ALWAYS,
self::AUTOGENERATE_FILE_NOT_EXISTS,
self::AUTOGENERATE_EVAL

This comment has been minimized.

@Majkl578

Majkl578 Aug 30, 2017

Member

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)) {

This comment has been minimized.

@Majkl578

Majkl578 Aug 30, 2017

Member

You don't need false here as it's default behavior.

This comment has been minimized.

@dragosprotung

dragosprotung Aug 30, 2017

Author Contributor

It is the default value, but I wanted to be explicit that we allow other values

This comment has been minimized.

@lcobucci

lcobucci Aug 30, 2017

Member

And why not casting it to int and making a strict comparison?

This comment has been minimized.

@dragosprotung

dragosprotung Aug 31, 2017

Author Contributor

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 dragosprotung force-pushed the dragosprotung:master branch from bd01cb8 to 090287e Aug 30, 2017

@lcobucci

This comment has been minimized.

Copy link
Member

lcobucci commented Aug 30, 2017

@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 phpcs/phpcbf?

@dragosprotung dragosprotung force-pushed the dragosprotung:master branch from 090287e to b000432 Aug 31, 2017

@dragosprotung

This comment has been minimized.

Copy link
Contributor Author

dragosprotung commented Aug 31, 2017

@lcobucci I can see them from your PR, but I will wait for it to be merged if it will not take too long

@Ocramius

This comment has been minimized.

Copy link
Member

Ocramius commented Aug 31, 2017

@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 = [

This comment has been minimized.

@Ocramius

@Ocramius Ocramius self-assigned this Aug 31, 2017

@Ocramius Ocramius added the Bug label Aug 31, 2017

@Ocramius Ocramius added this to the 2.8.1 milestone Aug 31, 2017

Ocramius added a commit that referenced this pull request Aug 31, 2017

Merge branch 'fix/#815-#816-revert-bc-break-preventing-non-boolean-pr…
…oxy-generator-modes-2.8' into 2.8

Backport #815
Backport #816

@Ocramius Ocramius merged commit b000432 into doctrine:master Aug 31, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

Ocramius added a commit that referenced this pull request Aug 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.