Skip to content

Commit

Permalink
Merge pull request #803 from portabilis/portabilis-patch-2021-10-15
Browse files Browse the repository at this point in the history
[2.6] Portabilis patch 15/10/2021
  • Loading branch information
edersoares committed Oct 15, 2021
2 parents 8207a4a + bc713e6 commit cd3a4bc
Show file tree
Hide file tree
Showing 468 changed files with 4,891 additions and 4,502 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bugs.md
Expand Up @@ -8,7 +8,7 @@ assignees: ''
---

Olá e obrigado por nos ajudar a tornar o i-Educar um projeto mais estável. Não esqueça de revisar o nosso
[guia de contribuição](https://github.com/portabilis/i-educar/blob/master/contributing.md) para saber melhor como colaborar com a nossa comunidade. Para reportar seu bug use o template abaixo:
[guia de contribuição](https://github.com/portabilis/i-educar/blob/master/CONTRIBUTING.md) para saber melhor como colaborar com a nossa comunidade. Para reportar seu bug use o template abaixo:

**MENU:**

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/outros.md
Expand Up @@ -8,7 +8,7 @@ assignees: ''
---

Olá e obrigado por nos ajudar a tornar o i-Educar um projeto melhor. Não esqueça de revisar o nosso
[guia de contribuição](https://github.com/portabilis/i-educar/blob/master/contributing.md) para saber melhor como colaborar com a nossa comunidade. Você também pode usar o template abaixo para preencher sua issue:
[guia de contribuição](https://github.com/portabilis/i-educar/blob/master/CONTRIBUTING.md) para saber melhor como colaborar com a nossa comunidade. Você também pode usar o template abaixo para preencher sua issue:

**CONTEXTO:**

Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/fixer.yml
@@ -0,0 +1,32 @@
name: Fixer

on:
push:
branches:
- main

jobs:
build:
name: Style code fixer

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.ACTIONS_TOKEN }}

- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'

- name: Composer
run: composer install

- name: Style code fixer
run: composer fix-style

- name: Commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Style code
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -15,7 +15,7 @@ ieducar-*.tar.gz
.env
.env.host
.env.testing
.php_cs.cache
.php-cs-fixer.cache
docker-compose.override.yml

/node_modules
Expand Down
31 changes: 31 additions & 0 deletions .php-cs-fixer.php
@@ -0,0 +1,31 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in([
'app',
'config',
'database',
'routes',
'src',
'tests',
]);

$config = new PhpCsFixer\Config();

return $config->setRules([
'@PSR12' => true,
'phpdoc_align' => [
'align' => 'vertical'
],
'single_quote' => [
'strings_containing_single_quote_chars' => true
],
'phpdoc_separation' => true,
'blank_line_before_statement' => true,
'array_syntax' => ['syntax' => 'short'],
'no_extra_blank_lines' => true,
'no_unused_imports' => true,
'ordered_imports' => [
'sort_algorithm' => 'alpha'
]
])->setFinder($finder);
38 changes: 0 additions & 38 deletions .php_cs

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions readme.md → README.md
Expand Up @@ -36,7 +36,7 @@ Acreditamos que o sucesso do projeto depende diretamente da interação clara e
objetiva entre os membros da Comunidade. Por isso, estamos definindo algumas
políticas para que estas interações nos ajudem a crescer juntos! Você pode
consultar algumas destas boas práticas em nosso [código de
conduta](https://github.com/portabilis/i-educar/blob/master/code-of-conduct.md).
conduta](https://github.com/portabilis/i-educar/blob/master/CODE-OF-CONDUCT.md).

Além disso, gostamos de meios de comunicação assíncrona, onde não há necessidade de
respostas em tempo real. Isso facilita a produtividade individual dos
Expand All @@ -53,8 +53,8 @@ comunidade i-Educar e não terá suporte da Portabilis - mantenedora do projeto.

## Como contribuir

Contribuições são **super bem vindas**! Se você tem vontade de construir o
i-Educar junto conosco, veja o nosso [guia de contribuição](./contributing.md)
Contribuições são **super bem-vindas**! Se você tem vontade de construir o
i-Educar junto conosco, veja o nosso [guia de contribuição](./CONTRIBUTING.md)
onde explicamos detalhadamente como trabalhamos e de que formas você pode nos
ajudar a alcançar nossos objetivos.

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Expand Up @@ -2,4 +2,4 @@

## Reporting a Vulnerability

Please report security issues to `eder@portabilis.com.br`
Please report security issues to `security@portabilis.com.br`
1 change: 1 addition & 0 deletions app/Console/Commands/DisableUsersWithAccessExpired.php
Expand Up @@ -42,6 +42,7 @@ public function handle()
{
$job = new BatchDisableUsersWithDaysGoneSinceLastAccess(DB::getDefaultConnection());
app(Dispatcher::class)->dispatch($job);

return 0;
}
}
1 change: 1 addition & 0 deletions app/Console/Commands/LegacyCreateTestsCommand.php
Expand Up @@ -74,6 +74,7 @@ public function handle()
$this->warn(
"Teste {$router['className']} criado para a rota {$router['route']} já criado ou houve falha"
);

continue;
}

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/UpdateDisciplinesCommand.php
Expand Up @@ -55,7 +55,7 @@ private function setCopiers(MoveDisciplineDataService $service)
}

foreach ($copiers as $copier) {
$service->setMoveDataService(new $copier);
$service->setMoveDataService(new $copier());
}
}
}
13 changes: 7 additions & 6 deletions app/Contracts/AssetServiceContract.php
Expand Up @@ -7,9 +7,9 @@ interface AssetServiceContract
/**
* AssetServiceContract constructor.
*
* @param string $version
* @param string $version
* @param bool|null $secure
* @param bool $automatic_versioning
* @param bool $automatic_versioning
*/
public function __construct(string $version, ?bool $secure = null, bool $automatic_versioning = false);

Expand All @@ -18,14 +18,14 @@ public function __construct(string $version, ?bool $secure = null, bool $automat
*
* @return ?string
*/
public function getVersion() : ?string;
public function getVersion(): ?string;

/**
* Get assets version number.
*
* @return bool
*/
public function isAutomaticVersioning() : bool;
public function isAutomaticVersioning(): bool;

/**
* Get secure option.
Expand All @@ -37,9 +37,10 @@ public function getSecure(): ?bool;
/**
* Generate an asset path with version parameter for the application.
*
* @param string $path
* @param string $path
* @param bool|null $secure
*
* @return string
*/
public function get(string $path, bool $secure = null) : string;
public function get(string $path, bool $secure = null): string;
}
4 changes: 3 additions & 1 deletion app/Events/NotificationEvent.php
Expand Up @@ -11,7 +11,9 @@

class NotificationEvent implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;

/**
* @var Notification
Expand Down
4 changes: 3 additions & 1 deletion app/Events/RegistrationEvent.php
Expand Up @@ -8,7 +8,9 @@

class RegistrationEvent
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;

public $registration;

Expand Down
4 changes: 3 additions & 1 deletion app/Events/TransferEvent.php
Expand Up @@ -9,7 +9,9 @@

class TransferEvent
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;

/**
* @var LegacyTransferRequest
Expand Down
3 changes: 3 additions & 0 deletions app/Exports/StudentsExport.php
Expand Up @@ -40,11 +40,13 @@ public function map($student): array
case GuardianType::FATHER:
$guardianName = $fatherName;
$guardianDocument = $fatherDocument;

break;

case GuardianType::MOTHER:
$guardianName = $motherName;
$guardianDocument = $motherDocument;

break;

case GuardianType::BOTH:
Expand All @@ -69,6 +71,7 @@ public function map($student): array

$guardianName = join(', ', $names);
$guardianDocument = join(', ', $documents);

break;
}

Expand Down
2 changes: 1 addition & 1 deletion app/Facades/Asset.php
Expand Up @@ -2,8 +2,8 @@

namespace App\Facades;

use Illuminate\Support\Facades\Facade;
use App\Contracts\AssetServiceContract;
use Illuminate\Support\Facades\Facade;

class Asset extends Facade
{
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/AccessLevelController.php
Expand Up @@ -4,15 +4,13 @@

use App\Menu;
use App\Models\LegacyUserType;
use App\Services\CacheManager;
use App\Services\MenuCacheService;
use App\User;
use Exception;
use Illuminate\Database\Connection;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Cache;
use Illuminate\View\View;
use Throwable;

Expand Down Expand Up @@ -61,6 +59,7 @@ private function store(Request $request, LegacyUserType $userType)

app(MenuCacheService::class)->flushMenuTag($userType->cod_tipo_usuario);
}

/**
* @param Request $request
*
Expand Down
6 changes: 4 additions & 2 deletions app/Http/Controllers/Api/EmployeeWithdrawalController.php
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace App\Http\Controllers\Api;

Expand All @@ -13,7 +15,7 @@ public function remove($id): JsonResponse
{
try {
$employeeWithdrawal = EmployeeWithdrawal::query()->findOrFail($id);
$employeeWithdrawal->update(['data_exclusao' => now(),'ativo' => 0]);
$employeeWithdrawal->update(['data_exclusao' => now(), 'ativo' => 0]);
} catch (Exception $exception) {
return response()->json(
[
Expand Down
8 changes: 4 additions & 4 deletions app/Http/Controllers/Auth/LoginController.php
Expand Up @@ -9,9 +9,6 @@

class LoginController extends Controller
{
protected int $maxAttempts = 2;
protected int $decayMinutes = 1;

/*
|--------------------------------------------------------------------------
| Login Controller
Expand All @@ -25,6 +22,9 @@ class LoginController extends Controller

use AuthenticatesUsers;

protected int $maxAttempts = 2;
protected int $decayMinutes = 1;

/**
* Where to redirect users after login.
*
Expand Down 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()],
]);
}
}
4 changes: 2 additions & 2 deletions app/Http/Controllers/BatchEnrollmentController.php
Expand Up @@ -200,8 +200,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: 3 additions & 1 deletion app/Http/Controllers/Controller.php
Expand Up @@ -14,7 +14,9 @@

class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
use AuthorizesRequests;
use DispatchesJobs;
use ValidatesRequests;

protected $beta = false;

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Educacenso/ValidatorController.php
Expand Up @@ -7,7 +7,7 @@

class ValidatorController extends Controller
{
const VALIDATORS = [
public const VALIDATORS = [
'nome' => 'iEducar\Modules\Educacenso\Validator\NameValidator',
'data-nascimento' => 'iEducar\Modules\Educacenso\Validator\BirthDateValidator',
'certidao-nascimento' => 'iEducar\Modules\Educacenso\Validator\BirthCertificateValidator',
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/FileController.php
Expand Up @@ -11,6 +11,7 @@ class FileController extends Controller
public function upload(FileRequest $request, FileService $fileService)
{
$file = $request->file('file');

try {
$url = $fileService->upload($file);
} catch (Throwable $e) {
Expand Down

0 comments on commit cd3a4bc

Please sign in to comment.