Skip to content

Commit

Permalink
Merge pull request #999 from portabilis/portabilis-patch-2025-02-12
Browse files Browse the repository at this point in the history
Portábilis patch 12/02/2025
  • Loading branch information
edineivaldameri authored Feb 12, 2025
2 parents e8a18d9 + 3c05532 commit b6cea39
Show file tree
Hide file tree
Showing 957 changed files with 4,826 additions and 3,415 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:

- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
extensions: bcmath, gd, pdo, pcntl, pdo_pgsql, pgsql, zip
env:
update: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ImportDisciplineAcademicYearCommand extends Command
*/
public function handle()
{
$importer = new DisciplineAcademicImport();
$importer = new DisciplineAcademicImport;

$importer->withOutput($this->output)->import($this->argument('filename'));
}
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/ImportDisciplineCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function handle(Filesystem $filesystem)
{
$filename = $this->argument('filename');

$importer = new DisciplineImport();
$importer = new DisciplineImport;

$importer->withOutput($this->output)->import($filename);

Expand Down
2 changes: 2 additions & 0 deletions app/Console/Commands/LegacyCreateTestsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ private function excludeRoutersList(): array
'index.php',
'copia_vinculos_servidores_cad.php',
'educar_configuracoes_gerais.php',
'educar_comunicados_escolares_det.php',
'educar_comunicados_escolares_lst.php',
];
}

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/QueryAllCsvCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function handle()
$connectionData = DB::connection($connection)->select($file);

if (!empty($connectionData) && empty($header)) {
$header = array_merge(['conexao'], array_keys((array)$connectionData[0]));
$header = array_merge(['conexao'], array_keys((array) $connectionData[0]));
}
$data[$connection] = $connectionData;
} catch (Exception) {
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/ResetPasswordCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function handle()
{
$username = $this->argument('username');

$output = new NullOutput();
$output = new NullOutput;
$service = new ImportUsersService($output);

$newPassword = Str::random(8);
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/UpdateDisciplinesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private function setCopiers(MoveDisciplineDataService $service)
}

foreach ($copiers as $copier) {
$service->setMoveDataService(new $copier());
$service->setMoveDataService(new $copier);
}
}
}
2 changes: 1 addition & 1 deletion app/Console/Commands/UpdateSchoolClassPeriod.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function handle()
->where('ano', '>=', 2019)
->get();

$service = new PeriodService();
$service = new PeriodService;

DB::beginTransaction();

Expand Down
2 changes: 0 additions & 2 deletions app/Contracts/AssetServiceContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ public function __construct(string $version, ?bool $secure = null, bool $automat

/**
* Get assets version number.
*
* @return ?string
*/
public function getVersion(): ?string;

Expand Down
1 change: 0 additions & 1 deletion app/Events/EmployeeCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Events;

use App\Models\Employee;
use App\Models\LegacyRegistration;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/AccessLevelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private function store(Request $request, LegacyUserType $userType)
*/
public function new(Request $request)
{
$view = $this->show($request, new LegacyUserType());
$view = $this->show($request, new LegacyUserType);

$this->breadcrumb('Cadastrar tipo de usuário');

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/AnnouncementPublishController.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function create()
]);

return view('announcement.publish.create', [
'announcement' => new Announcement(),
'announcement' => new Announcement,
'userTypes' => null,
]);
}
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/CityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ protected function deleteRules(Model $model, Request $request)

return [
new CityRestrictOperationRule($accessLevel),
new AddressingCityDistrictRule(),
new AddressingCityPlaceRule(),
new AddressingCityDistrictRule,
new AddressingCityPlaceRule,
];
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/CountryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function deleteRules(Model $model, Request $request)

return [
new CountryRestrictOperationRule($accessLevel),
new AddressingCountryRule(),
new AddressingCountryRule,
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ResourceDisciplineController extends Controller
{
public function index(ResourceDisciplineRequest $request): JsonResource
{
//altera o model se school e grade
// altera o model se school e grade
if ($request->has(['school', 'grade'])) {
$resource = LegacySchoolGradeDiscipline::query()->getResource($request->all());
} else {
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/StateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function deleteRules(Model $model, Request $request)

return [
new StateRestrictOperationRule($accessLevel),
new AddressingStateRule(),
new AddressingStateRule,
];
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function validateLogin(Request $request)
$request->validate([
$this->username() => 'required|string',
'password' => 'required|string',
'grecaptcha' => [new ReCaptchaV3()],
'grecaptcha' => [new ReCaptchaV3],
], [
$this->username() . '.required' => 'O campo matrícula é obrigatório.',
$this->username() . '.string' => 'O campo matrícula é obrigatório.',
Expand Down
20 changes: 10 additions & 10 deletions app/Http/Controllers/BatchEnrollmentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public function viewCancelEnrollments(
return view('enrollments.batch.cancel', [
'schoolClass' => $schoolClass,
'enrollments' => $enrollments,
'fails' => $fails ?? new MessageBag(),
'success' => $success ?? new MessageBag(),
'fails' => $fails ?? new MessageBag,
'success' => $success ?? new MessageBag,
]);
}

Expand All @@ -66,8 +66,8 @@ public function viewEnroll(
return view('enrollments.batch.enroll', [
'schoolClass' => $schoolClass,
'registrations' => $registrations,
'fails' => $fails ?? new MessageBag(),
'success' => $success ?? new MessageBag(),
'fails' => $fails ?? new MessageBag,
'success' => $success ?? new MessageBag,
]);
}

Expand Down Expand Up @@ -97,8 +97,8 @@ public function cancelEnrollments(
$date = Carbon::createFromFormat('d/m/Y', $request->input('date'));
$enrollmentsIds = $request->input('enrollments', []);

$fails = new MessageBag();
$success = new MessageBag();
$fails = new MessageBag;
$success = new MessageBag;

$enrollments = $schoolClass->getActiveEnrollments();

Expand Down Expand Up @@ -142,8 +142,8 @@ public function enroll(
$date = Carbon::createFromFormat('d/m/Y', $request->input('date'));
$registrationsIds = $request->input('registrations', []);

$fails = new MessageBag();
$success = new MessageBag();
$fails = new MessageBag;
$success = new MessageBag;

$registrations = $registrationService->getRegistrationsNotEnrolled($schoolClass);

Expand Down Expand Up @@ -174,8 +174,8 @@ protected function setMessages(
?MessageBag $success,
string $type = 'enroll'
) {
$fail = $fail ?? new MessageBag();
$success = $success ?? new MessageBag();
$fail = $fail ?? new MessageBag;
$success = $success ?? new MessageBag;

switch ($type) {
case 'enroll':
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/BlockEnrollmentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function update(BlockEnrollmentRequest $request)
->when($request->get('ref_cod_curso'), function ($q, $course) {
$q->whereHas('grade', fn ($q) => $q->whereCourse($course));
})
->whereRaw("anos_letivos @> ?", ["{" . $request->get('ano') . "}"])
->whereRaw('anos_letivos @> ?', ['{' . $request->get('ano') . '}'])
->where('ativo', 1);

$gradesCount = $query->count();
Expand All @@ -35,7 +35,7 @@ public function update(BlockEnrollmentRequest $request)
DB::beginTransaction();
$query->update([
'bloquear_enturmacao_sem_vagas' => $request->get('bloquear_enturmacao_sem_vagas'),
'updated_at' => now()
'updated_at' => now(),
]);
DB::commit();
session()->flash('success', 'Atualização em lote efetuada com sucesso.');
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/EnrollmentInepController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function edit(LegacyEnrollment $enrollment)
url('intranet/educar_index.php') => 'Escola',
]);

$this->menu(578); //dd($enrollment->toArray());
$this->menu(578); // dd($enrollment->toArray());

return view('enrollments.enrollmentInep', compact('enrollment'));
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/EnrollmentsPromotionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function processEnrollmentsPromotionJobs(Request $request)
Bus::batch($jobs)
->finally(function (Batch $batch) use ($userId, $message) {
$message .= $batch->totalJobs . ' matrícula(s)';
(new NotificationService())->createByUser($userId, $message, '', NotificationType::OTHER);
(new NotificationService)->createByUser($userId, $message, '', NotificationType::OTHER);
})
->dispatch();

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/FileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class FileController extends Controller
{
public function show(File $file)
{
$url = (new UrlPresigner())->getPresignedUrl(
$url = (new UrlPresigner)->getPresignedUrl(
$file->url
);

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/LegacyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private function loadFileOrAbort($filename)

private function processProperty(object $viewToRender): clsBase
{
$class = new clsBase();
$class = new clsBase;

if (method_exists($viewToRender, 'Formular')) {
$viewToRender->Formular();
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/ReleasePeriodController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function index(Request $request)
'release-period.form',
[
'stageTypes' => LegacyStageType::active()->get()->keyBy('cod_modulo')->toJson(),
'releasePeriod' => new ReleasePeriod(),
'releasePeriod' => new ReleasePeriod,
'data' => $this->applyFilters($request),
'canView' => $request->user()->can('view', Process::RELEASE_PERIOD),
'canModify' => $request->user()->can('modify', Process::RELEASE_PERIOD),
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/ResourceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function get(Model|int $model, Request $request, ?string $class = null):
$query = $model->newQuery();
} else {
$id = $model;
$query = (new $class())->newQuery();
$query = (new $class)->newQuery();
}

$this->columns($request, $query);
Expand Down
16 changes: 8 additions & 8 deletions app/Http/Controllers/SchoolClassController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class SchoolClassController extends Controller
public function store(Request $request)
{
$response = ['msg' => 'Edição efetuada com sucesso.'];
$schoolClassService = new SchoolClassService();
$schoolClassInepService = new SchoolClassInepService();
$schoolClassStageService = new SchoolClassStageService();
$schoolClassService = new SchoolClassService;
$schoolClassInepService = new SchoolClassInepService;
$schoolClassStageService = new SchoolClassStageService;

$codModulo = $request->get('ref_cod_modulo');
$diasLetivos = $request->get('dias_letivos');
Expand Down Expand Up @@ -72,7 +72,7 @@ public function store(Request $request)
'boletim_diferenciado_id' => $multBoletimDiferenciadoId[$key],
];
}
$multiGradesService = new MultiGradesService();
$multiGradesService = new MultiGradesService;
$multiGradesService->storeSchoolClassGrade($schoolClass, $schoolClassGrades);
$this->deleteDisciplineSchoolClass($codTurma);
} else {
Expand All @@ -87,7 +87,7 @@ public function store(Request $request)
$etapasUtilizadas,
$etapasEspecificas
);
$multiGradesService = new MultiGradesService();
$multiGradesService = new MultiGradesService;
$multiGradesService->deleteAllGradesOfSchoolClass($schoolClass);
}

Expand Down Expand Up @@ -149,7 +149,7 @@ public function store(Request $request)
public function delete(Request $request)
{
$response = ['msg' => 'Exclusão efetuada com sucesso.'];
$schoolClassService = new SchoolClassService();
$schoolClassService = new SchoolClassService;

try {
DB::beginTransaction();
Expand All @@ -174,7 +174,7 @@ public function delete(Request $request)
private function prepareSchoolClassDataToStore(Request $request)
{
$params = $request->all();
$legacySchoolClass = new LegacySchoolClass();
$legacySchoolClass = new LegacySchoolClass;

if (!empty($params['cod_turma'])) {
$legacySchoolClass = LegacySchoolClass::find($params['cod_turma']);
Expand Down Expand Up @@ -269,7 +269,7 @@ private function atualizaComponentesCurriculares(
$this->deleteDisciplineSchoolClass($codTurma);

if ($componentes) {
$mapper = new ComponenteCurricular_Model_TurmaDataMapper();
$mapper = new ComponenteCurricular_Model_TurmaDataMapper;

$componentesTurma = [];

Expand Down
Loading

0 comments on commit b6cea39

Please sign in to comment.