<commit_before><?php

namespace Mildberry\JMSFormat\Block;

use Mildberry\JMSFormat\JMSAttributeHelper;
use Mildberry\JMSFormat\JMSModifierHelper;

/**
 * @author <NAME> <<EMAIL>>
 */
abstract class JMSAbstractBlock
{
    /**
     * @var string
     */
    protected $blockName;

    /**
     * @return string
     */
    public function getBlockName()
    {
        return $this->blockName;
    }

    /**
     * @return string
     */
    protected function getModifiersClassesString()
    {
        $classes = $this->getModifiersClasses();

        return (!empty($classes)) ? ' class="'.implode(' ', $classes).'"' : '';
    }

    /**
     * @return array
     */
    protected function getModifiersClasses()
    {
        $classes = [];

        $modifiersName = JMSModifierHelper::getAllowedModifiers();

        foreach ($modifiersName as $name) {
            $interfaceName = JMSModifierHelper::getModifierInterfaceClassName($name);
            $methodName = JMSModifierHelper::getModifierGetterHtmlClass($name);

            if ($this instanceof $interfaceName) {
                if ($modifiersValue = $this->$methodName()) {
                    $classes[] = $modifiersValue;
                }
            }
        }

        return $classes;
    }

    /**
     * @return string
     */
    protected function getAttributesHtmlString()
    {
        $attributes = $this->getAttributeHtml();

        return (!empty($attributes)) ? ' '.implode(' ', $attributes) : '';
    }

    /**
     * @return array
     */
    protected function getAttributeHtml()
    {
        $attributes = [];

        $attributesName = JMSAttributeHelper::getAllowedAttributes();

        foreach ($attributesName as $name) {
            $interfaceName = JMSAttributeHelper::getAttributeInterfaceClassName($name);
            $methodName = JMSAttributeHelper::getAttributeGetterName($name);
            if ($this instanceof $interfaceName) {
                if ($attributeValue = $this->$methodName()) {
                    $attributes[] = $name.'="'.$attributeValue.'"';
                }
            }
        }

        return $attributes;
    }
}
<commit_msg>Fix Block code<commit_after><?php

namespace Mildberry\JMSFormat\Block;

use Mildberry\JMSFormat\JMSAttributeHelper;
use Mildberry\JMSFormat\JMSModifierHelper;

/**
 * @author <NAME> <<EMAIL>>
 */
abstract class JMSAbstractBlock
{
    /**
     * @var string
     */
    protected $blockName;

    /**
     * @return string
     */
    public function getBlockName()
    {
        return $this->blockName;
    }
}

{'fraction_non_alphanumeric': 0.13382754584471324, 'fraction_numerical': 0.0, 'mean_word_length': 2.205, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '4644757', 'n_tokens_mistral': 717, 'n_tokens_neox': 706, 'n_words': 126}