Skip to content

Commit

Permalink
Merge pull request #1 from drolean/analysis-q12v15
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
drolean authored Oct 21, 2017
2 parents accefa8 + 25ccc42 commit 9a24e6f
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 38 deletions.
2 changes: 1 addition & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function schedule(Schedule $schedule)
*/
protected function commands()
{
$this->load(__DIR__ . '/Commands');
$this->load(__DIR__.'/Commands');

require base_path('routes/console.php');
}
Expand Down
2 changes: 1 addition & 1 deletion app/Events/MessageSent.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MessageSent implements ShouldBroadcast
*/
public function __construct(User $user, Message $message)
{
$this->user = $user;
$this->user = $user;
$this->message = $message;
}

Expand Down
2 changes: 1 addition & 1 deletion app/Events/NotificationRead.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class NotificationRead implements ShouldBroadcast
*/
public function __construct($userId, $notificationId)
{
$this->userId = $userId;
$this->userId = $userId;
$this->notificationId = $notificationId;

$this->dontBroadcastToCurrentUser();
Expand Down
10 changes: 5 additions & 5 deletions app/Http/Controllers/Backend/PermissionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Http\Controllers\Backend;

use App\Http\Controllers\Controller;
use Route;
use App\Models\Permission;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Cache;
use Route;

class PermissionsController extends Controller
{
Expand Down Expand Up @@ -40,8 +40,8 @@ public function create()
*/
public function store(Request $request)
{
$Permissao = new Permission;
$Permissao->name = $request->input('name');
$Permissao = new Permission;
$Permissao->name = $request->input('name');
$Permissao->label = $request->input('label');
$Permissao->save();

Expand Down Expand Up @@ -119,7 +119,7 @@ public function getGerar()
if (starts_with($Rota->getName(), 'admin')) {
$filterRouter = ['admin.empresas*', 'admin.permissio*', 'admin.super*', 'admin.profile*'];

if (!array_has($filterRouter, $Rota->getName())) {
if (! array_has($filterRouter, $Rota->getName())) {
Permission::firstorCreate(['name' => $Rota->getName()]);
}
}
Expand Down
12 changes: 6 additions & 6 deletions app/Http/Controllers/Backend/RolesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace App\Http\Controllers\Backend;

use App\Http\Controllers\Controller;
use App\Models\Permission;
use App\Models\Role;
use App\Models\Permission;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Cache;

class RolesController extends Controller
Expand Down Expand Up @@ -42,8 +42,8 @@ public function create()
*/
public function store(Request $request)
{
$Role = new Role;
$Role->name = $request->input('name');
$Role = new Role;
$Role->name = $request->input('name');
$Role->description = $request->input('description');
$Role->save();

Expand All @@ -62,7 +62,7 @@ public function store(Request $request)
*/
public function show($id)
{
$Role = Role::with('permissions')->where('id', $id)->first();
$Role = Role::with('permissions')->where('id', $id)->first();
$Permissions = Permission::all();

return view('backend.roles.edit', compact('Role', 'Permissions'));
Expand All @@ -76,7 +76,7 @@ public function show($id)
*/
public function edit($id)
{
$Role = Role::with('permissions')->where('id', $id)->first();
$Role = Role::with('permissions')->where('id', $id)->first();
$Permissions = Permission::all();

return view('backend.roles.edit', compact('Role', 'Permissions'));
Expand Down
12 changes: 6 additions & 6 deletions app/Http/Controllers/Frontend/FrontendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ public function getManifest()
'background_color' => '#0178BC',
'theme_color' => '#0178BC',
'icons' => [
[ 'src' => 'launcher-icon-1x.png', 'type' => 'image/png', 'sizes' => '48x48' ],
[ 'src' => 'launcher-icon-2x.png', 'type' => 'image/png', 'sizes' => '96x96' ],
[ 'src' => 'launcher-icon-3x.png', 'type' => 'image/png', 'sizes' => '144x144' ],
[ 'src' => 'launcher-icon-4x.png', 'type' => 'image/png', 'sizes' => '192x192' ],
[ 'src' => 'launcher-icon-5x.png', 'type' => 'image/png', 'sizes' => '512x512' ]
]
['src' => 'launcher-icon-1x.png', 'type' => 'image/png', 'sizes' => '48x48'],
['src' => 'launcher-icon-2x.png', 'type' => 'image/png', 'sizes' => '96x96'],
['src' => 'launcher-icon-3x.png', 'type' => 'image/png', 'sizes' => '144x144'],
['src' => 'launcher-icon-4x.png', 'type' => 'image/png', 'sizes' => '192x192'],
['src' => 'launcher-icon-5x.png', 'type' => 'image/png', 'sizes' => '512x512'],
],
];
}

Expand Down
3 changes: 1 addition & 2 deletions app/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public function handle($request, Closure $next, ...$guards)
($request->route()->getName() !== 'admin.profile.password')) {
return redirect()->route('admin.profile.password')->with('info', 'Altere sua senha!');
}


/*! Coloca status de online ao usuario */
Cache::put('user-is-online-'.$this->auth->User()->id, true, Carbon::now()->addMinutes(2));
Expand All @@ -91,7 +90,7 @@ public function handle($request, Closure $next, ...$guards)
}

/*! Libera admin somente para quem tem regra */
if($this->auth->User()->roles->count() === 0) {
if ($this->auth->User()->roles->count() === 0) {
$this->auth->logout();

return redirect()->guest('/auth/login')->with('error', 'Acesso não permitido.');
Expand Down
14 changes: 7 additions & 7 deletions app/Models/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,33 +68,33 @@ public function setDescricaoAttribute($value)
}

/**
* Returns a Formated activity
* Returns a Formated activity.
*
* @return string
*/
public function getActiviyAttribute()
{
switch ($this->acao) {
case 'created':
echo "Criou novo ";
echo 'Criou novo ';
break;
case 'updated':
echo "Atualizou ";
echo 'Atualizou ';
break;
case 'deleted':
echo "Apagou ";
echo 'Apagou ';
break;
}

switch ($this->content_type) {
case 'App\User':
echo "Usuário";
echo 'Usuário';
break;
case 'App\Models\Profile':
echo "Perfil";
echo 'Perfil';
break;
}

echo " (id: $this->content_id)";
}
}
}
4 changes: 2 additions & 2 deletions app/Notifications/DashboardNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ public function toWebPush($notifiable, $notification)
public function toMail($notifiable)
{
return (new MailMessage)
->subject('['.config('app.name').'] Nova notificação (' . Carbon::now() . ')')
->subject('['.config('app.name').'] Nova notificação ('.Carbon::now().')')
->greeting($this->dados['title'])
->line($this->dados['body'])
->action('Visualizar', (isset($this->dados['action_url'])) ? $this->dados['action_url'] : null)
->line('Este E-mail Foi Gerado Automaticamente');
}
}
}
4 changes: 2 additions & 2 deletions app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace App\Providers;

use App\Models\Permission;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Cache;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;

class AuthServiceProvider extends ServiceProvider
{
Expand Down
1 change: 1 addition & 0 deletions app/Providers/CarbonLanguageProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public function boot()
{
//
}

public function register()
{
Carbon::setLocale($this->app->getLocale());
Expand Down
4 changes: 1 addition & 3 deletions public/index.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<?php

/**
* Laravel - A PHP Framework For Web Artisans
* Laravel - A PHP Framework For Web Artisans.
*
* @package Laravel
* @author Taylor Otwell <taylor@laravel.com>
*/

define('LARAVEL_START', microtime(true));

/*
Expand Down
1 change: 0 additions & 1 deletion resources/lang/pt_BR/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
|
*/


'accepted' => ':attribute precisa ser aceito.',
'active_url' => ':attribute infelizmente não é uma URL válida.',
'after' => ':attribute precisa ser uma data depois de :date. Por favor, você pode verificar isso?',
Expand Down
1 change: 0 additions & 1 deletion tests/Unit/ExampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Tests\Unit;

use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;

class ExampleTest extends TestCase
{
Expand Down

0 comments on commit 9a24e6f

Please sign in to comment.