Test Failed
Push — master ( 7c30c4...acb065 )
by dima
03:52
created
src/ISpecificationCriteria.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -10,43 +10,43 @@
 block discarded – undo
10 10
  */
11 11
 interface ISpecificationCriteria
12 12
 {
13
-    public function getCriteria();
13
+	public function getCriteria();
14 14
 	
15 15
 	public function getWhere();
16 16
 
17
-    public function getLimit();
17
+	public function getLimit();
18 18
 
19
-    public function getOfset();
19
+	public function getOfset();
20 20
 
21
-    public function getJoins();
21
+	public function getJoins();
22 22
 
23
-    public function getOrder();
23
+	public function getOrder();
24 24
 
25
-    public function getManualJoins();
25
+	public function getManualJoins();
26 26
 
27
-    public function getGroup();
27
+	public function getGroup();
28 28
 
29
-    public function getManualWheres();
29
+	public function getManualWheres();
30 30
 
31
-    public function getWhereType();    
31
+	public function getWhereType();    
32 32
 
33
-    public function setWhere($field,$value = false);    
33
+	public function setWhere($field,$value = false);    
34 34
 
35
-    public function setLimit($limit);
35
+	public function setLimit($limit);
36 36
 
37
-    public function setOfset($ofset);
37
+	public function setOfset($ofset);
38 38
 
39
-    public function setJoins($joins);    
39
+	public function setJoins($joins);    
40 40
 
41
-    public function setOrder($order);
41
+	public function setOrder($order);
42 42
 
43
-    public function setManualJoins($manualJoins);
43
+	public function setManualJoins($manualJoins);
44 44
 
45
-    public function setGroup($group);
45
+	public function setGroup($group);
46 46
 
47
-    public function setManualWheres($manualWheres);
47
+	public function setManualWheres($manualWheres);
48 48
 	
49
-    public function setWhereType($whereType);
49
+	public function setWhereType($whereType);
50 50
 	
51 51
 }
52 52
 
Please login to merge, or discard this patch.
src/RepositoryInterface.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,15 +10,15 @@
 block discarded – undo
10 10
 interface RepositoryInterface
11 11
 {
12 12
 
13
-    public function findById($id);
13
+	public function findById($id);
14 14
 
15
-    public function findBySpecification(ISpecificationCriteria $specification);
15
+	public function findBySpecification(ISpecificationCriteria $specification);
16 16
 
17
-    public function findAll();
17
+	public function findAll();
18 18
 
19
-    public function findAllBySpecification(ISpecificationCriteria $specification);
19
+	public function findAllBySpecification(ISpecificationCriteria $specification);
20 20
 
21
-    public function save(EntityInterface $Entity);
21
+	public function save(EntityInterface $Entity);
22 22
 
23
-    public function delete(EntityInterface $Entity);
23
+	public function delete(EntityInterface $Entity);
24 24
 }
Please login to merge, or discard this patch.
src/EntityInterface.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,12 +8,12 @@
 block discarded – undo
8 8
  */
9 9
 interface EntityInterface
10 10
 {
11
-    //put your code here
12
-    public function getId();
11
+	//put your code here
12
+	public function getId();
13 13
     
14
-    public function setId($id);
14
+	public function setId($id);
15 15
 	
16
-    public function getDeleted();
16
+	public function getDeleted();
17 17
     
18
-    public function setDeleted($delete);	
18
+	public function setDeleted($delete);	
19 19
 }
Please login to merge, or discard this patch.
tests/src/AbstractDataMapperTest.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 		//-----------------
59 59
 		$mapping_fields = \TestHelper::getProtectedAttribute($this->object,'mapping_fields');
60 60
 
61
-        $this->assertEquals($mapping_fields, $correct);		
61
+		$this->assertEquals($mapping_fields, $correct);		
62 62
 	}		
63 63
 	
64 64
 	/**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		//-----------------
78 78
 		$mapping_fields = \TestHelper::getProtectedAttribute($this->object,'mapping_fields');
79 79
 
80
-        $this->assertEquals($mapping_fields, $correct);		
80
+		$this->assertEquals($mapping_fields, $correct);		
81 81
 	}		
82 82
 
83 83
 	/**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 		//-----------------
99 99
 		$mapping_fields = \TestHelper::getProtectedAttribute($this->object,'mapping_fields');
100 100
 
101
-        $this->assertEquals($mapping_fields, $correct);		
101
+		$this->assertEquals($mapping_fields, $correct);		
102 102
 	}	
103 103
 	
104 104
 	/**
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 		//-----------------
122 122
 		$mapping_fields = \TestHelper::getProtectedAttribute($this->object,'mapping_fields');
123 123
 
124
-        $this->assertEquals($mapping_fields, $correct);		
124
+		$this->assertEquals($mapping_fields, $correct);		
125 125
 		
126 126
 		$key_field = \TestHelper::getProtectedAttribute($this->object,'key');
127 127
 		$this->assertEquals($key_field, 'tb_mayfield');	
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 		//-----------------
148 148
 		$mapping_fields = \TestHelper::getProtectedAttribute($this->object,'mapping_fields');
149 149
 
150
-        $this->assertEquals($mapping_fields, $correct);		
150
+		$this->assertEquals($mapping_fields, $correct);		
151 151
 		
152 152
 		$soft_delete_key = \TestHelper::getProtectedAttribute($this->object,'soft_delete_key');
153 153
 		$this->assertEquals($soft_delete_key, 'tb_mayfield');	
Please login to merge, or discard this patch.
src/AbstractEntity.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -10,29 +10,29 @@
 block discarded – undo
10 10
 abstract class AbstractEntity implements EntityInterface
11 11
 {
12 12
 
13
-    protected $id;
13
+	protected $id;
14 14
 	
15 15
 	protected $deleted;
16 16
 
17 17
 	public function getId()
18
-    {
19
-        return $this->id;
20
-    }
18
+	{
19
+		return $this->id;
20
+	}
21 21
 
22
-    public function setId($id)
23
-    {
24
-        if ($this->id !== null) {
25
-            throw new BadMethodCallException(
26
-                "Идентификатор у сущности уже установлен");
27
-        }
22
+	public function setId($id)
23
+	{
24
+		if ($this->id !== null) {
25
+			throw new BadMethodCallException(
26
+				"Идентификатор у сущности уже установлен");
27
+		}
28 28
  
29
-        if (empty($id)) {//$id < 1
30
-            throw new InvalidArgumentException("Неверный индентификатор");
31
-        }
29
+		if (empty($id)) {//$id < 1
30
+			throw new InvalidArgumentException("Неверный индентификатор");
31
+		}
32 32
  
33
-        $this->id = $id;
34
-        return $this;		
35
-    }
33
+		$this->id = $id;
34
+		return $this;		
35
+	}
36 36
 	
37 37
 	public function setDeleted($deleted){
38 38
 		$this->deleted = $deleted;
Please login to merge, or discard this patch.
tests/bootstrap.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -3,38 +3,38 @@
 block discarded – undo
3 3
 
4 4
 class TestHelper{
5 5
     
6
-    /**
7
-     * получение защищенного свойства
8
-     * @param type $o
9
-     * @param type $name
10
-     * @return type
11
-     */
12
-    static public function getProtectedAttribute($obj, $name)
13
-    {
14
-        $reflectionClass = new \ReflectionClass($obj); //создаем reflectionClass
15
-        $r = $reflectionClass->getProperty($name); //получаем свойство
16
-        $r->setAccessible(true); //делаем открытым
17
-        return $r->getValue($obj);
18
-    }
6
+	/**
7
+	 * получение защищенного свойства
8
+	 * @param type $o
9
+	 * @param type $name
10
+	 * @return type
11
+	 */
12
+	static public function getProtectedAttribute($obj, $name)
13
+	{
14
+		$reflectionClass = new \ReflectionClass($obj); //создаем reflectionClass
15
+		$r = $reflectionClass->getProperty($name); //получаем свойство
16
+		$r->setAccessible(true); //делаем открытым
17
+		return $r->getValue($obj);
18
+	}
19 19
 
20
-    /**
21
-     * Добавление значения в защищенное свойтсво
22
-     * @param type $name
23
-     * @param type $valued 
24
-     */
25
-    static public function setValueprotectedProperty($obj, $name, $value)
26
-    {
27
-        $reflectionClass = new \ReflectionClass($obj); //создаем reflectionClass
28
-        $r = $reflectionClass->getProperty($name); //получаем свойство
29
-        $r->setAccessible(true); //делаем открытым
30
-        $r->setValue($obj, $value); //изменяем значение
31
-    }    
20
+	/**
21
+	 * Добавление значения в защищенное свойтсво
22
+	 * @param type $name
23
+	 * @param type $valued 
24
+	 */
25
+	static public function setValueprotectedProperty($obj, $name, $value)
26
+	{
27
+		$reflectionClass = new \ReflectionClass($obj); //создаем reflectionClass
28
+		$r = $reflectionClass->getProperty($name); //получаем свойство
29
+		$r->setAccessible(true); //делаем открытым
30
+		$r->setValue($obj, $value); //изменяем значение
31
+	}    
32 32
 	
33 33
 	static public function callMethod($obj, $name, array $args = []) {
34
-        $class = new \ReflectionClass($obj);
35
-        $method = $class->getMethod($name);
36
-        $method->setAccessible(true);
37
-        return $method->invokeArgs($obj, $args);
38
-    }	
34
+		$class = new \ReflectionClass($obj);
35
+		$method = $class->getMethod($name);
36
+		$method->setAccessible(true);
37
+		return $method->invokeArgs($obj, $args);
38
+	}	
39 39
     
40 40
 }
Please login to merge, or discard this patch.
src/AbstractDataMapper.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	 * таблица для сущности
24 24
 	 * @var type 
25 25
 	 */
26
-    protected $entityTable;	
26
+	protected $entityTable;	
27 27
 
28 28
 	/**
29 29
 	 * первичный ключ
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 	
99 99
 	abstract protected function setMappingFields();	
100 100
 	
101
-    public function getAdapter() {
102
-        return $this->adapter;
103
-    }
101
+	public function getAdapter() {
102
+		return $this->adapter;
103
+	}
104 104
 
105 105
 	public function setAdapter(QueryBuilderInterface $adapter){
106 106
 		 $this->adapter = $adapter;
@@ -123,12 +123,12 @@  discard block
 block discarded – undo
123 123
 	 * @param type $id
124 124
 	 * @return type
125 125
 	 */
126
-    public function findById($id)
127
-    {
126
+	public function findById($id)
127
+	{
128 128
 		$Criteria = (new Specification())->setWhere($this->key , $id);
129 129
 		
130
-        return $this->findBySpecification($Criteria);
131
-    }	
130
+		return $this->findBySpecification($Criteria);
131
+	}	
132 132
 	
133 133
 	/**
134 134
 	 * Сохранение сущности без спобытий
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 	 */
257 257
 	protected function buildEntity(EntityInterface $Entity, array $row){
258 258
 		
259
-        foreach ($this->mapping_fields as $alias => $cfg ) {
259
+		foreach ($this->mapping_fields as $alias => $cfg ) {
260 260
 			
261 261
 			$value = false;
262 262
 			
@@ -299,9 +299,9 @@  discard block
 block discarded – undo
299 299
 			if($value!==false)
300 300
 				$Entity->{$method_set}($value);
301 301
 			
302
-        }
302
+		}
303 303
 				
304
-        return $Entity;		
304
+		return $Entity;		
305 305
 	}	
306 306
 
307 307
 	
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 		
316 316
 		$row = [];
317 317
 
318
-        foreach ($this->mapping_fields as $alias => $cfg ) {
318
+		foreach ($this->mapping_fields as $alias => $cfg ) {
319 319
 			
320 320
 			$field = $cfg['field'];
321 321
 			
@@ -345,9 +345,9 @@  discard block
 block discarded – undo
345 345
 						
346 346
 			$row[$field] = $value;
347 347
 
348
-        }
348
+		}
349 349
 			
350
-        return $row;		
350
+		return $row;		
351 351
 	}	
352 352
 	
353 353
 	/**
@@ -431,9 +431,9 @@  discard block
 block discarded – undo
431 431
 		//получение записей
432 432
 		$res = $this->getAdapter()->getResultQuery($this->getEntityTable(),$specification);
433 433
 
434
-        if (!$row = $res->row_array()) {
435
-            return null;
436
-        }
434
+		if (!$row = $res->row_array()) {
435
+			return null;
436
+		}
437 437
 		
438 438
 		if($this->result_array===true){
439 439
 			return $row;
@@ -482,8 +482,8 @@  discard block
 block discarded – undo
482 482
 		$res = $this->getAdapter()->getResultQuery($this->getEntityTable(),$specification);
483 483
 		
484 484
 		if (!$rows = $res->result_array()) {
485
-            return null;
486
-        }	
485
+			return null;
486
+		}	
487 487
 		
488 488
 		if($this->result_array===true){
489 489
 			return $rows;
Please login to merge, or discard this patch.