SubscriberPresenter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 44.44 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 8 8 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

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\Presenters;
13
14
use Gitamin\Presenters\Traits\TimestampsTrait;
15
16
class SubscriberPresenter extends AbstractPresenter
17
{
18
    use TimestampsTrait;
19
20
    /**
21
     * Convert the presenter instance to an array.
22
     *
23
     * @return string[]
24
     */
25 View Code Duplication
    public function toArray()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
26
    {
27
        return array_merge($this->wrappedObject->toArray(), [
28
            'created_at' => $this->created_at(),
29
            'updated_at' => $this->updated_at(),
30
            'verified_at' => $this->verified_at(),
31
        ]);
32
    }
33
}
34