<commit_before><?php

namespace OpenOrchestra\MediaAdminBundle\GenerateForm\Strategies;

use OpenOrchestra\Backoffice\GenerateForm\Strategies\AbstractBlockStrategy;
use OpenOrchestra\ModelInterface\Model\BlockInterface;
use Symfony\Component\Form\FormBuilderInterface;
use OpenOrchestra\Media\DisplayBlock\Strategies\DisplayMediaStrategy as BaseMediaStrategy;
use Symfony\Component\Validator\Constraints\NotBlank;

/**
 * Class DisplayMediaStrategy
 */
class DisplayMediaStrategy extends AbstractBlockStrategy
{
    /**
     * @param BlockInterface $block
     *
     * @return bool
     */
    public function support(BlockInterface $block)
    {
        return BaseMediaStrategy::NAME == $block->getComponent();
    }

    /**
     * @param FormBuilderInterface $builder
     * @param array                $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('picture', 'oo_media_choice', array(
                'constraints' => new NotBlank(),
                'label' => 'open_orchestra_media_admin.block.gallery.form.pictures',
            ))
            ->add('nodeToLink', 'oo_node_choice', array(
                'constraints' => new NotBlank(),
                'label' => 'open_orchestra_media_admin.block.display_media.form.node_link',
                'required' => false
            ));
    }

    /**
     * Return the name of this type.
     *
     * @return string The name of this type
     */<commit_msg>Remove link constraint on media display block<commit_after><?php

namespace OpenOrchestra\MediaAdminBundle\GenerateForm\Strategies;

use OpenOrchestra\Backoffice\GenerateForm\Strategies\AbstractBlockStrategy;
use OpenOrchestra\ModelInterface\Model\BlockInterface;
use Symfony\Component\Form\FormBuilderInterface;
use OpenOrchestra\Media\DisplayBlock\Strategies\DisplayMediaStrategy as BaseMediaStrategy;
use Symfony\Component\Validator\Constraints\NotBlank;

/**
 * Class DisplayMediaStrategy
 */
class DisplayMediaStrategy extends AbstractBlockStrategy
{
    /**
     * @param BlockInterface $block
     *
     * @return bool
     */
    public function support(BlockInterface $block)
    {
        return BaseMediaStrategy::NAME == $block->getComponent();
    }

    /**
     * @param FormBuilderInterface $builder
     * @param array                $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('picture', 'oo_media_choice', array(
                'constraints' => new NotBlank(),
                'label' => 'open_orchestra_media_admin.block.gallery.form.pictures',
            ))
            ->add('nodeToLink', 'oo_node_choice', array(
                'label' => 'open_orchestra_media_admin.block.display_media.form.node_link',
                'required' => false
            ));
    }

    /**
     * Return the name of this type.
     *
     * @return string The name of this type
     */
{'fraction_non_alphanumeric': 0.10418760469011726, 'fraction_numerical': 0.0, 'mean_word_length': 2.7559748427672957, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5011899', 'n_tokens_mistral': 810, 'n_tokens_neox': 802, 'n_words': 157}