Country.php 738 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Tax\Model\System\Config\Source\Tax;
  7. class Country extends \Magento\Directory\Model\Config\Source\Country
  8. {
  9. /**
  10. * @var array
  11. */
  12. protected $_options;
  13. /**
  14. * @inheritdoc
  15. */
  16. public function toOptionArray($noEmpty = false, $foregroundCountries = '')
  17. {
  18. $options = parent::toOptionArray($noEmpty, $foregroundCountries);
  19. if (!$noEmpty) {
  20. if ($options) {
  21. $options[0]['label'] = __('None');
  22. } else {
  23. $options = [['value' => '', 'label' => __('None')]];
  24. }
  25. }
  26. return $options;
  27. }
  28. }