Orphail / laravel-ddd

Yet another Laravel 10 DDD interpretation
332 stars 62 forks source link

Variable probably undefined in Repositories #1

Closed sunxyw closed 1 year ago

sunxyw commented 1 year ago

In my search, I came across this repository, which offers excellent DDD interpretation and a solid starting point. However, I discovered that in some Repositories classes, the upsertAll method could involve variables that are not defined. For instance, in the code below, addressEloquent will be undefined if the company does not possess any addresses, which will prevent the execution of any further code. https://github.com/Orphail/laravel-ddd/blob/3cf4a785b50a541b21e153e54663544803e2450a/src/Agenda/Company/Application/Repositories/Eloquent/AddressRepository.php#L13-L20 I was unable to successfully integrate static analysis tools because of this. Have you had the opportunity to address this? similar to including conditions or exceptions.

Orphail commented 1 year ago

Hey thanks for pointing out this issue! It has been addressed in the last commit.