<commit_before><?php

namespace  Oro\Bundle\WorkflowBundle\Model\Action;

use Oro\Bundle\WorkflowBundle\Exception\InvalidParameterException;

/**
 * Assign constant to attribute
 * Usage:
 * @assign_constant_value:
 *      attribute: $some.path
 *      value: SomeClass::CONSTANT_NAME
 *
 * Or
 *
 * @assign_constant_value: [$some.path, SomeClass::CONSTANT_NAME]
 */
class AssignConstantValue extends AbstractAction
{
    const NAME = 'assign_constant_value';

    /**
     * @var mixed
     */
    protected $attribute;

    /**
     * @var mixed
     */
    protected $value;

    /**
     * {@inheritdoc}
     */
    protected function executeAction($context)
    {
        $value = $this->contextAccessor->getValue($context, $this->value);
        if (!is_string($value)) {
            throw new InvalidParameterException(
                sprintf(
                    'Action "%s" expects a string in parameter "value", %s is given.',
                    self::NAME,
                    is_object($value) ? get_class($value) : gettype($value)
                )
            );
        }


        $this->contextAccessor->setValue(
            $context,
            $this->attribute,
            $this->evaluateConstant((string)$value)
        );
    }<commit_msg>CRM-2151: Cleanup code from unused code - excess nl<commit_after><?php

namespace  Oro\Bundle\WorkflowBundle\Model\Action;

use Oro\Bundle\WorkflowBundle\Exception\InvalidParameterException;

/**
 * Assign constant to attribute
 * Usage:
 * @assign_constant_value:
 *      attribute: $some.path
 *      value: SomeClass::CONSTANT_NAME
 *
 * Or
 *
 * @assign_constant_value: [$some.path, SomeClass::CONSTANT_NAME]
 */
class AssignConstantValue extends AbstractAction
{
    const NAME = 'assign_constant_value';

    /**
     * @var mixed
     */
    protected $attribute;

    /**
     * @var mixed
     */
    protected $value;

    /**
     * {@inheritdoc}
     */
    protected function executeAction($context)
    {
        $value = $this->contextAccessor->getValue($context, $this->value);
        if (!is_string($value)) {
            throw new InvalidParameterException(
                sprintf(
                    'Action "%s" expects a string in parameter "value", %s is given.',
                    self::NAME,
                    is_object($value) ? get_class($value) : gettype($value)
                )
            );
        }

        $this->contextAccessor->setValue(
            $context,
            $this->attribute,
            $this->evaluateConstant((string)$value)
        );
    }
{'fraction_non_alphanumeric': 0.12495134293499416, 'fraction_numerical': 0.001557026080186843, 'mean_word_length': 2.0963855421686746, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '829085', 'n_tokens_mistral': 728, 'n_tokens_neox': 704, 'n_words': 139}