Skip to content

Instantly share code, notes, and snippets.

@antonioribeiro
Created April 5, 2014 00:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonioribeiro/9985438 to your computer and use it in GitHub Desktop.
Save antonioribeiro/9985438 to your computer and use it in GitHub Desktop.
trait
<?php
class Eloquent {
}
class Sentry extends Eloquent {
protected $guarded = [
'sentry column',
];
}
class Vocal extends Eloquent {
protected $guarded = [
'vocal column',
];
}
trait UserTraits {
protected $guarded = [
'password',
];
}
class SentryUser extends Sentry {
use UserTraits;
}
class VocalUser extends Vocal {
use UserTraits;
}
$foo = new SentryUser;
var_dump($foo);
// Cartalyst\Sentry\Users\Eloquent\User and App\Traits define the same property ($guarded) in the composition of App\Model.
// However, the definition differs and is considered incompatible. Class was composed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment