Completed
Push — master ( b4fb45...fd4491 )
by dima
02:45
created

User   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 3
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 7 1
A reset() 0 4 1
1
<?php
2
3
namespace Core\Seeds;
4
5
/**
6
 * Description of User
7
 *
8
 * @author Dmitriy
9
 */
10
class User implements \Frameworkless\SeedInterface
11
{
12
13
	/**
14
	 * 
15
	 * @param type $id
16
	 * @return type
17
	 */
18
	static public function build($id = 1)
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
19
	{
20
		$generator = \Faker\Factory::create();
21
		$populator = new \Faker\ORM\Propel2\Populator($generator);
22
		$populator->addEntity(\Core\Models\User\User::class, $id);
23
		return $populator->execute();
24
	}
25
	
26
	/**
27
	 * 
28
	 * @return type
29
	 */
30
	public static function reset()
31
	{
32
		return \Core\Models\User\UserQuery::create()->deleteAll();
33
	}
34
35
}
36