public function hasType($nameOrType)
    {
        $name = $nameOrType instanceof WidgetTypeInterface ? $nameOrType->getName() : $nameOrType;

        return array_key_exists($name, $this->types);
    }