FormFactory.php 419 B

12345678910111213141516
  1. <?php
  2. class FormFactory
  3. {
  4. public static function getForm($formType, $name, $phone, $email = null, $uploadFile = null):FormAbstract
  5. {
  6. if ($formType === 'callback'){
  7. return new CallbackForm($name, $phone);
  8. }
  9. elseif($formType === 'EmailForm'){
  10. return new CallbackEmail($name, $phone, $email, $uploadFile);
  11. } else {
  12. return null;
  13. }
  14. }
  15. }