comparison vendor/symfony/console/Descriptor/Descriptor.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
11 11
12 namespace Symfony\Component\Console\Descriptor; 12 namespace Symfony\Component\Console\Descriptor;
13 13
14 use Symfony\Component\Console\Application; 14 use Symfony\Component\Console\Application;
15 use Symfony\Component\Console\Command\Command; 15 use Symfony\Component\Console\Command\Command;
16 use Symfony\Component\Console\Exception\InvalidArgumentException;
16 use Symfony\Component\Console\Input\InputArgument; 17 use Symfony\Component\Console\Input\InputArgument;
17 use Symfony\Component\Console\Input\InputDefinition; 18 use Symfony\Component\Console\Input\InputDefinition;
18 use Symfony\Component\Console\Input\InputOption; 19 use Symfony\Component\Console\Input\InputOption;
19 use Symfony\Component\Console\Output\OutputInterface; 20 use Symfony\Component\Console\Output\OutputInterface;
20 use Symfony\Component\Console\Exception\InvalidArgumentException;
21 21
22 /** 22 /**
23 * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> 23 * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
24 * 24 *
25 * @internal 25 * @internal
32 protected $output; 32 protected $output;
33 33
34 /** 34 /**
35 * {@inheritdoc} 35 * {@inheritdoc}
36 */ 36 */
37 public function describe(OutputInterface $output, $object, array $options = array()) 37 public function describe(OutputInterface $output, $object, array $options = [])
38 { 38 {
39 $this->output = $output; 39 $this->output = $output;
40 40
41 switch (true) { 41 switch (true) {
42 case $object instanceof InputArgument: 42 case $object instanceof InputArgument:
53 break; 53 break;
54 case $object instanceof Application: 54 case $object instanceof Application:
55 $this->describeApplication($object, $options); 55 $this->describeApplication($object, $options);
56 break; 56 break;
57 default: 57 default:
58 throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_class($object))); 58 throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', \get_class($object)));
59 } 59 }
60 } 60 }
61 61
62 /** 62 /**
63 * Writes content to output. 63 * Writes content to output.
73 /** 73 /**
74 * Describes an InputArgument instance. 74 * Describes an InputArgument instance.
75 * 75 *
76 * @return string|mixed 76 * @return string|mixed
77 */ 77 */
78 abstract protected function describeInputArgument(InputArgument $argument, array $options = array()); 78 abstract protected function describeInputArgument(InputArgument $argument, array $options = []);
79 79
80 /** 80 /**
81 * Describes an InputOption instance. 81 * Describes an InputOption instance.
82 * 82 *
83 * @return string|mixed 83 * @return string|mixed
84 */ 84 */
85 abstract protected function describeInputOption(InputOption $option, array $options = array()); 85 abstract protected function describeInputOption(InputOption $option, array $options = []);
86 86
87 /** 87 /**
88 * Describes an InputDefinition instance. 88 * Describes an InputDefinition instance.
89 * 89 *
90 * @return string|mixed 90 * @return string|mixed
91 */ 91 */
92 abstract protected function describeInputDefinition(InputDefinition $definition, array $options = array()); 92 abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []);
93 93
94 /** 94 /**
95 * Describes a Command instance. 95 * Describes a Command instance.
96 * 96 *
97 * @return string|mixed 97 * @return string|mixed
98 */ 98 */
99 abstract protected function describeCommand(Command $command, array $options = array()); 99 abstract protected function describeCommand(Command $command, array $options = []);
100 100
101 /** 101 /**
102 * Describes an Application instance. 102 * Describes an Application instance.
103 * 103 *
104 * @return string|mixed 104 * @return string|mixed
105 */ 105 */
106 abstract protected function describeApplication(Application $application, array $options = array()); 106 abstract protected function describeApplication(Application $application, array $options = []);
107 } 107 }