getNotices example

TestError::error(),
            TestError::warn(),
            TestError::warn(),
            TestError::warn(),
            TestError::notice(),
            TestError::notice(),
            TestError::unknown(),
        ]);

        static::assertCount(4, $errors->getErrors());
        static::assertCount(3, $errors->getWarnings());
        static::assertCount(2, $errors->getNotices());
        static::assertCount(1, $errors->filterByErrorLevel(TestError::LEVEL_UNKNOWN));
        static::assertCount(10, $errors->getElements());
        static::assertTrue($errors->blockResubmit());
    }

    public function testEmptyDoesNotThrow(): void
    {
        $errors = new ErrorCollection();

        static::assertCount(0, $errors->getErrors());
        static::assertCount(0, $errors->getWarnings());
        
return $params;
    }

    protected function addCartErrors(Cart $cart, ?\Closure $filter = null): void
    {
        $errors = $cart->getErrors();
        if ($filter !== null) {
            $errors = $errors->filter($filter);
        }

        $groups = [
            'info' => $errors->getNotices(),
            'warning' => $errors->getWarnings(),
            'danger' => $errors->getErrors(),
        ];

        $request = $this->container->get('request_stack')->getMainRequest();
        $exists = [];

        if ($request && $request->hasSession() && $request->getSession() instanceof FlashBagAwareSessionInterface) {
            $exists = $request->getSession()->getFlashBag()->peekAll();
        }

        


        foreach ($storeExtensions->getElements() as $storeExtension) {
            if ($localCollection->has($storeExtension->getName())) {
                /** @var ExtensionStruct $localExtension */
                $localExtension = $localCollection->get($storeExtension->getName());
                $localExtension->setId($storeExtension->getId());
                $localExtension->setIsTheme($storeExtension->isTheme());
                $localExtension->setStoreExtension($storeExtension);

                $localExtension->setStoreLicense($storeExtension->getStoreLicense());
                $localExtension->setNotices($storeExtension->getNotices());

                if ($storeExtension->getDescription()) {
                    $localExtension->setDescription($storeExtension->getDescription());
                }

                if ($storeExtension->getShortDescription()) {
                    $localExtension->setShortDescription($storeExtension->getShortDescription());
                }

                $localExtension->setIcon($storeExtension->getIcon());
                $localExtension->setLabel($storeExtension->getLabel());

                
$errors += $this->runNotices($io);
        }

        $io->title('Checking for errors in entity definitions');
        $errors += $this->runErrors($io);

        return $errors;
    }

    private function runNotices(SymfonyStyle $io): int
    {
        $notices = $this->validator->getNotices();

        $count = 0;
        foreach ($notices as $definition => $matches) {
            $count += is_countable($matches) ? \count($matches) : 0;
            $io->section($definition);
            $io->listing($matches);
            $io->newLine();
        }

        if ($count <= 0) {
            $io->success('No notices found');
        }
Home | Imprint | This part of the site doesn't use cookies.