<commit_before><?php
/**
 * Created by <NAME> <<EMAIL>>
 * Date: 28/05/14
 * Time: 14:37
 */

namespace Keboola\Syrup\Job\Metadata;

use Keboola\Syrup\Exception\ApplicationException;

class Job implements JobInterface
{
    const STATUS_WAITING = 'waiting';
    const STATUS_PROCESSING = 'processing';
    const STATUS_SUCCESS = 'success';
    const STATUS_CANCELLED = 'cancelled';
    const STATUS_ERROR = 'error';
    const STATUS_WARNING = 'warning';
    const STATUS_TERMINATING = 'terminating';
    const STATUS_TERMINATED = 'terminated';

    const ERROR_USER = 'user';
    const ERROR_APPLICATION = 'application';

    protected $index;
    protected $version;
    protected $type;

    protected $data = [];

    public function __construct(array $data = [], $index = null, $type = null, $version = null)
    {
        $this->data['status'] = self::STATUS_WAITING;
        $this->data = array_merge($this->data, $data);

        // make sure jobId is integer
        if (isset($this->data['id'])) {
            $this->setId($this->data['id']);
        }

        if (!isset($this->data['lockName'])) {<commit_msg>fix (Job): default property values<commit_after><?php
/**
 * Created by <NAME> <<EMAIL>>
 * Date: 28/05/14
 * Time: 14:37
 */

namespace Keboola\Syrup\Job\Metadata;

use Keboola\Syrup\Exception\ApplicationException;

class Job implements JobInterface
{
    const STATUS_WAITING = 'waiting';
    const STATUS_PROCESSING = 'processing';
    const STATUS_SUCCESS = 'success';
    const STATUS_CANCELLED = 'cancelled';
    const STATUS_ERROR = 'error';
    const STATUS_WARNING = 'warning';
    const STATUS_TERMINATING = 'terminating';
    const STATUS_TERMINATED = 'terminated';

    const ERROR_USER = 'user';
    const ERROR_APPLICATION = 'application';

    protected $index;
    protected $version;
    protected $type;

    protected $data = [
        'id' => null,
        'runId' => null,
        'lockName' => null,
        'project' => [
            'id' => null,
            'name' => null
        ],
        'token' => [
            'id' => null,
            'description' => null,
            'token' => null
        ],
        'component' => null,
        'command' => null,
        'params' => [],
        'result' => [],
        'status' => null,
        'process' => [
            'host' => null,
            'pid' => null
        ],
        'createdTime' => null,
        'startTime' => null,
        'endTime' => null,
        'durationSeconds' => null,
        'waitSeconds' => null
    ];

    public function __construct(array $data = [], $index = null, $type = null, $version = null)
    {
        $this->data['status'] = self::STATUS_WAITING;
        $this->data = array_merge($this->data, $data);

        // make sure jobId is integer
        if (isset($this->data['id'])) {
            $this->setId($this->data['id']);
        }

        if (!isset($this->data['lockName'])) {
{'fraction_non_alphanumeric': 0.1547415268743581, 'fraction_numerical': 0.006846970215679562, 'mean_word_length': 2.4457547169811322, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 46, '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': '3817256', 'n_tokens_mistral': 925, 'n_tokens_neox': 904, 'n_words': 205}