1 | <?php |
||
28 | class ApplicationAdapter extends Application |
||
29 | { |
||
30 | /** |
||
31 | * @var \Webmozart\Console\Api\Application\Application |
||
32 | */ |
||
33 | private $adaptedApplication; |
||
34 | |||
35 | /** |
||
36 | * @var CommandAdapter |
||
37 | */ |
||
38 | private $currentCommand; |
||
39 | |||
40 | /** |
||
41 | * Creates the application. |
||
42 | * |
||
43 | * @param \Webmozart\Console\Api\Application\Application $application |
||
44 | */ |
||
45 | 15 | public function __construct(\Webmozart\Console\Api\Application\Application $application) |
|
46 | { |
||
47 | 15 | $this->adaptedApplication = $application; |
|
48 | |||
49 | 15 | $config = $application->getConfig(); |
|
50 | |||
51 | 15 | parent::__construct($config->getDisplayName(), $config->getVersion()); |
|
52 | |||
53 | 15 | if ($dispatcher = $config->getEventDispatcher()) { |
|
54 | 12 | $this->setDispatcher($dispatcher); |
|
55 | } |
||
56 | |||
57 | 15 | $this->setAutoExit($config->isTerminatedAfterRun()); |
|
58 | 15 | $this->setCatchExceptions($config->isExceptionCaught()); |
|
59 | |||
60 | 15 | foreach ($application->getCommands() as $command) { |
|
61 | 13 | $this->add(new CommandAdapter($command, $this)); |
|
62 | } |
||
63 | 15 | } |
|
64 | |||
65 | /** |
||
66 | * @return \Webmozart\Console\Api\Application\Application |
||
67 | */ |
||
68 | public function getAdaptedApplication() |
||
72 | |||
73 | /** |
||
74 | * {@inheritdoc} |
||
75 | */ |
||
76 | public function doRun(InputInterface $input, OutputInterface $output) |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | protected function getCommandName(InputInterface $input) |
||
111 | |||
112 | /** |
||
113 | * {@inheritdoc} |
||
114 | */ |
||
115 | public function find($name) |
||
119 | |||
120 | /** |
||
121 | * {@inheritdoc} |
||
122 | */ |
||
123 | 15 | protected function getDefaultInputDefinition() |
|
127 | |||
128 | /** |
||
129 | * {@inheritdoc} |
||
130 | */ |
||
131 | 15 | protected function getDefaultCommands() |
|
135 | |||
136 | /** |
||
137 | * {@inheritdoc} |
||
138 | */ |
||
139 | 15 | protected function getDefaultHelperSet() |
|
143 | } |
||
144 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: