Use DI container whever possible

This commit is contained in:
Amine Ben hammou
2019-01-29 18:00:26 +01:00
parent 8b602bd947
commit f83b7453fc
2 changed files with 7 additions and 10 deletions

View File

@ -32,10 +32,7 @@ class API {
const CURRENT_VERSION = 'v1';
function __construct(ContainerInterface $container, AccessControl $access_control, WPFunctions $wp = null) {
if($wp === null) {
$wp = new WPFunctions;
}
function __construct(ContainerInterface $container, AccessControl $access_control, WPFunctions $wp) {
$this->wp = $wp;
$this->container = $container;
$this->access_control = $access_control;