Interfaces I understand the reasons for. Single responsibility I understand the reasoning. Basically I do understand why the 'contract' path has been chosen, I'm just struggling with understanding the implementation.
For example the docs give us this example:
<?php namespace App\Orders;
use Illuminate\Contracts\Cache\Repository as Cache;
class Repository {
/**
* Create a new repository instance.
*
* @param Cache $cache
* @return void
*/
public function __construct(Cache $cache)
{
$this->cache = $cache;
}
}
If i were to replace the laravel native cache driver with, let's say, a third party, framework agnostic cache driver, would I then have to write an adapter to adhere to Laravel 5.0 cache contract?