AbstractConfigOption.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Setup\Option;
  7. use Symfony\Component\Console\Input\InputOption;
  8. /**
  9. * Abstract Option class in deployment configuration tool
  10. */
  11. abstract class AbstractConfigOption extends InputOption
  12. {
  13. /**
  14. * Frontend input type
  15. *
  16. * @var string
  17. */
  18. private $frontendType;
  19. /**
  20. * Config path
  21. *
  22. * @var string
  23. */
  24. private $configPath;
  25. /**
  26. * Constructor
  27. *
  28. * @param string $name
  29. * @param string $frontendType
  30. * @param int $mode
  31. * @param string $configPath
  32. * @param string $description
  33. * @param string|array|null $defaultValue
  34. * @param string|array|null $shortcut
  35. */
  36. public function __construct(
  37. $name,
  38. $frontendType,
  39. $mode,
  40. $configPath,
  41. $description = '',
  42. $defaultValue = null,
  43. $shortcut = null
  44. ) {
  45. $this->frontendType = $frontendType;
  46. $this->configPath = $configPath;
  47. parent::__construct($name, $shortcut, $mode, $description, $defaultValue);
  48. }
  49. /**
  50. * Get frontend input type
  51. *
  52. * @return string
  53. */
  54. public function getFrontendType()
  55. {
  56. return $this->frontendType;
  57. }
  58. /**
  59. * Get config path
  60. *
  61. * @return string
  62. */
  63. public function getConfigPath()
  64. {
  65. return $this->configPath;
  66. }
  67. /**
  68. * No base validation
  69. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  70. * @param mixed $data
  71. * @return void
  72. */
  73. public function validate($data)
  74. {
  75. }
  76. }