Completed
Push — master ( 4807d4...0de6b4 )
by Ryan
127:05 queued 70:25
created

UsersController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
c 3
b 0
f 0
lcom 0
cbo 1
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A view() 0 8 2
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
 * @package       Anomaly\UsersModule\Http\Controller
13
 */
14
class UsersController extends PublicController
15
{
16
    /**
17
     * View a user profile.
18
     *
19
     * @param UserRepositoryInterface $users
20
     * @return \Illuminate\Contracts\View\View|mixed
21
     */
22
    public function view(UserRepositoryInterface $users)
23
    {
24
        if (!$user = $users->findByUsername($this->route->getParameter('username'))) {
25
            abort(404);
26
        }
27
28
        return $this->view->make('anomaly.module.users::users/view', compact('user'));
29
    }
30
}
31