renatomarinho /
laravel-gitscrum
This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * GitScrum v0.1. |
||
| 4 | * |
||
| 5 | * @author Renato Marinho <[email protected]> |
||
| 6 | * @license http://opensource.org/licenses/GPL-3.0 GPLv3 |
||
| 7 | */ |
||
| 8 | |||
| 9 | namespace GitScrum\Http\Controllers; |
||
| 10 | |||
| 11 | use Illuminate\Http\Request; |
||
| 12 | use GitScrum\Models\User; |
||
| 13 | use Auth; |
||
| 14 | |||
| 15 | class UserController extends Controller |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * Display a listing of the resource. |
||
| 19 | * |
||
| 20 | * @return \Illuminate\Http\Response |
||
| 21 | */ |
||
| 22 | public function dashboard() |
||
| 23 | { |
||
| 24 | $user = Auth::user(); |
||
| 25 | $sprints = $user->sprints()->take(2); |
||
| 26 | $sprintColumns = ['tbody_sprintFavorite', |
||
| 27 | 'tbody_sprintBacklog', |
||
| 28 | 'tbody_sprintProductBacklog', ]; |
||
| 29 | |||
| 30 | $sprints = $sprints->map(function ($sprint) use ($sprintColumns) { |
||
| 31 | $sprint['column'] = $sprintColumns; |
||
| 32 | |||
| 33 | return $sprint; |
||
| 34 | }); |
||
| 35 | |||
| 36 | return view('users.dashboard') |
||
|
0 ignored issues
–
show
|
|||
| 37 | ->with('sprints', $sprints) |
||
| 38 | ->with('sprintColumns', $sprintColumns) |
||
| 39 | ->with('user', $user); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Display a listing of the resource. |
||
| 44 | * |
||
| 45 | * @return \Illuminate\Http\Response |
||
|
0 ignored issues
–
show
|
|||
| 46 | */ |
||
| 47 | public function index() |
||
| 48 | { |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Show the form for creating a new resource. |
||
| 53 | * |
||
| 54 | * @return \Illuminate\Http\Response |
||
|
0 ignored issues
–
show
|
|||
| 55 | */ |
||
| 56 | public function create() |
||
| 57 | { |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Store a newly created resource in storage. |
||
| 62 | * |
||
| 63 | * @param \Illuminate\Http\Request $request |
||
| 64 | * |
||
| 65 | * @return \Illuminate\Http\Response |
||
|
0 ignored issues
–
show
|
|||
| 66 | */ |
||
| 67 | public function store(Request $request) |
||
|
0 ignored issues
–
show
|
|||
| 68 | { |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * Display the specified resource. |
||
| 73 | * |
||
| 74 | * @param int $id |
||
|
0 ignored issues
–
show
There is no parameter named
$id. Was it maybe removed?
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. Consider the following example. The parameter /**
* @param array $germany
* @param array $island
* @param array $italy
*/
function finale($germany, $island) {
return "2:1";
}
The most likely cause is that the parameter was removed, but the annotation was not. Loading history...
|
|||
| 75 | * |
||
| 76 | * @return \Illuminate\Http\Response |
||
| 77 | */ |
||
| 78 | public function show($username) |
||
| 79 | { |
||
| 80 | $user = User::where('username', $username) |
||
| 81 | ->where('provider', Auth::user()->provider) |
||
| 82 | ->first(); |
||
| 83 | |||
| 84 | $activities = $user->activities($user->id); |
||
| 85 | |||
| 86 | return view('users.show') |
||
|
0 ignored issues
–
show
The method
with does only exist in Illuminate\View\View, but not in Illuminate\Contracts\View\Factory.
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
Loading history...
|
|||
| 87 | ->with('user', $user) |
||
| 88 | ->with('activities', $activities); |
||
| 89 | } |
||
| 90 | |||
| 91 | /** |
||
| 92 | * Show the form for editing the specified resource. |
||
| 93 | * |
||
| 94 | * @param int $id |
||
| 95 | * |
||
| 96 | * @return \Illuminate\Http\Response |
||
|
0 ignored issues
–
show
|
|||
| 97 | */ |
||
| 98 | public function edit($id) |
||
|
0 ignored issues
–
show
|
|||
| 99 | { |
||
| 100 | } |
||
| 101 | |||
| 102 | /** |
||
| 103 | * Update the specified resource in storage. |
||
| 104 | * |
||
| 105 | * @param \Illuminate\Http\Request $request |
||
| 106 | * @param int $id |
||
| 107 | * |
||
| 108 | * @return \Illuminate\Http\Response |
||
|
0 ignored issues
–
show
|
|||
| 109 | */ |
||
| 110 | public function update(Request $request, $id) |
||
|
0 ignored issues
–
show
|
|||
| 111 | { |
||
| 112 | } |
||
| 113 | |||
| 114 | /** |
||
| 115 | * Remove the specified resource from storage. |
||
| 116 | * |
||
| 117 | * @param int $id |
||
| 118 | * |
||
| 119 | * @return \Illuminate\Http\Response |
||
|
0 ignored issues
–
show
|
|||
| 120 | */ |
||
| 121 | public function destroy($id) |
||
|
0 ignored issues
–
show
|
|||
| 122 | { |
||
| 123 | } |
||
| 124 | } |
||
| 125 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: