for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace TaskManager\Policies;
use Hamcrest\SampleSelfDescriber;
use Psy\Util\Str;
use TaskManager\User;
use TaskManager\Tasks;
use Illuminate\Auth\Access\HandlesAuthorization;
class TasksPolicy
{
use HandlesAuthorization;
/**
* Determine whether the user can view the tasks.
*
* @param \TaskManager\User $user
* @param \TaskManager\Tasks $tasks
* @return mixed
*/
public function view(User $user, Tasks $tasks)
$user
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function view(/** @scrutinizer ignore-unused */ User $user, Tasks $tasks)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return dd($tasks);
}
* Determine whether the user can create tasks.
public function create(User $user)
if ($user->active)
active
TaskManager\User
__get
return true;
else
return false;
* Determine whether the user can update the tasks.
public function update(User $user, Tasks $task)
if($user->id == $task->user_id){
user_id
TaskManager\Tasks
user
else{
* Determine whether the user can delete the tasks.
* @param Tasks $id
* @internal param Tasks $tasks
public function delete(User $user, Tasks $id)
if($user->id == $id->user_id){
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.