Minor code improvements:
[shipsimu.git] / application / ship-simu / main / personell / company / class_CompanyEmployee.php
index 32d2abe80b50c2380fe3a50c1d97f7df6484db59..52a4d241340452b9054a378fa4906de285470593 100644 (file)
@@ -56,14 +56,14 @@ class CompanyEmployee extends SimulatorPersonell {
                }
 
                // Ist the given birthday valid?
-               if ($personellInstance->isDateValid($year, $month, $day)) {
-                       // Set birthday
-                       $personellInstance->setBirthday($year, $month, $day);
-               } else {
+               if (!$personellInstance->isDateValid($year, $month, $day)) {
                        // Something is wrong ...
                        throw new BirthdayInvalidException(array($year, $month, $day), self::EXCEPTION_BIRTH_DATE_IS_INVALID);
                }
 
+               // Set birthday
+               $personellInstance->setBirthday($year, $month, $day);
+
                // Set as employed/marrital status
                $personellInstance->setEmployed(true);
                $personellInstance->setMarried($married);