<commit_before><?php

namespace common\modules\lead\models\forms;

use common\models\Address;
use common\modules\lead\models\ActiveLead;
use common\modules\lead\models\LeadAddress;
use common\modules\lead\models\LeadAnswer;
use common\modules\lead\models\LeadQuestion;
use common\modules\lead\models\LeadReport;
use common\modules\lead\models\LeadStatus;
use common\modules\lead\models\LeadUser;
use Yii;
use yii\base\Model;
use yii\helpers\ArrayHelper;

/**
 * ReportForm Class.
 *
 * @property-read array $closedQuestionsData
 * @property-write array $openAnswers
 * @property-read LeadQuestion[] $openQuestions
 */
class ReportForm extends Model {

	public string $leadName = '';
	public int $status_id;
	public ?string $details = null;
	public int $owner_id;
	public bool $withSameContacts = true;

	public $closedQuestions = [];

	public int $addressType = LeadAddress::TYPE_CUSTOMER;
	public bool $withAddress = false;
	public ?Address $address = null;

	private ?ActiveLead $lead = null;
	private ?LeadReport $model = null;
	/* @var LeadQuestion[] */
	private ?array $questions = null;
	/* @var AnswerForm[] */
	private array $answersModels = [];

	public bool $withAnswers = true;
	public int $lead_type_id;

	public function setOpenAnswers(array $questionsAnswers): void {
		$models = $this->getAnswersModels();
		foreach ($questionsAnswers as $question_id => $answer) {
			$model = $models[$question_id] ?? null;
			if ($model) {
				$model->answer = $answer;
			}
		}
	}

	public function attributeLabels(): array {
		return [<commit_msg>feat: default disable withSameContact in Lead ReportForm.<commit_after><?php

namespace common\modules\lead\models\forms;

use common\models\Address;
use common\modules\lead\models\ActiveLead;
use common\modules\lead\models\LeadAddress;
use common\modules\lead\models\LeadAnswer;
use common\modules\lead\models\LeadQuestion;
use common\modules\lead\models\LeadReport;
use common\modules\lead\models\LeadStatus;
use common\modules\lead\models\LeadUser;
use Yii;
use yii\base\Model;
use yii\helpers\ArrayHelper;

/**
 * ReportForm Class.
 *
 * @property-read array $closedQuestionsData
 * @property-write array $openAnswers
 * @property-read LeadQuestion[] $openQuestions
 */
class ReportForm extends Model {

	public string $leadName = '';
	public int $status_id;
	public ?string $details = null;
	public int $owner_id;
	public bool $withSameContacts = false;

	public $closedQuestions = [];

	public int $addressType = LeadAddress::TYPE_CUSTOMER;
	public bool $withAddress = false;
	public ?Address $address = null;

	private ?ActiveLead $lead = null;
	private ?LeadReport $model = null;
	/* @var LeadQuestion[] */
	private ?array $questions = null;
	/* @var AnswerForm[] */
	private array $answersModels = [];

	public bool $withAnswers = true;
	public int $lead_type_id;

	public function setOpenAnswers(array $questionsAnswers): void {
		$models = $this->getAnswersModels();
		foreach ($questionsAnswers as $question_id => $answer) {
			$model = $models[$question_id] ?? null;
			if ($model) {
				$model->answer = $answer;
			}
		}
	}

	public function attributeLabels(): array {
		return [
{'fraction_non_alphanumeric': 0.12472160356347439, 'fraction_numerical': 0.0, 'mean_word_length': 4.800738007380073, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2971970', 'n_tokens_mistral': 1057, 'n_tokens_neox': 969, 'n_words': 248}