| Total Complexity | 3 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class FamilyEvent extends Event |
||
| 10 | { |
||
| 11 | use SoftDeletes; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * The attributes that should be mutated to dates. |
||
| 15 | * |
||
| 16 | * @var array |
||
| 17 | */ |
||
| 18 | protected $dates = ['deleted_at']; |
||
| 19 | |||
| 20 | protected $table = 'family_events'; |
||
| 21 | |||
| 22 | protected $fillable = [ |
||
| 23 | 'family_id', |
||
| 24 | 'places_id', |
||
| 25 | 'date', |
||
| 26 | 'title', |
||
| 27 | 'description', |
||
| 28 | 'year', |
||
| 29 | 'month', |
||
| 30 | 'day', |
||
| 31 | 'type', |
||
| 32 | 'plac', |
||
| 33 | 'phon', |
||
| 34 | 'caus', |
||
| 35 | 'age', |
||
| 36 | 'husb', |
||
| 37 | 'wife', |
||
| 38 | ]; |
||
| 39 | |||
| 40 | public static function boot() |
||
| 45 | } |
||
| 46 | |||
| 47 | public function family() |
||
| 50 | } |
||
| 51 | |||
| 52 | public function place() |
||
| 57 |
Let?s assume that you have a directory layout like this:
. |-- OtherDir | |-- Bar.php | `-- Foo.php `-- SomeDir `-- Foo.phpand let?s assume the following content of
Bar.php:If both files
OtherDir/Foo.phpandSomeDir/Foo.phpare loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.phpHowever, as
OtherDir/Foo.phpdoes not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: