for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Policies;
use App\FightersGroup;
use App\Tournament;
use App\User;
class FightersGroupPolicy
{
// use HandlesAuthorization;
public function before(User $user, $ability)
$ability
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function before(User $user, /** @scrutinizer ignore-unused */ $ability)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
if ($user->isSuperAdmin()) {
return true;
}
return null;
// You can store a user if you are not a simple user
public function store(User $user, Tournament $tournament)
return ($tournament->user_id == $user->id);
public function destroy(User $user, FightersGroup $tree)
$tournament = $tree->championship->tournament;
championship
App\FightersGroup
__get
tournament
Illuminate\Database\Eloquent\Relations\Relation
Illuminate\Database\Eloquent\Builder
// dd($tournament);
user_id
DateTimeZone
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.