mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-10-31 01:08:26 +00:00 
			
		
		
		
	Refactoring (indentation) the code of Entity/Person.php
This commit is contained in:
		| @@ -183,7 +183,9 @@ class Person implements HasCenterInterface { | ||||
|     } | ||||
|      | ||||
|     /** | ||||
|      *  | ||||
|      * Get the accompanying periods of a give person with the  | ||||
|      * chronological order. | ||||
|      * | ||||
|      * @return AccompanyingPeriod[] | ||||
|      */ | ||||
|     public function getAccompanyingPeriodsOrdered() { | ||||
| @@ -191,32 +193,30 @@ class Person implements HasCenterInterface { | ||||
|          | ||||
|         //order by date : | ||||
|         usort($periods, function($a, $b) { | ||||
|                      | ||||
|                     $dateA = $a->getOpeningDate(); | ||||
|                     $dateB = $b->getOpeningDate(); | ||||
|                      | ||||
|                     if ($dateA == $dateB) { | ||||
|                         $dateEA = $a->getClosingDate(); | ||||
|                         $dateEB = $b->getClosingDate(); | ||||
|                          | ||||
|                         if ($dateEA == $dateEB) { | ||||
|                             return 0; | ||||
|                         } | ||||
|                          | ||||
|                         if ($dateEA < $dateEB) { | ||||
|                             return -1; | ||||
|                         } else { | ||||
|                             return +1; | ||||
|                         } | ||||
|                     } | ||||
|                      | ||||
|                     if ($dateA < $dateB) { | ||||
|                         return -1 ; | ||||
|                     } else { | ||||
|                         return 1; | ||||
|                     } | ||||
|                 }); | ||||
|             $dateA = $a->getOpeningDate(); | ||||
|             $dateB = $b->getOpeningDate(); | ||||
|              | ||||
|             if ($dateA == $dateB) { | ||||
|                 $dateEA = $a->getClosingDate(); | ||||
|                 $dateEB = $b->getClosingDate(); | ||||
|                  | ||||
|                 if ($dateEA == $dateEB) { | ||||
|                     return 0; | ||||
|                 } | ||||
|                  | ||||
|                 if ($dateEA < $dateEB) { | ||||
|                     return -1; | ||||
|                 } else { | ||||
|                     return +1; | ||||
|                 } | ||||
|             } | ||||
|              | ||||
|             if ($dateA < $dateB) { | ||||
|                 return -1 ; | ||||
|             } else { | ||||
|                 return 1; | ||||
|             } | ||||
|         });     | ||||
|                  | ||||
|         return $periods; | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user