Completed
Push — master ( da1994...a846d4 )
by Adrien
11s
created

BadgeCompletionFactory::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
dl 11
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 2
1
<?php
2
3
namespace Badger\Bundle\GameBundle\Factory;
4
5
use Badger\Bundle\GameBundle\Entity\BadgeCompletion;
6
use Badger\Component\Game\Model\BadgeInterface;
7
use Badger\Component\User\Model\UserInterface;
8
9
/**
10
 * @author  Adrien Pétremann <[email protected]>
11
 * @license http://opensource.org/licenses/MIT The MIT License (MIT)
12
 */
13
class BadgeCompletionFactory
14
{
15
    /**
16
     * @param UserInterface  $user
17
     * @param BadgeInterface $badge
18
     *
19
     * @return BadgeCompletion
20
     */
21 View Code Duplication
    public function create(UserInterface $user, BadgeInterface $badge)
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...
22
    {
23
        $badgeCompletion = new BadgeCompletion();
24
25
        $badgeCompletion->setUser($user);
26
        $badgeCompletion->setBadge($badge);
27
        $badgeCompletion->setCompletionDate(new \DateTime());
28
        $badgeCompletion->setPending(true);
29
30
        return $badgeCompletion;
31
    }
32
}
33