Support the ongoing development of Laravel.io →
posted 10 years ago
IOC
Last updated 2 years ago.
0

I'm running into the same problem with my code at the moment.

Did you find a fix to this?

Last updated 2 years ago.
0
  • Firstly, let me guess: Your TableValidator using 2 dependencies is some kind of AbstractBuilder (that the CsvBasedBuilder implements) and AbstractValidator (that the UnparsedRowValidator implements), so the IoC could not resolve the TableValidator ?

  • If I was right, I believe you need some kind of TableValidatorManager that using the AbstractBuilder and AbstractValidator as its driver, you can write your own way of using its driver, such as

    TableValidator::using($builder, $validator);

There's nothing to do with the IoC here. But ofcourse, you can bind the Manager to the IoC after that.

  • And another approach, as I can see you want to make some thing too general, I mean, why don't defined a validator named: App\Logic\AgencyImport\TabularArrayData\TableValidator\UnparsedRow, and use explitcity the UnparsedRowValidator and CsvBasedBuilder (or one of them) just make your validator more specificed, then the automated resolve come back.
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.