public function createAlias($reference, $alias = null)
    {
        //if reference is array look for array(alias=>reference);
        if (is_array($reference)) {
            foreach ($reference as $key => $class) {
                $this->createAlias($class, $key);
            }

            return true;
        }

        //store in this->alias as an associative array of class to an array of aliases;
        foreach ((!is_array($alias) ? [$alias] : $alias) as $key) {
            $this->aliases[$key] = $reference;
        }
    }