Test Failed
Push — master ( 7c30c4...acb065 )
by dima
03:52
created
src/Adapter/CodeigniterQueryBuilder.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,8 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
 		if(!$like){
73 73
 			return $this->adapter->escape_str($str);
74
-		}
75
-		else{
74
+		} else{
76 75
 			return $this->adapter->escape_like_str($str);
77 76
 		}	
78 77
 		
@@ -145,8 +144,7 @@  discard block
 block discarded – undo
145 144
 		if(preg_match('~(.*?)\.(.*?)$~is',$table,$m)){
146 145
 			$this->database = $m[1];
147 146
 			$this->TableName = $m[2];
148
-		}
149
-		else{
147
+		} else{
150 148
 			$this->TableName = $table;
151 149
 		}		
152 150
 	}	
Please login to merge, or discard this patch.
Doc Comments   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,6 +66,9 @@  discard block
 block discarded – undo
66 66
 		return $this->adapter->delete($table,$where);
67 67
 	}
68 68
 
69
+	/**
70
+	 * @param string $str
71
+	 */
69 72
 	protected function escape_str($str, $like = FALSE)
70 73
 	{
71 74
 
@@ -120,7 +123,6 @@  discard block
 block discarded – undo
120 123
 	
121 124
 	/**
122 125
 	 * 
123
-	 * @param type $param
124 126
 	 */
125 127
 	public function getResultQuery($table,\SimpleORM\ISpecificationCriteria $Criteria ) {
126 128
 		
@@ -156,6 +158,7 @@  discard block
 block discarded – undo
156 158
 	/**
157 159
 	 * Создает селект не только для основной таблицы но и для приджойненых таблиц
158 160
 	 * @param type $joins
161
+	 * @param string $manualSelect
159 162
 	 * @return type
160 163
 	 */
161 164
 	protected function createSelect(array $joins,$manualSelect)
@@ -173,8 +176,8 @@  discard block
 block discarded – undo
173 176
 	/**
174 177
 	 * Получение записей по условию
175 178
 	 * @param type $where
176
-	 * @param type $limit
177
-	 * @param type $offset
179
+	 * @param integer $limit
180
+	 * @param integer $offset
178 181
 	 * @param type $joins
179 182
 	 * @param type $order
180 183
 	 * @param type $manualJoins
Please login to merge, or discard this patch.
example/Domain/UserGroup/UserGroup.php 1 patch
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -18,6 +18,10 @@
 block discarded – undo
18 18
 	
19 19
 	protected $title;
20 20
 	
21
+	/**
22
+	 * @param string $code
23
+	 * @param string $title
24
+	 */
21 25
 	function __construct($code,$title){
22 26
 		$this->setCode($code);
23 27
 		$this->setTitle($title);
Please login to merge, or discard this patch.
src/AbstractDataMapper.php 2 patches
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -303,9 +303,9 @@  discard block
 block discarded – undo
303 303
 	/**
304 304
 	 * Подготавливаем конечный вариант Сущности
305 305
 	 * 
306
-	 * @param \Core\Infrastructure\EntityInterface $Entity
306
+	 * @param EntityInterface $Entity
307 307
 	 * @param array $row
308
-	 * @return \Core\Infrastructure\EntityInterface
308
+	 * @return EntityInterface
309 309
 	 * @throws BadMethodCallException
310 310
 	 */
311 311
 	protected function buildEntity(EntityInterface $Entity, array $row){
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 	
356 356
 	/**
357 357
 	 * из объекта формирует массив
358
-	 * @param \Core\Infrastructure\EntityInterface $Entity
358
+	 * @param EntityInterface $Entity
359 359
 	 * @return \Core\Infrastructure\EntityInterface
360 360
 	 * @throws BadMethodCallException
361 361
 	 */
@@ -400,6 +400,7 @@  discard block
 block discarded – undo
400 400
 	
401 401
 	/**
402 402
 	 * Установка поля для маппинга
403
+	 * @param string $alias
403 404
 	 */
404 405
 	protected function addMappingField($alias,$field = null){
405 406
 		
Please login to merge, or discard this patch.
Braces   +27 added lines, -25 removed lines patch added patch discarded remove patch
@@ -138,7 +138,9 @@  discard block
 block discarded – undo
138 138
 		
139 139
 		$data = $this->unbuildEntity($Entity);
140 140
 		
141
-		if(method_exists($this, 'onPrepareData' )) $this->onPrepareData( $Entity , $data );
141
+		if(method_exists($this, 'onPrepareData' )) {
142
+			$this->onPrepareData( $Entity , $data );
143
+		}
142 144
 		
143 145
 		$id = $data[$this->getPrimaryKey()];
144 146
 		unset($data[$this->getPrimaryKey()]);		
@@ -174,13 +176,17 @@  discard block
 block discarded – undo
174 176
 	 */
175 177
 	public function save(EntityInterface $Entity)
176 178
 	{
177
-		if(method_exists($this, 'onAfterSave' )) $this->onAfterSave( $Entity );
179
+		if(method_exists($this, 'onAfterSave' )) {
180
+			$this->onAfterSave( $Entity );
181
+		}
178 182
 		
179 183
 		if(!$this->saveWithoutEvents($Entity)){
180 184
 			return false;
181 185
 		}
182 186
 		
183
-		if(method_exists($this, 'onBeforeSave' )) $this->onBeforeSave( $Entity );
187
+		if(method_exists($this, 'onBeforeSave' )) {
188
+			$this->onBeforeSave( $Entity );
189
+		}
184 190
 
185 191
 		return true;
186 192
 	}
@@ -214,8 +220,7 @@  discard block
 block discarded – undo
214 220
 			if(count($rel['relations'])>0){
215 221
 				$this->createListRelationReq($rel['relations'],$rel_list,$obj_parent_link.'get'.$rel['alias'].'()');
216 222
 				$rel_list [$obj_parent_link.$obj_link]= $rel['name'];
217
-			}
218
-			else{
223
+			} else{
219 224
 				$rel_list [$obj_parent_link.$obj_link] = $rel['name'];
220 225
 			}
221 226
 		}
@@ -295,19 +300,18 @@  discard block
 block discarded – undo
295 300
 //						$value
296 301
 //					]);
297 302
 
298
-				}
299
-				else{
303
+				} else{
300 304
 					$fkey = isset($cfg['on']) ? $cfg['on'] :$mapper->key;
301 305
 					$value = $mapper->findBySpecification((new Specification)->setWhere($fkey, $row[$field]));
302 306
 				}				
303 307
 				
304
-			}
305
-			elseif(is_string($field) && isset($row[strtolower($field)])){				
308
+			} elseif(is_string($field) && isset($row[strtolower($field)])){				
306 309
 				$value = $row[strtolower($field)];
307 310
 			}
308 311
 						
309
-			if($value!==false)
310
-				$Entity->{$method_set}($value);
312
+			if($value!==false) {
313
+							$Entity->{$method_set}($value);
314
+			}
311 315
 			
312 316
         }
313 317
 				
@@ -345,18 +349,17 @@  discard block
 block discarded – undo
345 349
 			//--------------------------------------------------------------------
346 350
 			if( isset($cfg['unbuild']) && is_object($cfg['unbuild']) ){
347 351
 				$value = call_user_func($cfg['unbuild'], $Entity->{$method_get}() );
348
-			}
349
-			elseif(isset($cfg['relation']) && is_object($Entity->{$method_get}()) ){
352
+			} elseif(isset($cfg['relation']) && is_object($Entity->{$method_get}()) ){
350 353
 				
351
-				if(isset($cfg['on']))
352
-					$fkey = $this->DI->get($cfg['relation'])->getFieldAlias($cfg['on']);
353
-				else
354
-					$fkey = 'id';
354
+				if(isset($cfg['on'])) {
355
+									$fkey = $this->DI->get($cfg['relation'])->getFieldAlias($cfg['on']);
356
+				} else {
357
+									$fkey = 'id';
358
+				}
355 359
 				
356 360
 				$value = $Entity->{$method_get}()->{'get'.$fkey}();
357 361
 				
358
-			}			
359
-			else{
362
+			} else{
360 363
 				$value = $Entity->{$method_get}();
361 364
 			}			
362 365
 						
@@ -374,8 +377,7 @@  discard block
 block discarded – undo
374 377
 		
375 378
 		if(is_string($field)){
376 379
 			$field = ['field'	=>	$field];
377
-		}
378
-		elseif( (is_array($field) && !isset($field['field'])) || empty($field)){
380
+		} elseif( (is_array($field) && !isset($field['field'])) || empty($field)){
379 381
 			$field['field']	= $alias;
380 382
 		}
381 383
 	
@@ -475,8 +477,7 @@  discard block
 block discarded – undo
475 477
 				$delete_key > '' && 
476 478
 				$Entity->getId() > 0){
477 479
 				$result = $this->getAdapter()->update($this->getEntityTable(), [ $delete_key => 1 ], "{$this->getPrimaryKey()} = '{$Entity->getId()}'");
478
-		}
479
-		elseif($Entity->getId() > 0){
480
+		} elseif($Entity->getId() > 0){
480 481
 			
481 482
 			if($result = $this->getAdapter()->delete($this->getEntityTable(), $this->getPrimaryKey()."  = ".$Entity->getId())){
482 483
 				if(method_exists($this, 'onBeforeDelete' )){ $result = $this->onBeforeDelete( $Entity );}
@@ -527,8 +528,9 @@  discard block
 block discarded – undo
527 528
 				$this->use_delete === false &&
528 529
 				$this->setSoftDeleteKey()>'' 
529 530
 				&& !isset($specification->getWhere()[$this->setSoftDeleteKey()])
530
-				)
531
-		$specification->setWhere($this->setSoftDeleteKey(),0);
531
+				) {
532
+				$specification->setWhere($this->setSoftDeleteKey(),0);
533
+		}
532 534
 	}
