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 | namespace App\Http\Controllers; |
||
4 | |||
5 | use Illuminate\Http\Request; |
||
6 | use App\Http\Requests; |
||
7 | use App\Departments; |
||
8 | use App\Department_members; |
||
9 | use Mail; |
||
10 | use App\User; |
||
11 | |||
12 | class DepartmentsController extends Controller |
||
13 | { |
||
14 | public function __construct() |
||
15 | { |
||
16 | $this->middleware('auth'); |
||
17 | } |
||
18 | |||
19 | public function index() |
||
20 | { |
||
21 | $departments = Departments::orderBy('department_name', 'asc')->paginate(10); |
||
22 | return view('departments/list', ['departments' => $departments]); |
||
23 | } |
||
24 | |||
25 | public function create() |
||
26 | { |
||
27 | $managers = User::all(); |
||
28 | return view('departments/create', ['managers' => $managers]); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Store a newly created resource in storage. |
||
33 | * |
||
34 | * @param \Illuminate\Http\Request $request |
||
35 | * @return \Illuminate\Http\Response |
||
36 | */ |
||
37 | public function store(Request $request) |
||
38 | { |
||
39 | $departments = new Departments; |
||
40 | $departments->department_name = $request->get('department_name'); |
||
0 ignored issues
–
show
|
|||
41 | $departments->department_manager = $request->get('department_manager'); |
||
0 ignored issues
–
show
The property
department_manager does not exist on object<App\Departments> . Since you implemented __set , maybe consider adding a @property annotation.
Since your code implements the magic setter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
Since the property has write access only, you can use the @property-write annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
42 | $departments->department_description = $request->get('department_description'); |
||
0 ignored issues
–
show
The property
department_description does not exist on object<App\Departments> . Since you implemented __set , maybe consider adding a @property annotation.
Since your code implements the magic setter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
Since the property has write access only, you can use the @property-write annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
43 | $departments->save(); |
||
44 | |||
45 | $department_id = $departments->id; |
||
0 ignored issues
–
show
The property
id does not exist on object<App\Departments> . Since you implemented __set , maybe consider adding a @property annotation.
Since your code implements the magic setter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
Since the property has write access only, you can use the @property-write annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
46 | |||
47 | $manager = new Department_members; |
||
48 | $manager->departmentid = $department_id; |
||
0 ignored issues
–
show
The property
departmentid does not exist on object<App\Department_members> . Since you implemented __set , maybe consider adding a @property annotation.
Since your code implements the magic setter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
Since the property has write access only, you can use the @property-write annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
49 | $manager->userid = $request->get('department_manager'); |
||
0 ignored issues
–
show
The property
userid does not exist on object<App\Department_members> . Since you implemented __set , maybe consider adding a @property annotation.
Since your code implements the magic setter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
Since the property has write access only, you can use the @property-write annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
50 | $manager->save(); |
||
51 | |||
52 | \Session::flash('message', "New department has been saved"); |
||
53 | return redirect('staff/departments'); |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * Display the specified resource. |
||
58 | * |
||
59 | * @param int $id |
||
60 | * @return \Illuminate\Http\Response |
||
61 | */ |
||
62 | public function show($id) |
||
0 ignored issues
–
show
|
|||
63 | { |
||
64 | // |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * Show the form for editing the specified resource. |
||
69 | * |
||
70 | * @param int $id |
||
71 | * @return \Illuminate\Http\Response |
||
72 | */ |
||
73 | public function edit($id) |
||
0 ignored issues
–
show
|
|||
74 | { |
||
75 | // |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * Update the specified resource in storage. |
||
80 | * |
||
81 | * @param \Illuminate\Http\Request $request |
||
82 | * @param int $id |
||
83 | * @return \Illuminate\Http\Response |
||
84 | */ |
||
85 | public function update(Request $request, $id) |
||
0 ignored issues
–
show
|
|||
86 | { |
||
87 | // |
||
88 | } |
||
89 | |||
90 | /** |
||
91 | * Remove the specified resource from storage. |
||
92 | * |
||
93 | * @param int $id |
||
94 | * @return \Illuminate\Http\Response |
||
95 | */ |
||
96 | public function destroy($id) |
||
0 ignored issues
–
show
|
|||
97 | { |
||
98 | // |
||
99 | } |
||
100 | } |
||
101 |
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.