@param ReadBlockInterface $block

@return array

@throws DisplayBlockStrategyNotFoundException
544038
public function getBlockParameter(ReadBlockInterface $block)
    {
        $strategy = $this->getStrategy($block);
        if (null === $strategy) {
            throw new DisplayBlockStrategyNotFoundException($block->getComponent());
        }

        return $strategy->getBlockParameter();
    }
885160
private function getBlockPaths(\Magento\Framework\View\Element\AbstractBlock $block)
    {
        $reflector     = new \ReflectionClass($block); //@codingStandardsIgnoreLine
        $classFileName = $reflector->getFileName();

        if ($block instanceof \Magento\Framework\Interception\InterceptorInterface) {
            $classFileName = $reflector->getParentClass()->getFileName();
        }

        return ['class' => $classFileName];
    }
1154258
private function get_tags(string $block){
    preg_match_all($this->pattern['tag'], $block, $tags, PREG_OFFSET_CAPTURE);
    if ( !empty($tags[0]) ){
      return $tags[0];
    }
    return [];
  }
99001
private function visitConfiguration(Block $block, VisitorInterface $subVisitor): Generator
    {
        foreach ($block->getConfigs() as $config) {
            yield $config->getConfigKey() => $subVisitor->visit($config);
        }
    }
1155525
public function show(ReadBlockInterface $block)
    {
        $formParameters = array('method' => 'GET');

        if ('' != $block->getAttribute('contentNodeId')) {
            $language = $this->currentSiteManager->getSiteLanguage();
            $siteId = $this->currentSiteManager->getSiteId();
            $nodeId = $this->nodeRepository->findOnePublished($block->getAttribute('contentNodeId'), $language, $siteId)->getId();
            $formParameters['action'] = $this->router->generate($nodeId);
        }

        $formData = $this->requestStack->getCurrentRequest()->get('elastica_search');
        $form = $this->formFactory->create(new SearchType(), $formData, $formParameters);

        return $this->render('OpenOrchestraElasticaFrontBundle:Block/Search:show.html.twig', array(
            'form' => $form->createView(),
            'id' => $block->getId(),
            'class' => $block->getStyle(),
        ));
    }
151688
protected function loadCollection(BlockInterface $block)
    {
        $properties = $block->getProperties();

        $conditions = (isset($properties['conditions'])) ? $properties['conditions'] : '[]';
        $conditions = $this->expressionEngine->deserialize($conditions);

        if (empty($conditions)) {
            return;
        }

        $site = $this->siteManager->getSite();

        $qb = $this->expressionEngine->toQueryBuilder($conditions, $this->contentManager->getClass());
        $qb->andWhere('a.publishAt < :now OR a.publishAt IS NULL')
            ->andWhere('a.active = :active')
            ->andWhere('a.layout = :layout');

        if ($site == null) {
            $qb->andWhere('a.site IS NULL');
        } else {
            $qb->andWhere('a.site = :site')
               ->setParameter('site', $site);
        }

        $qb->setParameter('active', true)
            ->setParameter('layout', false)
            ->setParameter('now', new \DateTime());

        if (isset($properties['order_by'])) {
            $direction = (isset($properties['order_direction'])) ? $properties['order_direction'] : 'ASC';

            $qb->orderBy('a.'.$properties['order_by'], $direction);
        }

        $limit = (isset($properties['limit'])) ? $properties['limit'] : 10;
        $qb->setMaxResults($limit);

        $collection = $qb->getQuery()->getResult();

        if ($collection) {
            $block->setCollection($collection);
        }
    }
1275317
private function loadBlockDefaults(BlockInterface $block)
    {
        $service = $this->blockManager->get($block);

        $resolver = new OptionsResolver();
        // use new interface method whenever possible
        // NEXT_MAJOR: Remove this check and legacy setDefaultSettings method call
        if (method_exists($service, 'configureSettings')) {
            $service->configureSettings($resolver);
        } else {
            $service->setDefaultSettings($resolver);
        }

        try {
            $block->setSettings($resolver->resolve($block->getSettings()));
        } catch (InvalidOptionsException $e) {
            // @TODO : add a logging error or a flash message
        }

        $service->load($block);

        return $block;
    }
1365606
public function renderEsi(BlockInterface $block)
    {
        $reference = new ControllerReference(
            'OpiferContentBundle:Frontend/Block:view',
            ['id' => $block->getId()],
            $this->getRequest()->query->all()
        );

        return $this->fragmentHandler->render($reference, 'esi');
    }
1096903
public function collectBlockView(BlockViewInterface $blockView): void
    {
        $block = $blockView->getBlock();
        $blockDefinition = $block->getDefinition();

        $blockData = [
            'id' => $block->getId(),
            'layout_id' => $block->getLayoutId(),
            'definition' => $blockDefinition->getName(),
            'view_type' => $blockDefinition->hasViewType($block->getViewType()) ?
                $blockDefinition->getViewType($block->getViewType())->getName() :
                'Invalid view type',
            'locale' => $block->getLocale(),
            'template' => null,
            'template_path' => null,
        ];

        if ($blockView->getTemplate() !== null) {
            $templateSource = $this->getTemplateSource($blockView->getTemplate());

            $blockData['template'] = $templateSource->getName();
            $blockData['template_path'] = $templateSource->getPath();
        }

        $this->data['blocks'][] = $blockData;
    }
838002
private function visitCollections(Block $block, VisitorInterface $subVisitor): Generator
    {
        foreach ($block->getCollections() as $identifier => $collection) {
            yield $identifier => $subVisitor->visit($collection);
        }
    }
885555
public function show(ReadBlockInterface $block)
    {
        $contentId = $this->requestStack->getCurrentRequest()->get('contentId');

        $content = $this->getContent($contentId);

        if ($content instanceof ReadContentInterface) {

            return $this->render(
                'OpenOrchestraDisplayBundle:Block/Content:show.html.twig',
                array(
                    'content' => $content,
                    'class' => $block->getStyle(),
                    'id' => $block->getId()
                )
            );
        }

        throw new ContentNotFoundException($contentId);
    }
244750
private function summarizeBlock($block)
	{
		$block = array(
			'rules' => is_array($block) ? $block : $this->splitIntoRules(trim($block)),
			'count' => 0
		);
		foreach ($block['rules'] as $key => $rule) {
			$block['rules'][$key] = array(
				'rule'  => $rule,
				'count' => $this->countSelectorsInRule($rule),
			);
			$block['count'] += $block['rules'][$key]['count'];
		}

		return $block;
	}
601363
public function getManageViewParameters(BlockInterface $block)
    {
        $parameters = [
            'block_view' => $this->getView($block),
            'manage' => true,
            'manage_type' => $this->getManageFormTypeName(),
        ];

        return $parameters;
    }
679843
public function includeBlockabale(Block $block)
    {
        $blockable = $block->blockable;
        if (!empty($blockable)) {
            $entityClassName  = (new ReflectionClass($blockable))->getShortName();
            $transformerClass = 'Gzero\\Api\\Transformer\\' . $entityClassName . 'Transformer';
            return $this->item($blockable, new $transformerClass());
        }
        return null;
    }
690034
protected function findParentButtons(BlockInterface $block)
    {
        if ($block->getAttribute('block_parent_buttons')) {
            return $block->getAttribute('block_parent_buttons');
        }

        $parent = $block;

        if ($block->getOption('scrollable')) {
            /* @var BlockInterface $block */
            foreach ($block->all() as $child) {
                if (BlockUtil::isBlockType($child, NavScrollableType::class)) {
                    /* @var BlockInterface $child */
                    foreach ($child->all() as $subChild) {
                        if (BlockUtil::isBlockType($subChild, BlockType::class)) {
                            $parent = $subChild;
                            break 2;
                        }
                    }
                }
            }
        }

        $block->setAttribute('block_parent_buttons', $parent);

        return $parent;
    }
1344230
public function show(ReadBlockInterface $block)
    {
        $parameters = $this->requestStack->getMasterRequest()->get('_route_params');
        if (!array_key_exists('siteId', $parameters) || !array_key_exists('nodeId', $parameters)) {
            throw new RouteNotFoundException();
        }
        $site = $this->siteRepository->findOneBySiteId($parameters['siteId']);
        $routes = array();
        if (!\is_null($site)) {
            foreach ($site->getLanguages() as $language) {
                try {
                    unset($parameters['_locale']);
                    unset($parameters['aliasId']);

                    $routes[$language] = $this->urlGenerator->generate($parameters['nodeId'], array_merge(
                        $parameters,
                        array(OpenOrchestraDatabaseUrlGenerator::REDIRECT_TO_LANGUAGE => $language)
                    ));
                } catch (ResourceNotFoundException $e) {
                } catch (RouteNotFoundException $e) {
                } catch (MissingMandatoryParametersException $e) {
                }
            }
        }

        return $this->render(
            $this->template,
            array(
                'class' => $block->getStyle(),
                'id' => $block->getId(),
                'routes' => $routes,
            )
        );
    }
356597
public function getCacheKeys(BlockInterface $block)
    {
        $settings = $block->getSettings();

        $keys = parent::getCacheKeys($block);

        $keys['environment'] = $this->getContainer()->get('kernel')->getEnvironment();

        if (isset($settings['template'])) {
            $keys['template'] = $settings['template'];
        }

        if (isset($settings['id'])) {
            $key = $this->getName() . ':' . $settings['id'];

            if (isset($settings['template'])) {
                $key = $key . ':' . $settings['template'];
            }

            $keys['block_id'] = $key;
        }

        $keys['updated_at'] = '';

        return $keys;
    }