<commit_before><?php
namespace Codeception;

abstract class Step
{
    const ACTION    = 'Action';
    const COMMENT   = 'Comment';
    const ASSERTION = 'Assertion';

    /**
     * @var    string
     */
    protected $action;

    /**
     * @var    array
     */
    protected $arguments;

    public $executed = false;

    public function __construct($action, array $arguments)
    {
        $this->action = $action;
        $this->arguments = $arguments;
    }

    /**
     * Returns this step's action.
     *
     * @return string
     */
    public function getAction()
    {
        return $this->action;
    }

    /**
     * Returns this step's arguments.
     *
     * @param  boolean $asString
     * @return array|string
     */
    public function getArguments($asString = FALSE)
    {
        if (!$asString) {
            return $this->arguments;
        } else {
            $arguments = $this->arguments;

            foreach ($arguments as $k => $argument) {
                if (!is_string($argument) and is_callable($argument, true)) {
                    $arguments[$k] = 'lambda function';
                    continue;
                }
                if (is_object($argument)) {
                    if (method_exists($argument, '__toString')) {
                        $arguments[$k] = $argument->__toString();
                    } elseif (isset($argument->__mocked)) {
                        $arguments[$k] = $this->formatClassName($argument->__mocked);
                    } else {
                        $arguments[$k] = $this->formatClassName(get_class($argument));
                    }
                    continue;
                }
                // if (settype($argument, 'string') === false) throw new \InvalidArgumentException('Argument can\'t be converted to string or serialized');
            }

            switch (count($arguments)) {
                case 0:
                    return '';
                case 1:
                    if (is_array($arguments[0])) {
                        $arguments[0] = trim(stripcslashes(json_encode($arguments[0])),'[]');
                    }
                    return '"' . $arguments[0] . '"';
                default:

                    return stripcslashes(trim(json_encode($arguments),'[]'));

            }
        }
    }

    protected function formatClassName($classname)
    {
        return trim($classname,"\\");
    }

    abstract public function getName();<commit_msg>utf issues<commit_after><?php
namespace Codeception;

abstract class Step
{
    const ACTION    = 'Action';
    const COMMENT   = 'Comment';
    const ASSERTION = 'Assertion';

    /**
     * @var    string
     */
    protected $action;

    /**
     * @var    array
     */
    protected $arguments;

    public $executed = false;

    public function __construct($action, array $arguments)
    {
        $this->action = $action;
        $this->arguments = $arguments;
    }

    /**
     * Returns this step's action.
     *
     * @return string
     */
    public function getAction()
    {
        return $this->action;
    }

    /**
     * Returns this step's arguments.
     *
     * @param  boolean $asString
     * @return array|string
     */
    public function getArguments($asString = FALSE)
    {
        if (!$asString) {
            return $this->arguments;
        } else {
            $arguments = $this->arguments;

            foreach ($arguments as $k => $argument) {
                if (!is_string($argument) and is_callable($argument, true)) {
                    $arguments[$k] = 'lambda function';
                    continue;
                }
                if (is_object($argument)) {
                    if (method_exists($argument, '__toString')) {
                        $arguments[$k] = $argument->__toString();
                    } elseif (isset($argument->__mocked)) {
                        $arguments[$k] = $this->formatClassName($argument->__mocked);
                    } else {
                        $arguments[$k] = $this->formatClassName(get_class($argument));
                    }
                    continue;
                }
                // if (settype($argument, 'string') === false) throw new \InvalidArgumentException('Argument can\'t be converted to string or serialized');
            }
            return stripcslashes(trim(json_encode($arguments, JSON_UNESCAPED_UNICODE),'[]'));
        }
    }

    protected function formatClassName($classname)
    {
        return trim($classname,"\\");
    }

    abstract public function getName();
{'fraction_non_alphanumeric': 0.12805944055944055, 'fraction_numerical': 0.0013111888111888112, 'mean_word_length': 1.5512820512820513, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '5770676', 'n_tokens_mistral': 1210, 'n_tokens_neox': 1145, 'n_words': 255}