for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Policies;
use App\Association;
use App\User;
class AssociationPolicy
{
/**
* @param User $user
* @param $ability
* @return bool|null
*/
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;
// Only SuperAdmin And FederationPresident should be able to create Associations
* @return bool
public function create(User $user)
if ($user->isFederationPresident()) {
return false;
* @param Association $association
public function store(User $user, Association $association)
$association
public function store(User $user, /** @scrutinizer ignore-unused */ Association $association)
$user
public function store(/** @scrutinizer ignore-unused */ User $user, Association $association)
// if ($user->isFederationPresident()) {
// }
// return false;
// Only SuperAdmin And FederationPresident should be able to delete Associations
public function delete(User $user, Association $association)
return $association->belongsToFederationPresident($user);
*
public function edit(User $user, Association $association)
if ($user->isAssociationPresident()) {
return $association->belongsToAssociationPresident($user);
public function update(User $user, Association $association)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.