<commit_before><?php
/**
 * Created by PhpStorm.
 * User: balint
 * Date: 2015. 12. 05.
 * Time: 12:30
 */

namespace Evista\Perform;


use Doctrine\Common\Collections\ArrayCollection;
use Evista\Perform\Form\Form;
use Evista\Perform\ValueObject\ExtendedDOMNode;
use Evista\Perform\ValueObject\FormField;
use Symfony\Component\DomCrawler\Crawler;
use Evista\Perform\Exception\UploadDirNotExists;
use Evista\Perform\Exception\NoFileUploadedException;
use Evista\Perform\ValueObject\UploadedFile;

class FormMarkupTranspiler
{
    const formClassNameAttrName = 'data-class';

    private $crawler;
    private $markup;
    private $formTag;
    private $formClassName;
    private $fields;
    private $uploadDir;

    public function __construct(Crawler $crawler, $markup = false, $uploadDir = false)
    {
        $this->crawler = $crawler;
        $this->markup = $markup;
        if ($markup){
            $this->initCrawler();
        }
        if ($uploadDir) {
          $this->uploadDir = $uploadDir;
        } else {
          $this->uploadDir = $_SERVER['DOCUMENT_ROOT'] . '/../var/uploads';<commit_msg>upload dir for the tests<commit_after><?php
/**
 * Created by PhpStorm.
 * User: balint
 * Date: 2015. 12. 05.
 * Time: 12:30
 */

namespace Evista\Perform;


use Doctrine\Common\Collections\ArrayCollection;
use Evista\Perform\Form\Form;
use Evista\Perform\ValueObject\ExtendedDOMNode;
use Evista\Perform\ValueObject\FormField;
use Symfony\Component\DomCrawler\Crawler;
use Evista\Perform\Exception\UploadDirNotExists;
use Evista\Perform\Exception\NoFileUploadedException;
use Evista\Perform\ValueObject\UploadedFile;

class FormMarkupTranspiler
{
    const formClassNameAttrName = 'data-class';

    private $crawler;
    private $markup;
    private $formTag;
    private $formClassName;
    private $fields;
    private $uploadDir;

    public function __construct(Crawler $crawler, $markup = false, $uploadDir = './var/uploads')
    {
        $this->crawler = $crawler;
        $this->markup = $markup;
        if ($markup){
            $this->initCrawler();
        }
        if ($uploadDir) {
          $this->uploadDir = $uploadDir;
        } else {
          $this->uploadDir = $_SERVER['DOCUMENT_ROOT'] . '/../var/uploads';
{'fraction_non_alphanumeric': 0.12438698172090949, 'fraction_numerical': 0.01069995541685243, 'mean_word_length': 3.2661596958174903, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '2824994', 'n_tokens_mistral': 763, 'n_tokens_neox': 729, 'n_words': 143}