Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Push — development ( 2ed88e...dc2433 )
by José
03:08
created

UsersController::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 6
nc 1
nop 2
1
<?php
2
3
namespace DoeSangue\Http\Controllers;
4
5
use DoeSangue\Http\Requests\UserProfileRequest;
6
use DoeSangue\Models\User;
7
use Illuminate\Http\Request;
8
use DoeSangue\Http\Controllers\Controller;
9
10
class UsersController extends Controller
11
{
12
    public function index()
13
    {
14
        $users = User::orderBy('name', 'id')->get();
15
16
        return view('users.index', compact('users'));
17
    }
18
19
    public function update(UserProfileRequest $request, $id)
20
    {
21
        $user = User::find($id);
22
        $user->fill($request->all());
23
        $user->password = bcrypt($request->password);
0 ignored issues
show
Documentation introduced by
The property password does not exist on object<DoeSangue\Http\Re...sts\UserProfileRequest>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?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.");
        }
    }

}

If the property has read access only, you can use the @property-read 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.

Loading history...
24
        $user->save();
25
26
        return redirect()->route('users.profile', $user->id);
27
    }
28
}
29