protected function isDuplicateScript(
        PhpRenderer $view,
        $container
    ) {
        /** @var \Zend\View\Helper\HeadScript $headScript */
        $headScript = $view->headScript();

        $container = $headScript->getContainer();

        foreach ($container as &$item) {
            if (($item->source === null)
                && !empty($item->attributes['src'])
                && !empty($container->attributes['src'])
                && ($container->attributes['src'] == $item->attributes['src'])
            ) {
                return true;
            }
        }

        return false;
    }