UsersController::view()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
1
<?php namespace Anomaly\UsersModule\Http\Controller;
2
3
use Anomaly\Streams\Platform\Http\Controller\PublicController;
4
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
5
6
/**
7
 * Class UsersController
8
 *
9
 * @link          http://pyrocms.com/
10
 * @author        PyroCMS, Inc. <[email protected]>
11
 * @author        Ryan Thompson <[email protected]>
12
 */
13
class UsersController extends PublicController
14
{
15
    /**
16
     * View a user profile.
17
     *
18
     * @param  UserRepositoryInterface               $users
19
     * @return \Illuminate\Contracts\View\View|mixed
20
     */
21
    public function view(UserRepositoryInterface $users)
22
    {
23
        if (!$user = $users->findByUsername($this->route->getParameter('username'))) {
24
            abort(404);
25
        }
26
27
        return $this->view->make('anomaly.module.users::users/view', compact('user'));
28
    }
29
}
30