for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Http\Requests\Traits;
use App\Task;
/**
* Trait ChecksPermissions.
*/
trait AsksForTasks
{
* @param $task
* @return mixed
protected function askForTasks()
$tasks = Task::all();
$task_names = $tasks->pluck('name')->toArray();
$task_name = $this->choice('Task id?', $task_names);
choice()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
/** @scrutinizer ignore-call */
return $tasks->where('name', $task_name)->first()->id;
}