I am trying to write good code, and part of that is type hinting to make it easier for work down the line and to force expectations.
This may seem a little contrived, but its more of a proof of concept for me.
I am writing a class to take a TSV file split on tabs and insert into my Model. In my constructor I was asking for:
Illuminate\Database\Eloquent\Model
To which I passed:
new \App\Model()
And finally the error response of:
instance of App\Model given
Clearly I have done something wrong, but I do not want to force usage of App\Model, how can I generically ask for an eloquent model?
Edit for more information:
To make it more clear, I am using Laravel 5, the models are created via artisan make:model. The constructor is as follows:
function __construct ($resource, Illuminate\Database\Eloquent\Model $model, $skip = 0)
And the Model I am using (for my movie table) is:
use Illuminate\Database\Eloquent\Model;
class Movie extends Model {