UpdateOwnerCommandHandler   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 14 1
1
<?php
2
3
/*
4
 * This file is part of Gitamin.
5
 *
6
 * Copyright (C) 2015-2016 The Gitamin Team
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Gitamin\Handlers\Commands\Owner;
13
14
use Gitamin\Commands\Owner\UpdateOwnerCommand;
15
use Gitamin\Events\Owner\OwnerWasUpdatedEvent;
16
17
class UpdateOwnerCommandHandler
18
{
19
    /**
20
     * Handle the update project group command.
21
     *
22
     * @param \Gitamin\Commands\Owner\UpdateOwnerCommand $command
23
     *
24
     * @return \Gitamin\Models\Owner
25
     */
26
    public function handle(UpdateOwnerCommand $command)
27
    {
28
        $owner = $command->owner;
29
        $owner->update([
30
            'name' => $command->name,
31
            'path' => $command->path,
32
            'user_id' => $command->user_id,
33
            'description' => $command->description,
34
        ]);
35
36
        event(new OwnerWasUpdatedEvent($owner));
37
38
        return $owner;
39
    }
40
}
41