mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-04 14:46:19 +08:00 
			
		
		
		
	[minor]: SCA (#16269)
* Php Inspections (EA Ultimate): minor code tweaks * Php Inspections (EA Ultimate): code style * Php Inspections (EA Ultimate): code style * Php Inspections (EA Ultimate): code style
This commit is contained in:
		
				
					committed by
					
						
						Alexander Makarov
					
				
			
			
				
	
			
			
			
						parent
						
							643ef6f820
						
					
				
				
					commit
					6dd2aec011
				
			@ -353,24 +353,22 @@ trait ActiveRelationTrait
 | 
				
			|||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        } else {
 | 
					        } elseif ($this->multiple) {
 | 
				
			||||||
            if ($this->multiple) {
 | 
					            foreach ($primaryModels as $i => $primaryModel) {
 | 
				
			||||||
                foreach ($primaryModels as $i => $primaryModel) {
 | 
					                foreach ($primaryModel[$primaryName] as $j => $m) {
 | 
				
			||||||
                    foreach ($primaryModel[$primaryName] as $j => $m) {
 | 
					                    if ($m instanceof ActiveRecordInterface) {
 | 
				
			||||||
                        if ($m instanceof ActiveRecordInterface) {
 | 
					                        $m->populateRelation($name, $primaryModel);
 | 
				
			||||||
                            $m->populateRelation($name, $primaryModel);
 | 
					                    } else {
 | 
				
			||||||
                        } else {
 | 
					                        $primaryModels[$i][$primaryName][$j][$name] = $primaryModel;
 | 
				
			||||||
                            $primaryModels[$i][$primaryName][$j][$name] = $primaryModel;
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            } else {
 | 
					            }
 | 
				
			||||||
                foreach ($primaryModels as $i => $primaryModel) {
 | 
					        } else {
 | 
				
			||||||
                    if ($primaryModels[$i][$primaryName] instanceof ActiveRecordInterface) {
 | 
					            foreach ($primaryModels as $i => $primaryModel) {
 | 
				
			||||||
                        $primaryModels[$i][$primaryName]->populateRelation($name, $primaryModel);
 | 
					                if ($primaryModels[$i][$primaryName] instanceof ActiveRecordInterface) {
 | 
				
			||||||
                    } elseif (!empty($primaryModels[$i][$primaryName])) {
 | 
					                    $primaryModels[$i][$primaryName]->populateRelation($name, $primaryModel);
 | 
				
			||||||
                        $primaryModels[$i][$primaryName][$name] = $primaryModel;
 | 
					                } elseif (!empty($primaryModels[$i][$primaryName])) {
 | 
				
			||||||
                    }
 | 
					                    $primaryModels[$i][$primaryName][$name] = $primaryModel;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
@ -621,7 +621,7 @@ SQL;
 | 
				
			|||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
                    $returnParams[$phName]['dataType'] = \PDO::PARAM_INT;
 | 
					                    $returnParams[$phName]['dataType'] = \PDO::PARAM_INT;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                $returnParams[$phName]['size'] = isset($columnSchemas[$name]) && isset($columnSchemas[$name]->size) ? $columnSchemas[$name]->size : -1;
 | 
					                $returnParams[$phName]['size'] = isset($columnSchemas[$name]->size) ? $columnSchemas[$name]->size : -1;
 | 
				
			||||||
                $returning[] = $this->quoteColumnName($name);
 | 
					                $returning[] = $this->quoteColumnName($name);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            $sql .= ' RETURNING ' . implode(', ', $returning) . ' INTO ' . implode(', ', array_keys($returnParams));
 | 
					            $sql .= ' RETURNING ' . implode(', ', $returning) . ' INTO ' . implode(', ', array_keys($returnParams));
 | 
				
			||||||
 | 
				
			|||||||
@ -937,7 +937,7 @@ class Request extends \yii\base\Request
 | 
				
			|||||||
            throw new InvalidConfigException('Unable to determine the path info of the current request.');
 | 
					            throw new InvalidConfigException('Unable to determine the path info of the current request.');
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (substr($pathInfo, 0, 1) === '/') {
 | 
					        if (strncmp($pathInfo, '/', 1) === 0) {
 | 
				
			||||||
            $pathInfo = substr($pathInfo, 1);
 | 
					            $pathInfo = substr($pathInfo, 1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -814,12 +814,10 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
 | 
				
			|||||||
        $_SESSION[$this->flashParam] = $counters;
 | 
					        $_SESSION[$this->flashParam] = $counters;
 | 
				
			||||||
        if (empty($_SESSION[$key])) {
 | 
					        if (empty($_SESSION[$key])) {
 | 
				
			||||||
            $_SESSION[$key] = [$value];
 | 
					            $_SESSION[$key] = [$value];
 | 
				
			||||||
 | 
					        } elseif (is_array($_SESSION[$key])) {
 | 
				
			||||||
 | 
					            $_SESSION[$key][] = $value;
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            if (is_array($_SESSION[$key])) {
 | 
					            $_SESSION[$key] = [$_SESSION[$key], $value];
 | 
				
			||||||
                $_SESSION[$key][] = $value;
 | 
					 | 
				
			||||||
            } else {
 | 
					 | 
				
			||||||
                $_SESSION[$key] = [$_SESSION[$key], $value];
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user