533 535
 	
534 536
 	/**
Please login to merge, or discard this patch.
example/Domain/City/City.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -16,6 +16,9 @@
 block discarded – undo
16 16
 
17 17
 	protected $name;
18 18
 	
19
+	/**
20
+	 * @param string $name
21
+	 */
19 22
 	function __construct($name) {
20 23
 		$this->setName($name);
21 24
 	}
Please login to merge, or discard this patch.
example/Domain/User/User.php 1 patch
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -22,6 +22,11 @@
 block discarded – undo
22 22
 	protected $group;
23 23
 	protected $address;
24 24
 			
25
+	/**
26
+	 * @param string $name
27
+	 * @param string $email
28
+	 * @param string $password
29
+	 */
25 30
 	function __construct($name, $email, $password, UserGroup $Group) {
26 31
 		$this->setName($name);
27 32
 		$this->setEmail($email);
Please login to merge, or discard this patch.
example/Domain/UserAddress/UserAddress.php 1 patch
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -22,6 +22,10 @@
 block discarded – undo
22 22
 	
23 23
 	protected $city;
24 24
 
25
+	/**
26
+	 * @param string $code
27
+	 * @param string $street
28
+	 */
25 29
 	function __construct(City $City,$code,$street) {
26 30
 		$this->setCity($City);
27 31
 		$this->setCode($code);
Please login to merge, or discard this patch.
src/TraitDataMapperEvent.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 
17 17
 	/**
18 18
 	 * Перед сохранением извелкаем объект и дополняем массив для записи, недостающими полями
19
-	 * @param \Autoprice\Domain\Price\EntityInterface $Entity
19
+	 * @param EntityInterface $Entity
20 20
 	 * @param type $data
21 21
 	 */
22 22
 	protected function onPrepareData(\SimpleORM\EntityInterface $Entity, &$data) {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,8 +80,7 @@
 block discarded – undo
80 80
 						$o = $$_mc;
81 81
 						eval($set_path);
82 82
 					}
83
-				}
84
-				elseif(is_object($o) ){
83
+				} elseif(is_object($o) ){
85 84
 					$$_mc = $o->{$_mc}();
86 85
 					$o = $$_mc;
87 86
 				}
Please login to merge, or discard this patch.
src/InvalidArgumentException.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,8 +11,9 @@
 block discarded – undo
11 11
 {
12 12
 	public function __construct($message, $code = null , $previous = null) {
13 13
 		
14
-		if(is_array($message))
15
-			$message = implode('',$message);
14
+		if(is_array($message)) {
15
+					$message = implode('',$message);
16
+		}
16 17
 		
17 18
 		parent::__construct($message, $code, $previous);
18 19
 	}
Please login to merge, or discard this patch.
tests/bootstrap.php 1 patch
Doc Comments   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@  discard block
 block discarded – undo
5 5
     
6 6
     /**
7 7
      * получение защищенного свойства
8
-     * @param type $o
9
-     * @param type $name
8
+     * @param string $name
9
+     * @param SimpleORM\AbstractDataMapper $obj
10 10
      * @return type
11 11
      */
12 12
     static public function getProtectedAttribute($obj, $name)
@@ -19,8 +19,9 @@  discard block
 block discarded – undo
19 19
 
20 20
     /**
21 21
      * Добавление значения в защищенное свойтсво
22
-     * @param type $name
23
-     * @param type $valued 
22
+     * @param string $name
23
+     * @param type $value
24
+     * @param SimpleORM\AbstractDataMapper $obj 
24 25
      */
25 26
     static public function setValueprotectedProperty($obj, $name, $value)
26 27
     {
@@ -30,6 +31,10 @@  discard block
 block discarded – undo
30 31
         $r->setValue($obj, $value); //изменяем значение
31 32
     }    
32 33
 	
34
+	/**
35
+	 * @param SimpleORM\AbstractDataMapper $obj
36
+	 * @param string $name
37
+	 */
33 38
 	static public function callMethod($obj, $name, array $args = []) {
34 39
         $class = new \ReflectionClass($obj);
35 40
         $method = $class->getMethod($name);
Please login to merge, or discard this patch.