-
Notifications
You must be signed in to change notification settings - Fork 21
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
Conversation
use Dont\Exception\NonCloneableObject; | ||
use Dont\Exception\TypeError; | ||
|
||
trait DontClone |
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 is really nice, but the trait should be named Clone
so the FQNS is Dont\Clone
as per issue 3.
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 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)
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 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;
}
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.
BTW I am 92.4% happy to be ignored on this opinion as it's person preference and either works fine.
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.
@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.
Agreed. I'm a moron. On Tue, 11 Oct 2016 at 15:39 Marco Pivetta notifications@github.com wrote:
|
Assigning to @asgrim for review - we can eventually look at this on Saturday. |
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.
👍
👍 |
No description provided.