PostEventSourcedFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 1
1
<?php
2
/**
3
 * This file is part of the Cubiche package.
4
 *
5
 * Copyright (c) Cubiche
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace Cubiche\Domain\EventSourcing\Tests\Fixtures;
11
12
use Cubiche\Domain\Model\Tests\Fixtures\PostId;
13
14
/**
15
 * PostEventSourcedFactory class.
16
 *
17
 * @author Ivannis Suárez Jerez <[email protected]>
18
 */
19
class PostEventSourcedFactory
20
{
21
    /**
22
     * @param string $title
23
     * @param string $content
24
     *
25
     * @return PostEventSourced
26
     */
27
    public static function create($title, $content)
28
    {
29
        return new PostEventSourced(
30
            PostId::fromNative(md5(rand())),
31
            $title,
32
            $content
33
        );
34
    }
35
}
36