From ad891fe8c3a11561bd7521189b7486bbcd3c61ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Gon=C3=A7alves?= Date: Mon, 25 Nov 2024 12:24:33 -0300 Subject: [PATCH] fix: sagres and session time --- app/components/Controller.php | 4 +- app/composer.lock | 82 +- app/config/main.php | 4 - .../sagres/models/SagresConsultModel.php | 870 +++++++++--------- composer.lock | 218 ++--- config.php | 3 + 6 files changed, 600 insertions(+), 581 deletions(-) diff --git a/app/components/Controller.php b/app/components/Controller.php index d2e910e36..ed788c2ed 100755 --- a/app/components/Controller.php +++ b/app/components/Controller.php @@ -31,8 +31,8 @@ public function init() $authTimeout = Yii::app()->user->getState("authTimeout", 5*60*60); // Valor padrão de 1800 segundos (30 minutos) Yii::app()->user->authTimeout = $authTimeout; - ini_set('session.gc_maxlifetime', value: $authTimeout); - ini_set('session.cookie_lifetime', $authTimeout); + // ini_set('session.gc_maxlifetime', value: $authTimeout); + // ini_set('session.cookie_lifetime', $authTimeout); Yii::app()->sentry->setUserContext([ 'id' => Yii::app()->user->loginInfos->id, diff --git a/app/composer.lock b/app/composer.lock index a2cf34022..795e3f9c9 100644 --- a/app/composer.lock +++ b/app/composer.lock @@ -2080,16 +2080,16 @@ }, { "name": "goetas-webservices/xsd-reader", - "version": "0.4.7", + "version": "0.4.8", "source": { "type": "git", "url": "https://github.com/goetas-webservices/xsd-reader.git", - "reference": "8f4e6fb81667510426d749e081b7ae1cfc18f71d" + "reference": "0766af5df34779ead9d910e144cf38c2cb661ce3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/goetas-webservices/xsd-reader/zipball/8f4e6fb81667510426d749e081b7ae1cfc18f71d", - "reference": "8f4e6fb81667510426d749e081b7ae1cfc18f71d", + "url": "https://api.github.com/repos/goetas-webservices/xsd-reader/zipball/0766af5df34779ead9d910e144cf38c2cb661ce3", + "reference": "0766af5df34779ead9d910e144cf38c2cb661ce3", "shasum": "" }, "require": { @@ -2134,7 +2134,7 @@ ], "support": { "issues": "https://github.com/goetas-webservices/xsd-reader/issues", - "source": "https://github.com/goetas-webservices/xsd-reader/tree/0.4.7" + "source": "https://github.com/goetas-webservices/xsd-reader/tree/0.4.8" }, "funding": [ { @@ -2150,7 +2150,7 @@ "type": "patreon" } ], - "time": "2024-09-01T18:48:08+00:00" + "time": "2024-11-23T07:49:42+00:00" }, { "name": "goetas-webservices/xsd2php", @@ -2239,16 +2239,16 @@ }, { "name": "laminas/laminas-code", - "version": "4.15.1", + "version": "4.16.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-code.git", - "reference": "877ad42fe9c164785182fca8afa3f416a056884d" + "reference": "1793e78dad4108b594084d05d1fb818b85b110af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-code/zipball/877ad42fe9c164785182fca8afa3f416a056884d", - "reference": "877ad42fe9c164785182fca8afa3f416a056884d", + "url": "https://api.github.com/repos/laminas/laminas-code/zipball/1793e78dad4108b594084d05d1fb818b85b110af", + "reference": "1793e78dad4108b594084d05d1fb818b85b110af", "shasum": "" }, "require": { @@ -2298,20 +2298,20 @@ "type": "community_bridge" } ], - "time": "2024-10-25T10:15:16+00:00" + "time": "2024-11-20T13:15:13+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -2350,7 +2350,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -2358,7 +2358,7 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "phar-io/manifest", @@ -3784,16 +3784,16 @@ }, { "name": "symfony/config", - "version": "v7.1.6", + "version": "v7.1.7", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "5c6152766251ff45a44b76affadd5287e253fb27" + "reference": "dc373a5cbd345354696f5dfd39c5c7a8ea23f4c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/5c6152766251ff45a44b76affadd5287e253fb27", - "reference": "5c6152766251ff45a44b76affadd5287e253fb27", + "url": "https://api.github.com/repos/symfony/config/zipball/dc373a5cbd345354696f5dfd39c5c7a8ea23f4c8", + "reference": "dc373a5cbd345354696f5dfd39c5c7a8ea23f4c8", "shasum": "" }, "require": { @@ -3839,7 +3839,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v7.1.6" + "source": "https://github.com/symfony/config/tree/v7.1.7" }, "funding": [ { @@ -3855,20 +3855,20 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:11:02+00:00" + "time": "2024-11-04T11:34:07+00:00" }, { "name": "symfony/console", - "version": "v7.1.6", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "bb5192af6edc797cbab5c8e8ecfea2fe5f421e57" + "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/bb5192af6edc797cbab5c8e8ecfea2fe5f421e57", - "reference": "bb5192af6edc797cbab5c8e8ecfea2fe5f421e57", + "url": "https://api.github.com/repos/symfony/console/zipball/ff04e5b5ba043d2badfb308197b9e6b42883fcd5", + "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5", "shasum": "" }, "require": { @@ -3932,7 +3932,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.6" + "source": "https://github.com/symfony/console/tree/v7.1.8" }, "funding": [ { @@ -3948,20 +3948,20 @@ "type": "tidelift" } ], - "time": "2024-10-09T08:46:59+00:00" + "time": "2024-11-06T14:23:19+00:00" }, { "name": "symfony/dependency-injection", - "version": "v7.1.6", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "1f12f9d580ef8dd09e3b756aa111cc2d5f311bfd" + "reference": "e4d13f0f394f4d02a041ff76acd31c5a20a5f70b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/1f12f9d580ef8dd09e3b756aa111cc2d5f311bfd", - "reference": "1f12f9d580ef8dd09e3b756aa111cc2d5f311bfd", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e4d13f0f394f4d02a041ff76acd31c5a20a5f70b", + "reference": "e4d13f0f394f4d02a041ff76acd31c5a20a5f70b", "shasum": "" }, "require": { @@ -4012,7 +4012,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v7.1.6" + "source": "https://github.com/symfony/dependency-injection/tree/v7.1.8" }, "funding": [ { @@ -4028,7 +4028,7 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:11:02+00:00" + "time": "2024-11-09T09:16:45+00:00" }, { "name": "symfony/filesystem", @@ -4259,16 +4259,16 @@ }, { "name": "symfony/string", - "version": "v7.1.6", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "61b72d66bf96c360a727ae6232df5ac83c71f626" + "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/61b72d66bf96c360a727ae6232df5ac83c71f626", - "reference": "61b72d66bf96c360a727ae6232df5ac83c71f626", + "url": "https://api.github.com/repos/symfony/string/zipball/591ebd41565f356fcd8b090fe64dbb5878f50281", + "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281", "shasum": "" }, "require": { @@ -4326,7 +4326,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.6" + "source": "https://github.com/symfony/string/tree/v7.1.8" }, "funding": [ { @@ -4342,7 +4342,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2024-11-13T13:31:21+00:00" }, { "name": "symfony/var-exporter", diff --git a/app/config/main.php b/app/config/main.php index c5594f47a..b739fcabd 100755 --- a/app/config/main.php +++ b/app/config/main.php @@ -5,10 +5,6 @@ // This is the main Web application configuration. Any writable // CWebApplication propeties can be configured here. -\Sentry\configureScope(function (\Sentry\State\Scope $scope): void { - $scope->setUser(['email' => 'jane.doe@example.com']); -}); - $LOG_PATH = "/app/app/runtime/" . INSTANCE . "/" . date("Y-m-d"); if (!file_exists($LOG_PATH)) { diff --git a/app/modules/sagres/models/SagresConsultModel.php b/app/modules/sagres/models/SagresConsultModel.php index 8161dbc55..edd7b0782 100644 --- a/app/modules/sagres/models/SagresConsultModel.php +++ b/app/modules/sagres/models/SagresConsultModel.php @@ -2,7 +2,6 @@ namespace SagresEdu; -require_once 'vendor/autoload.php'; use Datetime; @@ -61,7 +60,7 @@ public function getSagresEdu($referenceYear, $month, $finalClass, $noMovement, $ $education = new EducacaoTType(); $managementUnitId = $this->getManagementId(); - if($noMovement) { + if ($noMovement) { $education->setPrestacaoContas($this->getManagementUnit($managementUnitId, $referenceYear, $month)); return $education; } @@ -164,45 +163,45 @@ public function getManagementUnit($managementUnitId, $referenceYear, $month): Ca ->setDiaInicPresContas((int) 01) ->setDiaFinaPresContas($finalDay); - if (empty($managementUnit['managementUnitCode'])) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'UNIDADE GESTORA: ' . $managementUnit['managementUnitName']; - $inconsistencyModel->school = 'Unidade Gestora'; - $inconsistencyModel->description = 'Código da Unidade Gestora não informado'; - $inconsistencyModel->action = 'Por favor, informe o código de identificação da Unidade Gestora'; - $inconsistencyModel->identifier = '0'; - $inconsistencyModel->insert(); - } + if (empty($managementUnit['managementUnitCode'])) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'UNIDADE GESTORA: ' . $managementUnit['managementUnitName']; + $inconsistencyModel->school = 'Unidade Gestora'; + $inconsistencyModel->description = 'Código da Unidade Gestora não informado'; + $inconsistencyModel->action = 'Por favor, informe o código de identificação da Unidade Gestora'; + $inconsistencyModel->identifier = '0'; + $inconsistencyModel->insert(); + } - if (empty($managementUnit['managementUnitName'])) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'UNIDADE GESTORA'; - $inconsistencyModel->school = 'Unidade Gestora'; - $inconsistencyModel->description = 'Nome da Unidade Gestora não informado'; - $inconsistencyModel->action = 'Por favor, informe um nome para a Unidade Gestora'; - $inconsistencyModel->identifier = '0'; - $inconsistencyModel->insert(); - } + if (empty($managementUnit['managementUnitName'])) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'UNIDADE GESTORA'; + $inconsistencyModel->school = 'Unidade Gestora'; + $inconsistencyModel->description = 'Nome da Unidade Gestora não informado'; + $inconsistencyModel->action = 'Por favor, informe um nome para a Unidade Gestora'; + $inconsistencyModel->identifier = '0'; + $inconsistencyModel->insert(); + } - if (empty($managementUnit['responsibleCpf'])) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'UNIDADE GESTORA: ' . $managementUnit['managementUnitName']; - $inconsistencyModel->school = 'Unidade Gestora'; - $inconsistencyModel->description = 'CPF do responsável não informado'; - $inconsistencyModel->action = 'Por favor, informe um CPF válido para o responsável'; - $inconsistencyModel->identifier = '0'; - $inconsistencyModel->insert(); - } + if (empty($managementUnit['responsibleCpf'])) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'UNIDADE GESTORA: ' . $managementUnit['managementUnitName']; + $inconsistencyModel->school = 'Unidade Gestora'; + $inconsistencyModel->description = 'CPF do responsável não informado'; + $inconsistencyModel->action = 'Por favor, informe um CPF válido para o responsável'; + $inconsistencyModel->identifier = '0'; + $inconsistencyModel->insert(); + } - if (empty($managementUnit['managerCpf'])) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'UNIDADE GESTORA: ' . $managementUnit['managementUnitName']; - $inconsistencyModel->school = 'Unidade Gestora'; - $inconsistencyModel->description = 'CPF do gestor não informado'; - $inconsistencyModel->action = 'Por favor, informe um CPF válido para o gestor'; - $inconsistencyModel->identifier = '0'; - $inconsistencyModel->insert(); - } + if (empty($managementUnit['managerCpf'])) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'UNIDADE GESTORA: ' . $managementUnit['managementUnitName']; + $inconsistencyModel->school = 'Unidade Gestora'; + $inconsistencyModel->description = 'CPF do gestor não informado'; + $inconsistencyModel->action = 'Por favor, informe um CPF válido para o gestor'; + $inconsistencyModel->identifier = '0'; + $inconsistencyModel->insert(); + } return $headerType; @@ -211,22 +210,23 @@ public function getManagementUnit($managementUnitId, $referenceYear, $month): Ca } } - private function ajustarUltimoDiaUtil($referenceYear, $month, $finalDay) { + private function ajustarUltimoDiaUtil($referenceYear, $month, $finalDay) + { $url = "https://brasilapi.com.br/api/feriados/v1/" . $referenceYear; $responseFeriados = file_get_contents($url); - if($responseFeriados !== false) { + if ($responseFeriados !== false) { $datas = json_decode($responseFeriados, true); - if($datas !== null) { - foreach($datas as $data) { + if ($datas !== null) { + foreach ($datas as $data) { $mes = (int) substr($data['date'], 5, 2); - if($mes < $month) + if ($mes < $month) continue; - if($mes > $month) + if ($mes > $month) break; $day = (int) substr($data['date'], -2); - if($day === $finalDay){ + if ($day === $finalDay) { $finalDay -= 1; } } @@ -346,7 +346,8 @@ public function getSchools($referenceYear, $month, $finalClass, $withoutCpf) return $schoolList; } - private function enrolledSimultaneouslyInRegularClasses(int $year){ + private function enrolledSimultaneouslyInRegularClasses(int $year) + { $query = "SELECT DISTINCT student_fk FROM student_enrollment se JOIN classroom c ON c.id = se.classroom_fk @@ -365,7 +366,7 @@ private function enrolledSimultaneouslyInRegularClasses(int $year){ $processedStudents = []; - foreach($students as $student){ + foreach ($students as $student) { $infoStudent = $this->getStudentInfo($student['student_fk']); $count = $this->getCountOfClassrooms($student, $infoStudent, $year); $this->checkStudentEnrollment($student['student_fk'], $year, $infoStudent); @@ -378,7 +379,8 @@ private function enrolledSimultaneouslyInRegularClasses(int $year){ } - private function getCountOfClassrooms($student, $infoStudent, $year) { + private function getCountOfClassrooms($student, $infoStudent, $year) + { $query = "SELECT complementary_activity, aee, school_inep_id_fk, c.name FROM student_enrollment se JOIN classroom c ON se.classroom_fk = c.id @@ -435,7 +437,8 @@ private function getCountOfClassrooms($student, $infoStudent, $year) { ]; } - private function checkStudentEnrollment($student_fk, $year, $infoStudent) { + private function checkStudentEnrollment($student_fk, $year, $infoStudent) + { // Query to get the modalities $sql = "SELECT c.modality, c.complementary_activity, se.classroom_fk, se.school_inep_id_fk FROM student_enrollment se @@ -458,9 +461,9 @@ private function checkStudentEnrollment($student_fk, $year, $infoStudent) { $modalities = array_column($results, 'modality'); $modalities = array_map('intval', $modalities); - if($complem[0] === 1){ + if ($complem[0] === 1) { $modalities[0] = 6; - }elseif($complem[1] === 1){ + } elseif ($complem[1] === 1) { $modalities[1] = 6; } @@ -481,20 +484,21 @@ private function checkStudentEnrollment($student_fk, $year, $infoStudent) { $inconsistencyModel->idStudent = $student_fk; $inconsistencyModel->idClass = $infoStudent['classroom_fk']; $inconsistencyModel->idSchool = $infoStudent['school_inep_id_fk']; - $inconsistencyModel->description = 'CPF '. $studentData['cpf'] . ' do aluno ' . $infoStudent['name'] . ' duplicado'; + $inconsistencyModel->description = 'CPF ' . $studentData['cpf'] . ' do aluno ' . $infoStudent['name'] . ' duplicado'; $inconsistencyModel->action = 'Remova a matrícula do aluno de uma das turmas'; $inconsistencyModel->save(); } else { $schoolInepId = array_column($results, 'school_inep_id_fk'); $schoolInepId = array_map('intval', $schoolInepId); - if(( - $schoolInepId[0] !== $schoolInepId[1]) && + if ( + ( + $schoolInepId[0] !== $schoolInepId[1]) && (($modalities[0] === 1 && $modalities[1] === 1) || - ($modalities[0] === 3 && $modalities[1] === 2) || - ($modalities[0] === 2 && $modalities[1] === 3) - )) - { + ($modalities[0] === 3 && $modalities[1] === 2) || + ($modalities[0] === 2 && $modalities[1] === 3) + ) + ) { $studentData = $this->getStudentDataById($student_fk); $inconsistencyModel = new ValidationSagresModel(); @@ -504,12 +508,12 @@ private function checkStudentEnrollment($student_fk, $year, $infoStudent) { $inconsistencyModel->idStudent = $student_fk; $inconsistencyModel->idClass = $infoStudent['classroom_fk']; $inconsistencyModel->idSchool = $infoStudent['school_inep_id_fk']; - $inconsistencyModel->description = 'CPF '. $studentData['cpf'] . ' do aluno ' . $infoStudent['name'] . ' duplicado'; + $inconsistencyModel->description = 'CPF ' . $studentData['cpf'] . ' do aluno ' . $infoStudent['name'] . ' duplicado'; $inconsistencyModel->action = 'Remova a matrícula do aluno de uma das turmas'; $inconsistencyModel->save(); } } - } elseif(count($results) > 2) { + } elseif (count($results) > 2) { $modalityCount = 0; foreach ($results as $infoStudent) { @@ -535,7 +539,8 @@ private function checkStudentEnrollment($student_fk, $year, $infoStudent) { } } - private function getStudentDataById($id) { + private function getStudentDataById($id) + { $sql = "SELECT sdaa.cpf, si.name FROM student_documents_and_address sdaa JOIN school_identification si ON si.inep_id = sdaa.school_inep_id_fk @@ -562,7 +567,8 @@ private function duplicatedSchool($student, $infoStudent){ $inconsistencyModel->save(); }*/ - private function getStudentInfo($student_fk) { + private function getStudentInfo($student_fk) + { $sql = "SELECT si.name, sdaa.cpf FROM student_identification si JOIN student_documents_and_address sdaa ON sdaa.id = si.id WHERE si.id = :id"; @@ -572,7 +578,8 @@ private function getStudentInfo($student_fk) { return $command->queryRow(); } - private function getSchoolName($inepId){ + private function getSchoolName($inepId) + { $sql = "SELECT si.name FROM school_identification si WHERE si.inep_id = :inepId"; $command = Yii::app()->db->createCommand($sql); @@ -580,41 +587,43 @@ private function getSchoolName($inepId){ return $command->queryScalar(); } - private function checkAge($age, $educationLevel, $arrayStudentInfo) { - // [2,3,7] -> Ensino fundamental - // 4 -> Ensino Médio - if (in_array($educationLevel, [2,3,7]) && $age < 15) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'ALUNO'; - $inconsistencyModel->school = $this->getSchoolName($arrayStudentInfo['schoolInepIdFk']); - $inconsistencyModel->identifier = '9'; - $inconsistencyModel->idStudent = $arrayStudentInfo['studentFk']; - $inconsistencyModel->idClass = $arrayStudentInfo['classroomFk']; - $inconsistencyModel->idSchool = $arrayStudentInfo['schoolInepIdFk']; - $inconsistencyModel->description = 'O aluno não tem a idade mínima de 15 anos para o Ensino Fundamental.'; - $inconsistencyModel->action = 'O aluno deve der a idade compatível com a turma'; - $inconsistencyModel->save(); - } elseif ($educationLevel === 4 && $age < 18) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'ALUNO'; - $inconsistencyModel->school = $this->getSchoolName($arrayStudentInfo['schoolInepIdFk']); - $inconsistencyModel->identifier = '9'; - $inconsistencyModel->idStudent = $arrayStudentInfo['studentFk']; - $inconsistencyModel->idClass = $arrayStudentInfo['classroomFk']; - $inconsistencyModel->idSchool = $arrayStudentInfo['schoolInepIdFk']; - $inconsistencyModel->description = 'O aluno não tem a idade mínima de 18 anos para o Ensino Médio'; - $inconsistencyModel->action = 'O aluno deve der a idade compatível com a turma'; - $inconsistencyModel->save(); - } + private function checkAge($age, $educationLevel, $arrayStudentInfo) + { + // [2,3,7] -> Ensino fundamental + // 4 -> Ensino Médio + if (in_array($educationLevel, [2, 3, 7]) && $age < 15) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'ALUNO'; + $inconsistencyModel->school = $this->getSchoolName($arrayStudentInfo['schoolInepIdFk']); + $inconsistencyModel->identifier = '9'; + $inconsistencyModel->idStudent = $arrayStudentInfo['studentFk']; + $inconsistencyModel->idClass = $arrayStudentInfo['classroomFk']; + $inconsistencyModel->idSchool = $arrayStudentInfo['schoolInepIdFk']; + $inconsistencyModel->description = 'O aluno não tem a idade mínima de 15 anos para o Ensino Fundamental.'; + $inconsistencyModel->action = 'O aluno deve der a idade compatível com a turma'; + $inconsistencyModel->save(); + } elseif ($educationLevel === 4 && $age < 18) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'ALUNO'; + $inconsistencyModel->school = $this->getSchoolName($arrayStudentInfo['schoolInepIdFk']); + $inconsistencyModel->identifier = '9'; + $inconsistencyModel->idStudent = $arrayStudentInfo['studentFk']; + $inconsistencyModel->idClass = $arrayStudentInfo['classroomFk']; + $inconsistencyModel->idSchool = $arrayStudentInfo['schoolInepIdFk']; + $inconsistencyModel->description = 'O aluno não tem a idade mínima de 18 anos para o Ensino Médio'; + $inconsistencyModel->action = 'O aluno deve der a idade compatível com a turma'; + $inconsistencyModel->save(); + } } - public function createInconsistencyModel($student, $infoStudent, $count) { + public function createInconsistencyModel($student, $infoStudent, $count) + { - if($count['count'] >= 3){ + if ($count['count'] >= 3) { $inconsistencyModel = new ValidationSagresModel(); $inconsistencyModel->enrollment = 'MATRÍCULA'; $inconsistencyModel->school = $this->getSchoolName($student['school_inep_id_fk']); - $inconsistencyModel->description = 'Estudante ' . $infoStudent['name'] . ' com CPF ' . $infoStudent['cpf'] . ' está matriculado em mais de uma turma regular'; + $inconsistencyModel->description = 'Estudante ' . $infoStudent['name'] . ' com CPF ' . $infoStudent['cpf'] . ' está matriculado em mais de uma turma regular'; $inconsistencyModel->action = 'Um aluno não deve estar matriculado simultaneamente em mais de uma turma regular'; $inconsistencyModel->identifier = '9'; $inconsistencyModel->idStudent = $student['student_fk']; @@ -630,9 +639,10 @@ public function getInconsistenciesCount() array( 'condition' => 'userid = :userid', 'params' => array(':userid' => Yii::app()->user->loginInfos->id) - ))->itemname; + ) + )->itemname; - if($authAssignment === "manager") { + if ($authAssignment === "manager") { $idSchool = Yii::app()->user->school; $query = "SELECT count(*) FROM inconsistency_sagres is2 WHERE is2.idSchool = $idSchool"; } else { @@ -683,7 +693,7 @@ classroom c $query = "SELECT name from school_identification WHERE inep_id = :inepId"; $schoolName = Yii::app()->db->createCommand($query)->bindValues(array('inepId' => $inepId))->queryScalar(); - if(empty($turmas)) { + if (empty($turmas)) { $inconsistencyModel = new ValidationSagresModel(); $inconsistencyModel->enrollment = 'ESCOLA'; $inconsistencyModel->school = $schoolName; @@ -700,7 +710,7 @@ classroom c $matriculas = $this->getEnrollments($classId, $referenceYear, $month, $finalClass, $inepId, $withoutCpf); - if($matriculas === null) + if ($matriculas === null) continue; $classType @@ -726,11 +736,11 @@ classroom c 'params' => array(':classroomId' => $classId), )); - if($count === 0) { + if ($count === 0) { $inconsistencyModel = new ValidationSagresModel(); $inconsistencyModel->enrollment = TURMA_STRONG; $inconsistencyModel->school = $schoolRes['name']; - $inconsistencyModel->description = 'Não há matrículas ativas para a turma: '. $classType->getDescricao() . ''; + $inconsistencyModel->description = 'Não há matrículas ativas para a turma: ' . $classType->getDescricao() . ''; $inconsistencyModel->action = 'Adicione alunos para a turma: ' . $classType->getDescricao(); $inconsistencyModel->identifier = '10'; $inconsistencyModel->idClass = $classId; @@ -776,7 +786,7 @@ classroom c $inconsistencyModel->idSchool = $inepId; $inconsistencyModel->insert(); } - if($classType->getTurno() === 0){ + if ($classType->getTurno() === 0) { $inconsistencyModel = new ValidationSagresModel(); $inconsistencyModel->enrollment = TURMA_STRONG; $inconsistencyModel->school = $schoolRes['name']; @@ -786,7 +796,7 @@ classroom c $inconsistencyModel->idClass = $classId; $inconsistencyModel->idSchool = $inepId; $inconsistencyModel->insert(); - }else{ + } else { if (!in_array($classType->getTurno(), [1, 2, 3, 4])) { $inconsistencyModel = new ValidationSagresModel(); $inconsistencyModel->enrollment = TURMA_STRONG; @@ -843,12 +853,9 @@ classroom c $serie = (object) $serie; $serieType = new SerieTType(); - if((int)$serie->complementaryActivity === 1){ - if((int)$serie->schooling === 1) - $modality = 2; - else - $modality = 6; - }else{ + if ((int) $serie->complementaryActivity === 1) { + $modality = (int) $serie->schooling === 1 ? 2 : 6; + } else { $modality = $serie->serieModality; } @@ -856,60 +863,60 @@ classroom c ->setDescricao($serie->serieDescription) ->setModalidade($modality); - if (empty($serieType)) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = SERIE_STRONG; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Não há série para a escola: ' . $school->name; - $inconsistencyModel->action = 'Adicione uma série para a turma'; - $inconsistencyModel->identifier = '10'; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->insert(); - } + if (empty($serieType)) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = SERIE_STRONG; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Não há série para a escola: ' . $school->name; + $inconsistencyModel->action = 'Adicione uma série para a turma'; + $inconsistencyModel->identifier = '10'; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->insert(); + } - if (strlen($serieType->getDescricao()) <= $strlen) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = SERIE_STRONG; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Descrição para a série: ' . $serieType->getDescricao() . ' menor que 3 caracteres'; - $inconsistencyModel->action = 'Forneça uma descrição mais detalhada, contendo mais de 5 caracteres'; - $inconsistencyModel->identifier = '10'; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->insert(); - } + if (strlen($serieType->getDescricao()) <= $strlen) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = SERIE_STRONG; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Descrição para a série: ' . $serieType->getDescricao() . ' menor que 3 caracteres'; + $inconsistencyModel->action = 'Forneça uma descrição mais detalhada, contendo mais de 5 caracteres'; + $inconsistencyModel->identifier = '10'; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->insert(); + } - if (strlen($serieType->getDescricao()) > $strMaxLength) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = SERIE_STRONG; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Descrição para a série: ' . $serieType->getDescricao() . ' com mais de 50 caracteres'; - $inconsistencyModel->action = 'Forneça uma descrição menos detalhada, contendo até 50 caracteres'; - $inconsistencyModel->identifier = '10'; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->idSchool = $inepId; - $inconsistencyModel->insert(); - } - /* - * 1 - Educação Infantil - * 2 - Ensino Fundamental - * 3 - Ensino Médio - * 4 - Educação de Jovens e Adultos - * 5 - Atendimento Educacional Especializado - * 6 - Atividades Complementares - */ - if (!in_array($serieType->getModalidade(), [1, 2, 3, 4, 5, 6])) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = SERIE_STRONG; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Modalidade inválida'; - $inconsistencyModel->action = 'Selecione uma modalidade válida para a série'; - $inconsistencyModel->identifier = '10'; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->idSchool = $inepId; - $inconsistencyModel->insert(); - } + if (strlen($serieType->getDescricao()) > $strMaxLength) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = SERIE_STRONG; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Descrição para a série: ' . $serieType->getDescricao() . ' com mais de 50 caracteres'; + $inconsistencyModel->action = 'Forneça uma descrição menos detalhada, contendo até 50 caracteres'; + $inconsistencyModel->identifier = '10'; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->idSchool = $inepId; + $inconsistencyModel->insert(); + } + /* + * 1 - Educação Infantil + * 2 - Ensino Fundamental + * 3 - Ensino Médio + * 4 - Educação de Jovens e Adultos + * 5 - Atendimento Educacional Especializado + * 6 - Atividades Complementares + */ + if (!in_array($serieType->getModalidade(), [1, 2, 3, 4, 5, 6])) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = SERIE_STRONG; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Modalidade inválida'; + $inconsistencyModel->action = 'Selecione uma modalidade válida para a série'; + $inconsistencyModel->identifier = '10'; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->idSchool = $inepId; + $inconsistencyModel->insert(); + } $seriesList[] = $serieType; } @@ -958,14 +965,14 @@ public function getSchedules($classId, $month, $inepId) $schedules = Yii::app()->db->createCommand($query)->bindValues($params)->queryAll(); - if(empty($schedules)){ + if (empty($schedules)) { $this->checkScheduleInconsistencies($classId, $month, $school->name, $inepId); } $class = (object) \Classroom::model()->findByAttributes(array('id' => $classId)); $timetable = $this->getTimetableByClassroom($classId, $month); - if(empty($timetable)){ + if (empty($timetable)) { $inconsistencyModel = new ValidationSagresModel(); $inconsistencyModel->enrollment = TURMA_STRONG; $inconsistencyModel->school = $school->name; @@ -978,7 +985,7 @@ public function getSchedules($classId, $month, $inepId) } $getTeachersForClass = $this->getTeachersForClass($classId); - if(empty($getTeachersForClass)) { + if (empty($getTeachersForClass)) { $inconsistencyModel = new ValidationSagresModel(); $inconsistencyModel->enrollment = TURMA_STRONG; $inconsistencyModel->school = $school->name; @@ -990,31 +997,31 @@ public function getSchedules($classId, $month, $inepId) $inconsistencyModel->insert(); } - if(!empty($getTeachersForClass)) { - foreach($getTeachersForClass as $teachers) { + if (!empty($getTeachersForClass)) { + foreach ($getTeachersForClass as $teachers) { $name = $teachers['name']; $idTeacher = $teachers['instructor_fk']; $infoTeacher = \InstructorDocumentsAndAddress::model()->findByPk($idTeacher, array('select' => 'id, cpf')); $cpfInstructor = $infoTeacher['cpf']; - if($cpfInstructor === null){ + if ($cpfInstructor === null) { $inconsistencyModel = new ValidationSagresModel(); $inconsistencyModel->enrollment = 'PROFESSOR'; $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'CPF não foi informado para o professor(a): ' . $name .''; + $inconsistencyModel->description = 'CPF não foi informado para o professor(a): ' . $name . ''; $inconsistencyModel->action = 'Informar um CPF válido para o professor'; $inconsistencyModel->identifier = '3'; $inconsistencyModel->idProfessional = $idTeacher; $inconsistencyModel->idClass = $classId; $inconsistencyModel->idSchool = $inepId; $inconsistencyModel->insert(); - }else { + } else { if (!$this->validaCPF($cpfInstructor)) { $inconsistencyModel = new ValidationSagresModel(); $inconsistencyModel->enrollment = 'PROFESSOR'; $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'CPF do professor(a) '. $name . ' é inválido: ' . $cpfInstructor . ''; + $inconsistencyModel->description = 'CPF do professor(a) ' . $name . ' é inválido: ' . $cpfInstructor . ''; $inconsistencyModel->action = 'Informar um CPF válido para o professor(a)'; $inconsistencyModel->identifier = '3'; $inconsistencyModel->idProfessional = $idTeacher; @@ -1027,7 +1034,7 @@ public function getSchedules($classId, $month, $inepId) $componentesCurriculares = $this->getComponentesCurriculares($classId, $idTeacher); $roleType = (int) $this->getInstructorRole($classId, $idTeacher); - if(empty($componentesCurriculares) && $roleType === 1){ + if (empty($componentesCurriculares) && $roleType === 1) { $inconsistencyModel = new ValidationSagresModel(); $inconsistencyModel->enrollment = TURMA_STRONG; $inconsistencyModel->school = $school->name; @@ -1068,65 +1075,65 @@ public function getSchedules($classId, $month, $inepId) ->setDisciplina($disciplina) ->setCpfProfessor([str_replace([".", "-"], "", $schedule['cpfInstructor'])]); - if (empty($scheduleType)) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'HORÁRIO'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Não há um professor, horários ou componentes curriculares para a turma: '; - $inconsistencyModel->action = 'Adicione um professor ou componentes curriculares à turma'; - $inconsistencyModel->identifier = '10'; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->idSchool = $inepId; - $inconsistencyModel->insert(); - } + if (empty($scheduleType)) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'HORÁRIO'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Não há um professor, horários ou componentes curriculares para a turma: '; + $inconsistencyModel->action = 'Adicione um professor ou componentes curriculares à turma'; + $inconsistencyModel->identifier = '10'; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->idSchool = $inepId; + $inconsistencyModel->insert(); + } - if (!in_array($scheduleType->getDiaSemana(), [1, 2, 3, 4, 5, 6, 7])) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'HORÁRIO'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Dia da semana inválido: ' . $scheduleType->getDiaSemana(); - $inconsistencyModel->action = 'Adicione um dia da semana válido para a disciplina'; - $inconsistencyModel->identifier = '10'; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->idSchool = $inepId; - $inconsistencyModel->insert(); - } + if (!in_array($scheduleType->getDiaSemana(), [1, 2, 3, 4, 5, 6, 7])) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'HORÁRIO'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Dia da semana inválido: ' . $scheduleType->getDiaSemana(); + $inconsistencyModel->action = 'Adicione um dia da semana válido para a disciplina'; + $inconsistencyModel->identifier = '10'; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->idSchool = $inepId; + $inconsistencyModel->insert(); + } - if (!is_int($scheduleType->getDuracao())) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'HORÁRIO'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Duração inválida'; - $inconsistencyModel->action = 'Adicione um dia da semana válido para a disciplina'; - $inconsistencyModel->identifier = '10'; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->idSchool = $inepId; - $inconsistencyModel->insert(); - } + if (!is_int($scheduleType->getDuracao())) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'HORÁRIO'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Duração inválida'; + $inconsistencyModel->action = 'Adicione um dia da semana válido para a disciplina'; + $inconsistencyModel->identifier = '10'; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->idSchool = $inepId; + $inconsistencyModel->insert(); + } - if (strlen($scheduleType->getDisciplina()) < $strlen) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'HORÁRIO'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Nome da disciplina muito curta'; - $inconsistencyModel->action = 'Adicione um nome para a disciplina com pelo menos 5 caracteres'; - $inconsistencyModel->identifier = '10'; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->idSchool = $inepId; - $inconsistencyModel->insert(); - } + if (strlen($scheduleType->getDisciplina()) < $strlen) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'HORÁRIO'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Nome da disciplina muito curta'; + $inconsistencyModel->action = 'Adicione um nome para a disciplina com pelo menos 5 caracteres'; + $inconsistencyModel->identifier = '10'; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->idSchool = $inepId; + $inconsistencyModel->insert(); + } - if (strlen($scheduleType->getDisciplina()) > $maxLength) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'HORÁRIO'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Nome da disciplina com mais de 50 caracteres - ' . $scheduleType->getDisciplina(); - $inconsistencyModel->action = 'Adicione um nome para a disciplina com até 50 caracteres'; - $inconsistencyModel->identifier = '10'; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->idSchool = $inepId; - $inconsistencyModel->insert(); - } + if (strlen($scheduleType->getDisciplina()) > $maxLength) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'HORÁRIO'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Nome da disciplina com mais de 50 caracteres - ' . $scheduleType->getDisciplina(); + $inconsistencyModel->action = 'Adicione um nome para a disciplina com até 50 caracteres'; + $inconsistencyModel->identifier = '10'; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->idSchool = $inepId; + $inconsistencyModel->insert(); + } $scheduleList[] = $scheduleType; @@ -1153,9 +1160,9 @@ private function checkScheduleInconsistencies($classId, $referenceMonth, $school ORDER BY c.create_date desc ") - ->bindParam(":classId", $classId) - ->bindParam(":referenceMonth", $referenceMonth) - ->queryAll(); + ->bindParam(":classId", $classId) + ->bindParam(":referenceMonth", $referenceMonth) + ->queryAll(); $schedules = []; $curricularMatrixChecked = []; @@ -1174,7 +1181,7 @@ private function checkScheduleInconsistencies($classId, $referenceMonth, $school $inconsistencyModel->enrollment = TURMA_STRONG; $inconsistencyModel->school = $schoolName; $inconsistencyModel->description = 'Componente curricular: ' . $row['name'] . ' não está no quadro de horários.'; - $inconsistencyModel->action = 'Adicione o componente curricular ao quadro de horários para a turma: ' . $row['className'] .''; + $inconsistencyModel->action = 'Adicione o componente curricular ao quadro de horários para a turma: ' . $row['className'] . ''; $inconsistencyModel->identifier = '10'; $inconsistencyModel->idClass = $classId; $inconsistencyModel->idSchool = $inepId; @@ -1182,7 +1189,8 @@ private function checkScheduleInconsistencies($classId, $referenceMonth, $school } } } - private function getInstructorRole($classroomIdFk, $instructorId) { + private function getInstructorRole($classroomIdFk, $instructorId) + { $sql = "SELECT itd.role FROM instructor_teaching_data itd WHERE itd.instructor_fk = :instructorId @@ -1195,7 +1203,8 @@ private function getInstructorRole($classroomIdFk, $instructorId) { return $command->queryScalar(); } - private function getTimetableByClassroom($classId, $month) { + private function getTimetableByClassroom($classId, $month) + { return \Schedule::model()->findAllByAttributes(array( 'classroom_fk' => $classId, ), array( @@ -1204,7 +1213,8 @@ private function getTimetableByClassroom($classId, $month) { )); } - private function getComponentesCurriculares($classId, $instructorId) { + private function getComponentesCurriculares($classId, $instructorId) + { $query = "SELECT * FROM instructor_teaching_data itd @@ -1224,7 +1234,8 @@ private function getComponentesCurriculares($classId, $instructorId) { return Yii::app()->db->createCommand($query)->bindValues($params)->queryAll(); } - private function getTeachersForClass($classId) { + private function getTeachersForClass($classId) + { $query = "SELECT itd.instructor_fk, ii.name FROM instructor_teaching_data itd JOIN instructor_identification ii ON ii.id = itd.instructor_fk @@ -1314,7 +1325,7 @@ public function getMenuList($schoolId, $year, $month) $isFoodEnabled = (object) \InstanceConfig::model()->findByAttributes(array('parameter_key' => 'FEAT_FOOD')); - if($isFoodEnabled->value) { + if ($isFoodEnabled->value) { $query = "SELECT fm.start_date as data, @@ -1354,7 +1365,7 @@ public function getMenuList($schoolId, $year, $month) $menuType = new CardapioTType(); $descMeren = str_replace("ª", "", $menu['descricaoMerenda']); - $descMeren = filter_var($descMeren, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW); + $descMeren = preg_replace('/[\x00-\x1F\x7F]/u', '', $descMeren); $descMeren = str_replace("\r", "", $descMeren); $menuType @@ -1559,7 +1570,7 @@ public function getAttendances($professionalId, $month) * * @return MatriculaTType[] | null */ - public function getEnrollments($classId, $referenceYear, $month, $finalClass, $inepId ,$withoutCpf) + public function getEnrollments($classId, $referenceYear, $month, $finalClass, $inepId, $withoutCpf) { $enrollmentList = []; $strMaxLength = 200; @@ -1622,7 +1633,7 @@ public function getEnrollments($classId, $referenceYear, $month, $finalClass, $i $enrollments = $command->queryAll(); - if(empty($enrollments)){ + if (empty($enrollments)) { return null; /* $className = $this->getClassName($classId, $referenceYear); @@ -1666,8 +1677,8 @@ public function getEnrollments($classId, $referenceYear, $month, $finalClass, $i $this->checkSingleStudentWithoutCpf($enrollments, $cpf, $classId, $referenceYear, $school, $inepId); - if($withoutCpf) { - if(!empty($cpf)) { + if ($withoutCpf) { + if (!empty($cpf)) { $studentType = new AlunoTType(); $birthdate = DateTime::createFromFormat("d/m/Y", $convertedBirthdate); $studentType @@ -1685,7 +1696,7 @@ public function getEnrollments($classId, $referenceYear, $month, $finalClass, $i $modality = $enrollment['modality']; //3 - EJA - if($modality === 3){ + if ($modality === 3) { $educationLevel = (int) $this->getStageById($enrollment['edcenso_stage_vs_modality_fk']); $age = $this->calculateAge($birthdate); $this->checkAge($age, $educationLevel, $arrayStudentInfo); @@ -1693,7 +1704,7 @@ public function getEnrollments($classId, $referenceYear, $month, $finalClass, $i if (!is_null($studentType->getCpfAluno())) { - if($this->cpfLength($studentType->getCpfAluno())){ + if ($this->cpfLength($studentType->getCpfAluno())) { if (!$this->validaCPF($studentType->getCpfAluno())) { $inconsistencyModel = new ValidationSagresModel(); $inconsistencyModel->enrollment = 'ESTUDANTE'; @@ -1741,7 +1752,7 @@ public function getEnrollments($classId, $referenceYear, $month, $finalClass, $i $inconsistencyModel->insert(); } - if($this->dataMax($studentType->getDataNascimento())){ + if ($this->dataMax($studentType->getDataNascimento())) { $inconsistencyModel = new ValidationSagresModel(); $inconsistencyModel->enrollment = 'ESTUDANTE'; $inconsistencyModel->school = $school->name; @@ -1753,7 +1764,7 @@ public function getEnrollments($classId, $referenceYear, $month, $finalClass, $i $inconsistencyModel->insert(); } - if($this->dataMin($studentType->getDataNascimento())){ + if ($this->dataMin($studentType->getDataNascimento())) { $inconsistencyModel = new ValidationSagresModel(); $inconsistencyModel->enrollment = 'ESTUDANTE'; $inconsistencyModel->school = $school->name; @@ -1829,7 +1840,7 @@ public function getEnrollments($classId, $referenceYear, $month, $finalClass, $i $enrollmentType = new MatriculaTType(); $enrollmentType ->setNumero($enrollment['numero']) - ->setDataMatricula(new DateTime($enrollment['data_matricula'])) + ->setDataMatricula(new DateTime($enrollment['data_matricula'] ?? '')) // ->setDataCancelamento(new DateTime($enrollment['data_cancelamento'])) ->setNumeroFaltas((int) $enrollment['faults']) ->setAluno($studentType); @@ -1896,213 +1907,213 @@ public function getEnrollments($classId, $referenceYear, $month, $finalClass, $i } } else { $studentType = new AlunoTType(); - $convertedBirthdate = $this->convertBirthdate($enrollment['birthdate']); - $studentType - ->setNome($enrollment['name']) - ->setDataNascimento(DateTime::createFromFormat("d/m/Y", $convertedBirthdate)) - ->setCpfAluno(!empty($cpf) ? $cpf : null) - ->setPcd($enrollment['deficiency']) - ->setSexo($enrollment['gender']); - - - if (!is_null($studentType->getCpfAluno())) { - if($this->cpfLength($studentType->getCpfAluno())){ - if (!$this->validaCPF($studentType->getCpfAluno())) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'ESTUDANTE'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Cpf do estudante é inválido: ' . $cpf . ''; - $inconsistencyModel->action = 'Informe um cpf válido para o estudante: ' . $enrollment['name'] . ''; - $inconsistencyModel->identifier = '9'; - $inconsistencyModel->idStudent = $enrollment['student_fk']; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->insert(); - } - } else { + $convertedBirthdate = $this->convertBirthdate($enrollment['birthdate']); + $studentType + ->setNome($enrollment['name']) + ->setDataNascimento(DateTime::createFromFormat("d/m/Y", $convertedBirthdate)) + ->setCpfAluno(!empty($cpf) ? $cpf : null) + ->setPcd($enrollment['deficiency']) + ->setSexo($enrollment['gender']); + + + if (!is_null($studentType->getCpfAluno())) { + if ($this->cpfLength($studentType->getCpfAluno())) { + if (!$this->validaCPF($studentType->getCpfAluno())) { $inconsistencyModel = new ValidationSagresModel(); $inconsistencyModel->enrollment = 'ESTUDANTE'; $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'CPF do estudante não contém 11 números: ' . $cpf . ''; - $inconsistencyModel->action = ' Insira um CPF válido com exatamente 11 números para o estudante: ' . $enrollment['name'] . ''; + $inconsistencyModel->description = 'Cpf do estudante é inválido: ' . $cpf . ''; + $inconsistencyModel->action = 'Informe um cpf válido para o estudante: ' . $enrollment['name'] . ''; $inconsistencyModel->identifier = '9'; $inconsistencyModel->idStudent = $enrollment['student_fk']; $inconsistencyModel->idClass = $classId; $inconsistencyModel->insert(); } - } - - if (is_null($studentType->getCpfAluno())) { + } else { $inconsistencyModel = new ValidationSagresModel(); $inconsistencyModel->enrollment = 'ESTUDANTE'; $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'É obrigatório informar o cpf do estudante'; - $inconsistencyModel->action = 'Informe um cpf para o estudante: ' . $enrollment['name'] . ''; - $inconsistencyModel->identifier = '9'; - $inconsistencyModel->idStudent = $enrollment['student_fk']; - $inconsistencyModel->insert(); - } - - if (!$this->validateDate($studentType->getDataNascimento(), 1)) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'ESTUDANTE'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Data de nascimento no formato inválido: ' . $studentType->getDataNascimento()->format(DATE_FORMAT) . ''; - $inconsistencyModel->action = 'Adicione uma data no formato válido'; + $inconsistencyModel->description = 'CPF do estudante não contém 11 números: ' . $cpf . ''; + $inconsistencyModel->action = ' Insira um CPF válido com exatamente 11 números para o estudante: ' . $enrollment['name'] . ''; $inconsistencyModel->identifier = '9'; $inconsistencyModel->idStudent = $enrollment['student_fk']; $inconsistencyModel->idClass = $classId; $inconsistencyModel->insert(); } + } - if (strlen($studentType->getNome()) < $strlen) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'ESTUDANTE'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Nome do estudante com menos de 5 caracteres'; - $inconsistencyModel->action = 'Adicione um nome para o estudante com pelo menos 5 caracteres'; - $inconsistencyModel->identifier = '9'; - $inconsistencyModel->idStudent = $enrollment['student_fk']; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->insert(); - } + if (is_null($studentType->getCpfAluno())) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'ESTUDANTE'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'É obrigatório informar o cpf do estudante'; + $inconsistencyModel->action = 'Informe um cpf para o estudante: ' . $enrollment['name'] . ''; + $inconsistencyModel->identifier = '9'; + $inconsistencyModel->idStudent = $enrollment['student_fk']; + $inconsistencyModel->insert(); + } - if ($studentType->getNome() > $strMaxLength) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'ESTUDANTE'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Nome do estudante com mais de 200 caracteres'; - $inconsistencyModel->action = 'Adicione um nome para o estudante com até 200 caracteres'; - $inconsistencyModel->identifier = '9'; - $inconsistencyModel->idStudent = $enrollment['student_fk']; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->insert(); - } + if (!$this->validateDate($studentType->getDataNascimento(), 1)) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'ESTUDANTE'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Data de nascimento no formato inválido: ' . $studentType->getDataNascimento()->format(DATE_FORMAT) . ''; + $inconsistencyModel->action = 'Adicione uma data no formato válido'; + $inconsistencyModel->identifier = '9'; + $inconsistencyModel->idStudent = $enrollment['student_fk']; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->insert(); + } - if (!is_bool(boolval($studentType->getPcd()))) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'ESTUDANTE'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Código pcd é inválido'; - $inconsistencyModel->action = 'Adicione um valor válido para o pcd'; - $inconsistencyModel->identifier = '9'; - $inconsistencyModel->idStudent = $enrollment['student_fk']; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->insert(); - } + if (strlen($studentType->getNome()) < $strlen) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'ESTUDANTE'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Nome do estudante com menos de 5 caracteres'; + $inconsistencyModel->action = 'Adicione um nome para o estudante com pelo menos 5 caracteres'; + $inconsistencyModel->identifier = '9'; + $inconsistencyModel->idStudent = $enrollment['student_fk']; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->insert(); + } - if ($studentType->getDataNascimento() === false) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'ESTUDANTE'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Data de nascimento inválida'; - $inconsistencyModel->action = 'Altere o formato de data para dd/mm/aaaa'; - $inconsistencyModel->identifier = '9'; - $inconsistencyModel->idStudent = $enrollment['student_fk']; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->insert(); - } + if (strlen($studentType->getNome()) > $strMaxLength) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'ESTUDANTE'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Nome do estudante com mais de 200 caracteres'; + $inconsistencyModel->action = 'Adicione um nome para o estudante com até 200 caracteres'; + $inconsistencyModel->identifier = '9'; + $inconsistencyModel->idStudent = $enrollment['student_fk']; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->insert(); + } - if($this->dataMax($studentType->getDataNascimento())){ - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'ESTUDANTE'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'A data de nascimento '. $studentType->getDataNascimento()->format(DATE_FORMAT) .' não pode ser posterior a 30 de abril de 2024'; - $inconsistencyModel->action = 'Adicione uma data válida para o estudante: ' . $studentType->getNome() . ''; - $inconsistencyModel->identifier = '9'; - $inconsistencyModel->idStudent = $enrollment['student_fk']; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->insert(); - } + if (!is_bool(boolval($studentType->getPcd()))) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'ESTUDANTE'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Código pcd é inválido'; + $inconsistencyModel->action = 'Adicione um valor válido para o pcd'; + $inconsistencyModel->identifier = '9'; + $inconsistencyModel->idStudent = $enrollment['student_fk']; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->insert(); + } - if($this->dataMin($studentType->getDataNascimento())){ - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'ESTUDANTE'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'A data de nascimento não pode ser inferior a 01 de janeiro de 1930'; - $inconsistencyModel->action = 'Adicione uma data válida para o estudante: ' . $studentType->getNome() . ''; - $inconsistencyModel->identifier = '9'; - $inconsistencyModel->idStudent = $enrollment['student_fk']; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->insert(); - } + if ($studentType->getDataNascimento() === false) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'ESTUDANTE'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Data de nascimento inválida'; + $inconsistencyModel->action = 'Altere o formato de data para dd/mm/aaaa'; + $inconsistencyModel->identifier = '9'; + $inconsistencyModel->idStudent = $enrollment['student_fk']; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->insert(); + } - if (!in_array($studentType->getSexo(), [1, 2, 3])) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'ESTUDANTE'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Sexo não é válido'; - $inconsistencyModel->action = 'Adicione um sexo válido para o estudante'; - $inconsistencyModel->identifier = '9'; - $inconsistencyModel->idStudent = $enrollment['student_fk']; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->insert(); - } + if ($this->dataMax($studentType->getDataNascimento())) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'ESTUDANTE'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'A data de nascimento ' . $studentType->getDataNascimento()->format(DATE_FORMAT) . ' não pode ser posterior a 30 de abril de 2024'; + $inconsistencyModel->action = 'Adicione uma data válida para o estudante: ' . $studentType->getNome() . ''; + $inconsistencyModel->identifier = '9'; + $inconsistencyModel->idStudent = $enrollment['student_fk']; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->insert(); + } - $enrollmentType = new MatriculaTType(); - $enrollmentType - ->setNumero($enrollment['numero']) - ->setDataMatricula(new DateTime($enrollment['data_matricula'])) - // ->setDataCancelamento(new DateTime($enrollment['data_cancelamento'])) - ->setNumeroFaltas((int) $enrollment['faults']) - ->setAluno($studentType); + if ($this->dataMin($studentType->getDataNascimento())) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'ESTUDANTE'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'A data de nascimento não pode ser inferior a 01 de janeiro de 1930'; + $inconsistencyModel->action = 'Adicione uma data válida para o estudante: ' . $studentType->getNome() . ''; + $inconsistencyModel->identifier = '9'; + $inconsistencyModel->idStudent = $enrollment['student_fk']; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->insert(); + } - if (is_null($studentType)) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'ESTUDANTE'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Estudante não existe para a matrícula da turma: '; - $inconsistencyModel->action = 'Adicione um estudante à turma da escola'; - $inconsistencyModel->identifier = '9'; - $inconsistencyModel->idStudent = $enrollment['student_fk']; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->insert(); - } + if (!in_array($studentType->getSexo(), [1, 2, 3])) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'ESTUDANTE'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Sexo não é válido'; + $inconsistencyModel->action = 'Adicione um sexo válido para o estudante'; + $inconsistencyModel->identifier = '9'; + $inconsistencyModel->idStudent = $enrollment['student_fk']; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->insert(); + } - if (filter_var($finalClass, FILTER_VALIDATE_BOOLEAN)) { - $enrollmentType->setAprovado($this->getStudentSituation($enrollment['situation'])); - } + $enrollmentType = new MatriculaTType(); + $enrollmentType + ->setNumero($enrollment['numero']) + ->setDataMatricula(new DateTime($enrollment['data_matricula'])) + // ->setDataCancelamento(new DateTime($enrollment['data_cancelamento'])) + ->setNumeroFaltas((int) $enrollment['faults']) + ->setAluno($studentType); - if (empty($enrollmentType)) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'MATRÍCULA'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Não há matrícula para a turma'; - $inconsistencyModel->action = 'Adicione uma matrícula para a turma'; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->insert(); - } + if (is_null($studentType)) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'ESTUDANTE'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Estudante não existe para a matrícula da turma: '; + $inconsistencyModel->action = 'Adicione um estudante à turma da escola'; + $inconsistencyModel->identifier = '9'; + $inconsistencyModel->idStudent = $enrollment['student_fk']; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->insert(); + } - if (!$this->validateDate($enrollmentType->getDataMatricula(), 2)) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'MATRÍCULA'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = DATA_MATRICULA_INV . '' . $enrollmentType->getDataMatricula()->format(DATE_FORMAT) . ''; - $inconsistencyModel->action = 'Adicione uma data no formato válido'; - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->insert(); - } + if (filter_var($finalClass, FILTER_VALIDATE_BOOLEAN)) { + $enrollmentType->setAprovado($this->getStudentSituation($enrollment['situation'])); + } - if (!is_int($enrollmentType->getNumeroFaltas())) { + if (empty($enrollmentType)) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'MATRÍCULA'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'Não há matrícula para a turma'; + $inconsistencyModel->action = 'Adicione uma matrícula para a turma'; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->insert(); + } + + if (!$this->validateDate($enrollmentType->getDataMatricula(), 2)) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'MATRÍCULA'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = DATA_MATRICULA_INV . '' . $enrollmentType->getDataMatricula()->format(DATE_FORMAT) . ''; + $inconsistencyModel->action = 'Adicione uma data no formato válido'; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->insert(); + } + + if (!is_int($enrollmentType->getNumeroFaltas())) { + $inconsistencyModel = new ValidationSagresModel(); + $inconsistencyModel->enrollment = 'MATRÍCULA'; + $inconsistencyModel->school = $school->name; + $inconsistencyModel->description = 'O valor para o número de faltas é inválido'; + $inconsistencyModel->action = 'Coloque um valor válido para o número de faltas'; + $inconsistencyModel->idClass = $classId; + $inconsistencyModel->insert(); + } + + if (filter_var($finalClass, FILTER_VALIDATE_BOOLEAN)) { + if (!is_bool($enrollmentType->getAprovado())) { $inconsistencyModel = new ValidationSagresModel(); $inconsistencyModel->enrollment = 'MATRÍCULA'; $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'O valor para o número de faltas é inválido'; - $inconsistencyModel->action = 'Coloque um valor válido para o número de faltas'; + $inconsistencyModel->description = 'Valor inválido para o status aprovado'; + $inconsistencyModel->action = 'Adicione um valor válido para o campo aprovado do aluno: ' . $studentType->getNome(); $inconsistencyModel->idClass = $classId; $inconsistencyModel->insert(); } - - if (filter_var($finalClass, FILTER_VALIDATE_BOOLEAN)) { - if (!is_bool($enrollmentType->getAprovado())) { - $inconsistencyModel = new ValidationSagresModel(); - $inconsistencyModel->enrollment = 'MATRÍCULA'; - $inconsistencyModel->school = $school->name; - $inconsistencyModel->description = 'Valor inválido para o status aprovado'; - $inconsistencyModel->action = 'Adicione um valor válido para o campo aprovado do aluno: ' . $studentType->getNome(); - $inconsistencyModel->idClass = $classId; - $inconsistencyModel->insert(); - } - } + } $enrollmentList[] = $enrollmentType; } @@ -2128,7 +2139,8 @@ private function checkSingleStudentWithoutCpf(array $enrollments, $cpf, $classId } } - private function getStageById($id) { + private function getStageById($id) + { $command = Yii::app()->db->createCommand('SELECT esvm.stage FROM edcenso_stage_vs_modality esvm WHERE id = :id'); $command->bindParam(':id', $id); $stage = $command->queryScalar(); @@ -2136,7 +2148,8 @@ private function getStageById($id) { return $stage; } - private function calculateAge($birthdate) { + private function calculateAge($birthdate) + { $today = new DateTime(); $age = $today->diff($birthdate); return (int) $age->y; @@ -2151,7 +2164,8 @@ private function getClassName($id, $year) ->queryScalar(); } - public function convertBirthdate($birthdate) { + public function convertBirthdate($birthdate) + { $date = DateTime::createFromFormat('Y-m-d', $birthdate); if ($date && $date->format('Y-m-d') === $birthdate) { @@ -2220,7 +2234,8 @@ public function generatesSagresEduXML($sagresEduObject) } - private function clearSpecialCharacters($string) { + private function clearSpecialCharacters($string) + { return preg_replace("/\xEF\xBF\xBD/", "", $string); } @@ -2231,11 +2246,11 @@ public function actionExportSagresXML($xml) $inst = "File_" . INSTANCE . "/"; $path = "./app/export/SagresEdu/" . $inst; - if(!file_exists($path)){ + if (!file_exists($path)) { mkdir($path); } - $fileDir = "./app/export/SagresEdu/". $inst . $fileName; + $fileDir = "./app/export/SagresEdu/" . $inst . $fileName; Yii::import('ext.FileManager.fileManager'); $fm = new fileManager(); $result = $fm->write($fileDir, $xml); @@ -2319,12 +2334,12 @@ public function validateDate($date, int $type): bool /* * 1 - Data de nascimento * 2 - Data de matrícula - */ - if($type === 1) { + */ + if ($type === 1) { if ($year < 1924 || $year > $currentYear) { return false; } - } elseif($type === 2) { + } elseif ($type === 2) { if ($year < 1924) { return false; } @@ -2333,7 +2348,7 @@ public function validateDate($date, int $type): bool return $d && $d->format($format) == $dat; } - public function validaCPF($cpf):bool + public function validaCPF($cpf): bool { $cpf = preg_replace('/[^0-9]/is', '', $cpf); @@ -2357,7 +2372,8 @@ public function validaCPF($cpf):bool return true; } - private function dataMax(DateTime $data) { + private function dataMax(DateTime $data) + { $dataMaxima = new DateTime("2024-04-30"); if ($data > $dataMaxima) { @@ -2367,7 +2383,8 @@ private function dataMax(DateTime $data) { } } - private function dataMin(DateTime $data) { + private function dataMin(DateTime $data) + { $dataMinima = new DateTime("1923-01-01"); if ($data < $dataMinima) { @@ -2378,7 +2395,8 @@ private function dataMin(DateTime $data) { } - private function cpfLength($cpf){ - return strlen($cpf) === 11 ? true: false; + private function cpfLength($cpf) + { + return strlen($cpf) === 11 ? true : false; } } diff --git a/composer.lock b/composer.lock index 44cda5a0d..1d9f9d414 100644 --- a/composer.lock +++ b/composer.lock @@ -466,16 +466,16 @@ }, { "name": "fakerphp/faker", - "version": "1.23.x-dev", + "version": "1.24.x-dev", "source": { "type": "git", "url": "https://github.com/FakerPHP/Faker.git", - "reference": "5c89067b137ce6a9918889649f515bd1cf7a622f" + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/5c89067b137ce6a9918889649f515bd1cf7a622f", - "reference": "5c89067b137ce6a9918889649f515bd1cf7a622f", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", "shasum": "" }, "require": { @@ -523,9 +523,9 @@ ], "support": { "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/1.23" + "source": "https://github.com/FakerPHP/Faker/tree/1.24" }, - "time": "2024-10-31T09:54:55+00:00" + "time": "2024-11-21T13:46:39+00:00" }, { "name": "goetas-webservices/xsd2php-runtime", @@ -952,17 +952,17 @@ "source": { "type": "git", "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "d2ed36bf14b8b68d7986272734cb6a54c7822554" + "reference": "3c4e5f62ba8d7de1734312e4fff32f67a8daaf10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/d2ed36bf14b8b68d7986272734cb6a54c7822554", - "reference": "d2ed36bf14b8b68d7986272734cb6a54c7822554", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/3c4e5f62ba8d7de1734312e4fff32f67a8daaf10", + "reference": "3c4e5f62ba8d7de1734312e4fff32f67a8daaf10", "shasum": "" }, "require": { - "composer-runtime-api": "^2.0.0", - "php": "^7.1|^8.0" + "composer-runtime-api": "^2.1.0", + "php": "^7.4|^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", @@ -1002,9 +1002,9 @@ ], "support": { "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/2.x" + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.1.0" }, - "time": "2024-08-01T12:14:16+00:00" + "time": "2024-11-18T16:19:46+00:00" }, { "name": "jms/metadata", @@ -2124,12 +2124,12 @@ "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "9e8aa057ba5384e5888954c828f8de90ccd3ca4c" + "reference": "bf5d6f58bbcf4b3bedeba59dc98bedbdedcb01ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/9e8aa057ba5384e5888954c828f8de90ccd3ca4c", - "reference": "9e8aa057ba5384e5888954c828f8de90ccd3ca4c", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/bf5d6f58bbcf4b3bedeba59dc98bedbdedcb01ca", + "reference": "bf5d6f58bbcf4b3bedeba59dc98bedbdedcb01ca", "shasum": "" }, "require": { @@ -2209,7 +2209,7 @@ "type": "tidelift" } ], - "time": "2024-10-14T21:21:59+00:00" + "time": "2024-11-23T18:24:08+00:00" }, { "name": "scssphp/scssphp", @@ -2522,19 +2522,19 @@ "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "1ca3cfeaa4a26997bef2c66698825ad472bf96bf" + "reference": "2da9f7b7acef9e72c30da25513b35639df34d48c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/1ca3cfeaa4a26997bef2c66698825ad472bf96bf", - "reference": "1ca3cfeaa4a26997bef2c66698825ad472bf96bf", + "url": "https://api.github.com/repos/symfony/http-client/zipball/2da9f7b7acef9e72c30da25513b35639df34d48c", + "reference": "2da9f7b7acef9e72c30da25513b35639df34d48c", "shasum": "" }, "require": { "php": ">=8.2", "psr/log": "^1|^2|^3", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-client-contracts": "^3.4.1", + "symfony/http-client-contracts": "~3.4.3|^3.5.1", "symfony/service-contracts": "^2.5|^3" }, "conflict": { @@ -2609,7 +2609,7 @@ "type": "tidelift" } ], - "time": "2024-10-30T22:17:09+00:00" + "time": "2024-11-25T12:10:02+00:00" }, { "name": "symfony/http-client-contracts", @@ -2617,12 +2617,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "075fadd18649068440dae4667a0ab98293535235" + "reference": "7917bba9674e386bc2726c4bb9ad5440f7831d66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/075fadd18649068440dae4667a0ab98293535235", - "reference": "075fadd18649068440dae4667a0ab98293535235", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/7917bba9674e386bc2726c4bb9ad5440f7831d66", + "reference": "7917bba9674e386bc2726c4bb9ad5440f7831d66", "shasum": "" }, "require": { @@ -2688,7 +2688,7 @@ "type": "tidelift" } ], - "time": "2024-09-26T08:57:56+00:00" + "time": "2024-11-19T10:11:42+00:00" }, { "name": "symfony/options-resolver", @@ -2696,12 +2696,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "0a62a9f2504a8dd27083f89d21894ceb01cc59db" + "reference": "368128ad168f20e22c32159b9f761e456cec0c78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/0a62a9f2504a8dd27083f89d21894ceb01cc59db", - "reference": "0a62a9f2504a8dd27083f89d21894ceb01cc59db", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/368128ad168f20e22c32159b9f761e456cec0c78", + "reference": "368128ad168f20e22c32159b9f761e456cec0c78", "shasum": "" }, "require": { @@ -2755,7 +2755,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-11-20T10:57:02+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3716,21 +3716,21 @@ "source": { "type": "git", "url": "https://github.com/Behat/Gherkin.git", - "reference": "9fa77e710b542c09ad0125ed55f89a63cba45af8" + "reference": "33849703bddd4649113e41426ca51514b6d89c5f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/9fa77e710b542c09ad0125ed55f89a63cba45af8", - "reference": "9fa77e710b542c09ad0125ed55f89a63cba45af8", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/33849703bddd4649113e41426ca51514b6d89c5f", + "reference": "33849703bddd4649113e41426ca51514b6d89c5f", "shasum": "" }, "require": { - "php": "~7.2|~8.0" + "php": "8.1.* || 8.2.* || 8.3.* || 8.4.*" }, "require-dev": { "cucumber/cucumber": "dev-gherkin-24.1.0", - "phpunit/phpunit": "~8|~9", - "symfony/yaml": "~3|~4|~5|~6|~7" + "phpunit/phpunit": "^9.6", + "symfony/yaml": "^5.4 || ^6.4 || ^7.0" }, "suggest": { "symfony/yaml": "If you want to parse features, represented in YAML files" @@ -3772,7 +3772,7 @@ "issues": "https://github.com/Behat/Gherkin/issues", "source": "https://github.com/Behat/Gherkin/tree/master" }, - "time": "2024-11-04T10:13:25+00:00" + "time": "2024-11-15T09:41:03+00:00" }, { "name": "codeception/codeception", @@ -4251,12 +4251,12 @@ "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4" + "reference": "deb3871d20d5012eb5faa5a9caa71c44f151db49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/63aaeac21d7e775ff9bc9d45021e1745c97521c4", - "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4", + "url": "https://api.github.com/repos/composer/pcre/zipball/deb3871d20d5012eb5faa5a9caa71c44f151db49", + "reference": "deb3871d20d5012eb5faa5a9caa71c44f151db49", "shasum": "" }, "require": { @@ -4266,8 +4266,9 @@ "phpstan/phpstan": "<1.11.10" }, "require-dev": { - "phpstan/phpstan": "^1.11.10", - "phpstan/phpstan-strict-rules": "^1.1", + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-deprecation-rules": "^1 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", "phpunit/phpunit": "^8 || ^9" }, "default-branch": true, @@ -4307,7 +4308,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.3.1" + "source": "https://github.com/composer/pcre/tree/main" }, "funding": [ { @@ -4323,7 +4324,7 @@ "type": "tidelift" } ], - "time": "2024-08-27T18:44:43+00:00" + "time": "2024-11-20T09:10:58+00:00" }, { "name": "composer/semver", @@ -4655,16 +4656,16 @@ }, { "name": "goetas-webservices/xsd-reader", - "version": "0.4.7", + "version": "0.4.8", "source": { "type": "git", "url": "https://github.com/goetas-webservices/xsd-reader.git", - "reference": "8f4e6fb81667510426d749e081b7ae1cfc18f71d" + "reference": "0766af5df34779ead9d910e144cf38c2cb661ce3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/goetas-webservices/xsd-reader/zipball/8f4e6fb81667510426d749e081b7ae1cfc18f71d", - "reference": "8f4e6fb81667510426d749e081b7ae1cfc18f71d", + "url": "https://api.github.com/repos/goetas-webservices/xsd-reader/zipball/0766af5df34779ead9d910e144cf38c2cb661ce3", + "reference": "0766af5df34779ead9d910e144cf38c2cb661ce3", "shasum": "" }, "require": { @@ -4709,7 +4710,7 @@ ], "support": { "issues": "https://github.com/goetas-webservices/xsd-reader/issues", - "source": "https://github.com/goetas-webservices/xsd-reader/tree/0.4.7" + "source": "https://github.com/goetas-webservices/xsd-reader/tree/0.4.8" }, "funding": [ { @@ -4725,7 +4726,7 @@ "type": "patreon" } ], - "time": "2024-09-01T18:48:08+00:00" + "time": "2024-11-23T07:49:42+00:00" }, { "name": "goetas-webservices/xsd2php", @@ -4815,16 +4816,16 @@ }, { "name": "laminas/laminas-code", - "version": "4.16.x-dev", + "version": "4.17.x-dev", "source": { "type": "git", "url": "https://github.com/laminas/laminas-code.git", - "reference": "c3d187b5c1e73d2bae41383d3b6f0a7d2ac4a855" + "reference": "1793e78dad4108b594084d05d1fb818b85b110af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-code/zipball/c3d187b5c1e73d2bae41383d3b6f0a7d2ac4a855", - "reference": "c3d187b5c1e73d2bae41383d3b6f0a7d2ac4a855", + "url": "https://api.github.com/repos/laminas/laminas-code/zipball/1793e78dad4108b594084d05d1fb818b85b110af", + "reference": "1793e78dad4108b594084d05d1fb818b85b110af", "shasum": "" }, "require": { @@ -4875,7 +4876,7 @@ "type": "community_bridge" } ], - "time": "2024-10-25T10:24:39+00:00" + "time": "2024-11-20T13:15:13+00:00" }, { "name": "myclabs/deep-copy", @@ -4883,12 +4884,12 @@ "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -4928,7 +4929,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -4936,7 +4937,7 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "pdepend/pdepend", @@ -5176,16 +5177,16 @@ }, { "name": "php-webdriver/webdriver", - "version": "1.15.1", + "version": "1.15.2", "source": { "type": "git", "url": "https://github.com/php-webdriver/php-webdriver.git", - "reference": "cd52d9342c5aa738c2e75a67e47a1b6df97154e8" + "reference": "998e499b786805568deaf8cbf06f4044f05d91bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/cd52d9342c5aa738c2e75a67e47a1b6df97154e8", - "reference": "cd52d9342c5aa738c2e75a67e47a1b6df97154e8", + "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/998e499b786805568deaf8cbf06f4044f05d91bf", + "reference": "998e499b786805568deaf8cbf06f4044f05d91bf", "shasum": "" }, "require": { @@ -5207,7 +5208,7 @@ "php-parallel-lint/php-parallel-lint": "^1.2", "phpunit/phpunit": "^9.3", "squizlabs/php_codesniffer": "^3.5", - "symfony/var-dumper": "^5.0 || ^6.0" + "symfony/var-dumper": "^5.0 || ^6.0 || ^7.0" }, "suggest": { "ext-SimpleXML": "For Firefox profile creation" @@ -5236,9 +5237,9 @@ ], "support": { "issues": "https://github.com/php-webdriver/php-webdriver/issues", - "source": "https://github.com/php-webdriver/php-webdriver/tree/1.15.1" + "source": "https://github.com/php-webdriver/php-webdriver/tree/1.15.2" }, - "time": "2023-10-20T12:21:20+00:00" + "time": "2024-11-21T15:12:59+00:00" }, { "name": "phpmd/phpmd", @@ -5325,24 +5326,25 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.x-dev", + "version": "2.0.x-dev", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "5950910dac459674d59441965f989aa21ea617c5" + "reference": "9648c0643e73e9e59aff0b03cd2473f469f201bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/5950910dac459674d59441965f989aa21ea617c5", - "reference": "5950910dac459674d59441965f989aa21ea617c5", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9648c0643e73e9e59aff0b03cd2473f469f201bc", + "reference": "9648c0643e73e9e59aff0b03cd2473f469f201bc", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "php": "^7.4|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" }, + "default-branch": true, "bin": [ "phpstan", "phpstan.phar" @@ -5379,7 +5381,7 @@ "type": "github" } ], - "time": "2024-11-04T08:46:35+00:00" + "time": "2024-11-24T08:34:58+00:00" }, { "name": "phpunit/php-code-coverage", @@ -5685,12 +5687,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ba7966e2eb33733ad48ca396baf1508569c2a744" + "reference": "ea476db46c24d0cec208c8226c8c5648921e005e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ba7966e2eb33733ad48ca396baf1508569c2a744", - "reference": "ba7966e2eb33733ad48ca396baf1508569c2a744", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea476db46c24d0cec208c8226c8c5648921e005e", + "reference": "ea476db46c24d0cec208c8226c8c5648921e005e", "shasum": "" }, "require": { @@ -5701,7 +5703,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.0", + "myclabs/deep-copy": "^1.12.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.2", @@ -5775,7 +5777,7 @@ "type": "tidelift" } ], - "time": "2024-10-31T05:51:14+00:00" + "time": "2024-11-25T11:15:02+00:00" }, { "name": "psr/event-dispatcher", @@ -5836,17 +5838,17 @@ "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "27c9f323a31fb11b92c8457c19e7a2d8249f5c8c" + "reference": "3e6e8074c1a9c687ee618a5389f7b700b9ea3b28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/27c9f323a31fb11b92c8457c19e7a2d8249f5c8c", - "reference": "27c9f323a31fb11b92c8457c19e7a2d8249f5c8c", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/3e6e8074c1a9c687ee618a5389f7b700b9ea3b28", + "reference": "3e6e8074c1a9c687ee618a5389f7b700b9ea3b28", "shasum": "" }, "require": { - "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.12.5" + "php": "^7.4|^8.0", + "phpstan/phpstan": "^2.0.1" }, "conflict": { "rector/rector-doctrine": "*", @@ -5888,7 +5890,7 @@ "type": "github" } ], - "time": "2024-11-04T13:19:01+00:00" + "time": "2024-11-25T08:57:46+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -6624,12 +6626,12 @@ "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "c2b6235e5ba1c2665c520564c5f978f393a3b382" + "reference": "823dc9afb8bce7f2cf4ccd7dac3176a4bf4ef146" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/c2b6235e5ba1c2665c520564c5f978f393a3b382", - "reference": "c2b6235e5ba1c2665c520564c5f978f393a3b382", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/823dc9afb8bce7f2cf4ccd7dac3176a4bf4ef146", + "reference": "823dc9afb8bce7f2cf4ccd7dac3176a4bf4ef146", "shasum": "" }, "require": { @@ -6697,7 +6699,7 @@ "type": "open_collective" } ], - "time": "2024-11-02T09:58:19+00:00" + "time": "2024-11-24T17:49:11+00:00" }, { "name": "symfony/browser-kit", @@ -6852,12 +6854,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "108d436c2af470858bdaba3257baab3a74172017" + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/108d436c2af470858bdaba3257baab3a74172017", - "reference": "108d436c2af470858bdaba3257baab3a74172017", + "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", "shasum": "" }, "require": { @@ -6943,7 +6945,7 @@ "type": "tidelift" } ], - "time": "2024-10-08T07:27:17+00:00" + "time": "2024-11-06T11:30:55+00:00" }, { "name": "symfony/css-selector", @@ -7017,12 +7019,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "728ae8f4e190133ce99d6d5f0bc1e8c8bd7c7a96" + "reference": "7a4dbef9fccea006e1c845876e9bbb813830d877" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/728ae8f4e190133ce99d6d5f0bc1e8c8bd7c7a96", - "reference": "728ae8f4e190133ce99d6d5f0bc1e8c8bd7c7a96", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/7a4dbef9fccea006e1c845876e9bbb813830d877", + "reference": "7a4dbef9fccea006e1c845876e9bbb813830d877", "shasum": "" }, "require": { @@ -7090,7 +7092,7 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:07:50+00:00" + "time": "2024-11-20T10:56:23+00:00" }, { "name": "symfony/dom-crawler", @@ -7098,12 +7100,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "89647a57db280f9f93c27271fea58babb77bb473" + "reference": "b57df76f4757a9a8dfbb57ba48d7780cc20776c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/89647a57db280f9f93c27271fea58babb77bb473", - "reference": "89647a57db280f9f93c27271fea58babb77bb473", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/b57df76f4757a9a8dfbb57ba48d7780cc20776c6", + "reference": "b57df76f4757a9a8dfbb57ba48d7780cc20776c6", "shasum": "" }, "require": { @@ -7165,7 +7167,7 @@ "type": "tidelift" } ], - "time": "2024-10-22T13:05:35+00:00" + "time": "2024-11-13T14:36:38+00:00" }, { "name": "symfony/event-dispatcher", @@ -7697,12 +7699,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "0776b9944bc1c88b66714faa7554b6d0db6f178a" + "reference": "3cb242f059c14ae08591c5c4087d1fe443564392" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/0776b9944bc1c88b66714faa7554b6d0db6f178a", - "reference": "0776b9944bc1c88b66714faa7554b6d0db6f178a", + "url": "https://api.github.com/repos/symfony/process/zipball/3cb242f059c14ae08591c5c4087d1fe443564392", + "reference": "3cb242f059c14ae08591c5c4087d1fe443564392", "shasum": "" }, "require": { @@ -7750,7 +7752,7 @@ "type": "tidelift" } ], - "time": "2024-11-04T11:33:53+00:00" + "time": "2024-11-06T14:19:14+00:00" }, { "name": "symfony/stopwatch", @@ -7820,12 +7822,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "38371c60c71c72b3d64d8d76f6b1bb81a2cc3627" + "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/38371c60c71c72b3d64d8d76f6b1bb81a2cc3627", - "reference": "38371c60c71c72b3d64d8d76f6b1bb81a2cc3627", + "url": "https://api.github.com/repos/symfony/string/zipball/73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", + "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", "shasum": "" }, "require": { @@ -7898,7 +7900,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-11-13T13:31:12+00:00" }, { "name": "symfony/var-exporter", diff --git a/config.php b/config.php index 8cce18761..15b9aa965 100644 --- a/config.php +++ b/config.php @@ -2,6 +2,7 @@ $debug = getenv("YII_DEBUG"); +$session_time = getenv("SESSION_TIME") ?? 5*60*60; defined('YII_DEBUG') or define('YII_DEBUG', $debug); define("TAG_VERSION", '3.89.203'); @@ -20,3 +21,5 @@ date_default_timezone_set('America/Sao_Paulo'); ini_set('always_populate_raw_post_data', '-1'); setlocale(LC_ALL, 'portuguese', 'pt_BR.UTF-8', 'pt_BR.UTF8', 'pt_br.UTF8', 'ptb_BRA.UTF8', "ptb", 'ptb.UTF8'); +ini_set('session.gc_maxlifetime', $session_time); +ini_set('session.cookie_lifetime', $session_time);