Knp\Bundle\KnpBundlesBundle\Updater\Updater::removeNonSymfonyBundles PHP Method

removeNonSymfonyBundles() public method

    public function removeNonSymfonyBundles()
    {
        $counter = 0;
        $page = 1;
        $pager = $this->paginateExistingBundles($page);
        $this->output->writeln(sprintf('[%s] Will now check <comment>%d</comment> bundles', date('d-m-y H:i:s'), $pager->getNbResults()));
        do {
            /** @var $bundle Bundle */
            foreach ($pager->getCurrentPageResults() as $bundle) {
                if (!$this->githubRepoApi->validate($bundle)) {
                    $this->notifyInvalid($bundle->getFullName(), sprintf('File "%sBundle.php" with base class was not found.', ucfirst($bundle->getFullName())));
                    if (!$this->removeRepo($bundle)) {
                        $bundle->getOwner()->removeBundle($bundle);
                        $this->em->remove($bundle);
                    }
                    ++$counter;
                }
            }
            ++$page;
        } while ($pager->hasNextPage() && $pager->setCurrentPage($page, false, true));
        $this->output->writeln(sprintf('[%s] <comment>%s</comment> invalid bundles have been found and removed', date('d-m-y H:i:s'), $counter));
        $this->em->flush();
    }