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

Adding DontClone feature #5

Merged
merged 2 commits into from
Jan 8, 2017
Merged

Adding DontClone feature #5

merged 2 commits into from
Jan 8, 2017

Conversation

nathanmarcos
Copy link

No description provided.

use Dont\Exception\NonCloneableObject;
use Dont\Exception\TypeError;

trait DontClone
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really nice, but the trait should be named Clone so the FQNS is Dont\Clone as per issue 3.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression it should be DontClone (so more readable when importing the traits:)

namespace Bar;

use Dont\DontClone;

class Foo {
    use DontClone;
}

vs

namespace Bar;

use Dont\Clone;

class Foo {
    use Clone;
}

(the 2nd is less clear IMO)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm only going by the README.md which you obviously haven't read. It states... that I am completely wrong and should be ignored. Sorry.

I would still prefer to see code such as:

namespace Asgrim\Sucks;

class MyEntity
{
    use \Dont\Clone;
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW I am 92.4% happy to be ignored on this opinion as it's person preference and either works fine.

Copy link
Member

@Ocramius Ocramius Oct 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GeeH I discussed this with @macnibblet before, and I even experienced it in first place (in the test assets): basically, in most scenarios, most users will import the trait via a use statement, and having class Foo { use Clone; } will be confusing, while class Foo { use DontClone; } is much better.

@GeeH
Copy link

GeeH commented Oct 11, 2016

Agreed. I'm a moron.

On Tue, 11 Oct 2016 at 15:39 Marco Pivetta notifications@github.com wrote:

@Ocramius commented on this pull request.

In src/Dont/DontClone.php #5:

@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Dont;
+
+use Dont\Exception\NonCloneableObject;
+use Dont\Exception\TypeError;
+
+trait DontClone

@GeeH https://github.com/GeeH I discussed this with @macnibblet
https://github.com/macnibblet before, and I even experienced it in
first place: basically, in most scenarios, most users will import the trait
via a use statement, and having class Foo { use Clone; } will be
confusing, while class Foo { use DontClone; } is much better.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#5, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAlcAD_ZrtqyvCbpLCuGmCFY6ewQ7MhJks5qy5-FgaJpZM4KTnCJ
.

@Ocramius
Copy link
Member

Assigning to @asgrim for review - we can eventually look at this on Saturday.

@Ocramius Ocramius added this to the 1.0.0 milestone Oct 12, 2016
@asgrim asgrim assigned Ocramius and GeeH and unassigned asgrim Dec 8, 2016
Copy link

@GeeH GeeH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@GeeH GeeH removed their assignment Dec 8, 2016
@Ocramius
Copy link
Member

Ocramius commented Jan 8, 2017

👍

@Ocramius Ocramius merged commit cf69186 into Roave:master Jan 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants