Test Failed
Push — master ( 7c30c4...acb065 )
by dima
03:52
created
src/ISpecificationCriteria.php 2 patches
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.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 
31 31
     public function getWhereType();    
32 32
 
33
-    public function setWhere($field,$value = false);    
33
+    public function setWhere($field, $value = false);    
34 34
 
35 35
     public function setLimit($limit);
36 36
 
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/QueryBuilderInterface.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@
 block discarded – undo
14 14
  */
15 15
 interface QueryBuilderInterface {
16 16
 	
17
-	public function getResultQuery($table,\SimpleORM\ISpecificationCriteria $Criteria);
17
+	public function getResultQuery($table, \SimpleORM\ISpecificationCriteria $Criteria);
18 18
 	
19
-	public function update($table,array $data,$where = []);
19
+	public function update($table, array $data, $where = []);
20 20
 
21
-	public function insert($table,array $data);
21
+	public function insert($table, array $data);
22 22
 	
23 23
 	public function insert_id();
24 24
 	
25
-	public function delete($table,$where = []);
25
+	public function delete($table, $where = []);
26 26
 }
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 2 patches
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.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 //								])//в конструктор
29 29
 						->disableOriginalConstructor()
30 30
 						//->setMethods(null)
31
-						->setMethods(['setMappingFields','createEntity'])
31
+						->setMethods(['setMappingFields', 'createEntity'])
32 32
 						//->setMethods(null) //не использовать заглушки методов иначе буде возвращать NULL
33 33
 						->getMock();
34 34
 	}
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 	/**
46 46
 	 * @covers SimpleORM\AbstractDataMapper::AddMappingField
47 47
 	 */
48
-	public function testAddMappingField_SimpleField(){
48
+	public function testAddMappingField_SimpleField() {
49 49
 		
50
-		\TestHelper::callMethod($this->object,'addMappingField',['myfield']);
50
+		\TestHelper::callMethod($this->object, 'addMappingField', ['myfield']);
51 51
 		
52 52
 		$correct = [
53 53
 			  'myfield'	=>	[
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 		  ];
57 57
 		
58 58
 		//-----------------
59
-		$mapping_fields = \TestHelper::getProtectedAttribute($this->object,'mapping_fields');
59
+		$mapping_fields = \TestHelper::getProtectedAttribute($this->object, 'mapping_fields');
60 60
 
61 61
         $this->assertEquals($mapping_fields, $correct);		
62 62
 	}		
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 	/**
65 65
 	 * @covers SimpleORM\AbstractDataMapper::AddMappingField
66 66
 	 */
67
-	public function testAddMappingField_FieldAndAlias(){
67
+	public function testAddMappingField_FieldAndAlias() {
68 68
 		
69
-		\TestHelper::callMethod($this->object,'addMappingField',['myfield','tb_mayfield']);
69
+		\TestHelper::callMethod($this->object, 'addMappingField', ['myfield', 'tb_mayfield']);
70 70
 		
71 71
 		$correct = [
72 72
 			  'myfield'	=>	[
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 		  ];
76 76
 		
77 77
 		//-----------------
78
-		$mapping_fields = \TestHelper::getProtectedAttribute($this->object,'mapping_fields');
78
+		$mapping_fields = \TestHelper::getProtectedAttribute($this->object, 'mapping_fields');
79 79
 
80 80
         $this->assertEquals($mapping_fields, $correct);		
81 81
 	}		
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
 	/**
84 84
 	 * @covers SimpleORM\AbstractDataMapper::AddMappingField
85 85
 	 */
86
-	public function testAddMappingField_ArrayField(){
86
+	public function testAddMappingField_ArrayField() {
87 87
 		
88
-		\TestHelper::callMethod($this->object,'addMappingField',['myfield',[
88
+		\TestHelper::callMethod($this->object, 'addMappingField', ['myfield', [
89 89
 			'field'	=>	'tb_mayfield'
90 90
 		]]);
91 91
 		
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 		  ];
97 97
 		
98 98
 		//-----------------
99
-		$mapping_fields = \TestHelper::getProtectedAttribute($this->object,'mapping_fields');
99
+		$mapping_fields = \TestHelper::getProtectedAttribute($this->object, 'mapping_fields');
100 100
 
101 101
         $this->assertEquals($mapping_fields, $correct);		
102 102
 	}	
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
 	/**
105 105
 	 * @covers SimpleORM\AbstractDataMapper::AddMappingField
106 106
 	 */
107
-	public function testAddMappingField_PrimaryKey(){
107
+	public function testAddMappingField_PrimaryKey() {
108 108
 		
109
-		\TestHelper::callMethod($this->object,'addMappingField',['myfield',[
109
+		\TestHelper::callMethod($this->object, 'addMappingField', ['myfield', [
110 110
 			'field'		=>	'tb_mayfield',
111 111
 			'primary'	=>	true
112 112
 		]]);
@@ -119,20 +119,20 @@  discard block
 block discarded – undo
119 119
 		  ];
120 120
 		
121 121
 		//-----------------
122
-		$mapping_fields = \TestHelper::getProtectedAttribute($this->object,'mapping_fields');
122
+		$mapping_fields = \TestHelper::getProtectedAttribute($this->object, 'mapping_fields');
123 123
 
124 124
         $this->assertEquals($mapping_fields, $correct);		
125 125
 		
126
-		$key_field = \TestHelper::getProtectedAttribute($this->object,'key');
126
+		$key_field = \TestHelper::getProtectedAttribute($this->object, 'key');
127 127
 		$this->assertEquals($key_field, 'tb_mayfield');	
128 128
 	}	
129 129
 	
130 130
 	/**
131 131
 	 * @covers SimpleORM\AbstractDataMapper::AddMappingField
132 132
 	 */
133
-	public function testAddMappingField_SoftDelete(){
133
+	public function testAddMappingField_SoftDelete() {
134 134
 		
135
-		\TestHelper::callMethod($this->object,'addMappingField',['myfield',[
135
+		\TestHelper::callMethod($this->object, 'addMappingField', ['myfield', [
136 136
 			'field'			=>	'tb_mayfield',
137 137
 			'softdelete'	=>	true
138 138
 		]]);
@@ -145,11 +145,11 @@  discard block
 block discarded – undo
145 145
 		  ];
146 146
 		
147 147
 		//-----------------
148
-		$mapping_fields = \TestHelper::getProtectedAttribute($this->object,'mapping_fields');
148
+		$mapping_fields = \TestHelper::getProtectedAttribute($this->object, 'mapping_fields');
149 149
 
150 150
         $this->assertEquals($mapping_fields, $correct);		
151 151
 		
152
-		$soft_delete_key = \TestHelper::getProtectedAttribute($this->object,'soft_delete_key');
152
+		$soft_delete_key = \TestHelper::getProtectedAttribute($this->object, 'soft_delete_key');
153 153
 		$this->assertEquals($soft_delete_key, 'tb_mayfield');	
154 154
 	}	
155 155
 	
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 	 */
159 159
 	public function testGetPrimaryKey()
160 160
 	{
161
-		\TestHelper::setValueprotectedProperty($this->object,'key','tst_id');
162
-		$this->assertEquals(\TestHelper::callMethod($this->object,'GetPrimaryKey'), 'tst_id');	
161
+		\TestHelper::setValueprotectedProperty($this->object, 'key', 'tst_id');
162
+		$this->assertEquals(\TestHelper::callMethod($this->object, 'GetPrimaryKey'), 'tst_id');	
163 163
 	}
164 164
 	
165 165
 	/**
@@ -167,19 +167,19 @@  discard block
 block discarded – undo
167 167
 	 */
168 168
 	public function testsetSoftDeleteKey()
169 169
 	{
170
-		\TestHelper::setValueprotectedProperty($this->object,'soft_delete_key','stc_deleted');
171
-		$this->assertEquals(\TestHelper::callMethod($this->object,'setSoftDeleteKey'), 'stc_deleted');	
170
+		\TestHelper::setValueprotectedProperty($this->object, 'soft_delete_key', 'stc_deleted');
171
+		$this->assertEquals(\TestHelper::callMethod($this->object, 'setSoftDeleteKey'), 'stc_deleted');	
172 172
 	}	
173 173
 	
174 174
 	/**
175 175
 	 *  @covers SimpleORM\AbstractDataMapper::getFieldAlias
176 176
 	 */
177
-	public function testGetFieldAlias(){
177
+	public function testGetFieldAlias() {
178 178
 		$mapping_fields_aliases = [
179 179
 			'name'	=>	'stc_fullname'
180 180
 		];
181
-		\TestHelper::setValueprotectedProperty($this->object,'mapping_fields_aliases',$mapping_fields_aliases);
182
-		$this->assertEquals(\TestHelper::callMethod($this->object,'getFieldAlias',['name']), 'stc_fullname');
181
+		\TestHelper::setValueprotectedProperty($this->object, 'mapping_fields_aliases', $mapping_fields_aliases);
182
+		$this->assertEquals(\TestHelper::callMethod($this->object, 'getFieldAlias', ['name']), 'stc_fullname');
183 183
 	}
184 184
 	
185 185
 	
Please login to merge, or discard this patch.
tests/bootstrap.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 $loader = require_once __DIR__.'/../vendor/autoload.php';
3 3
 
4
-class TestHelper{
4
+class TestHelper {
5 5
     
6 6
     /**
7 7
      * получение защищенного свойства
Please login to merge, or discard this 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.
example/Domain/City/CityMapper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 					'primary'	 => true
46 46
 					]
47 47
 				)
48
-				->addMappingField('name','cty_name')
48
+				->addMappingField('name', 'cty_name')
49 49
 			;
50 50
 
51 51
 	}	
Please login to merge, or discard this patch.
example/Domain/User/UserMapper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 */
32 32
 	public function createEntity(array $row) {
33 33
 		$Group = $this->DI->get('UserGroupMapper')->createEntity([]);
34
-		return $this->buildEntity(new User('testname','[email protected]','asdftyasdvh21267g',$Group), $row);
34
+		return $this->buildEntity(new User('testname', '[email protected]', 'asdftyasdvh21267g', $Group), $row);
35 35
 	}	
36 36
 	
37 37
 	/**
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 					'primary'	 => true
47 47
 					]
48 48
 				)
49
-				->addMappingField('name','usr_name')
49
+				->addMappingField('name', 'usr_name')
50 50
 				->addMappingField('email', 'usr_email')
51 51
 				->addMappingField('password', 'usr_password')
52 52
 				->addMappingField('group', [
Please login to merge, or discard this patch.
example/Domain/UserGroup/UserGroup.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 	
19 19
 	protected $title;
20 20
 	
21
-	function __construct($code,$title){
21
+	function __construct($code, $title) {
22 22
 		$this->setCode($code);
23 23
 		$this->setTitle($title);
24 24
 	}
Please login to merge, or discard this patch.