1 | <?php |
||
39 | class JobCommand extends Command |
||
40 | { |
||
41 | /** |
||
42 | * @var \Netresearch\Kite\Job |
||
43 | */ |
||
44 | protected $job; |
||
45 | |||
46 | /** |
||
47 | * @var \Netresearch\Kite\Service\Console |
||
48 | */ |
||
49 | protected $console; |
||
50 | |||
51 | protected $jobDefinitionMerged = false; |
||
52 | |||
53 | /** |
||
54 | * Constructor. |
||
55 | * |
||
56 | * @param string $name The name of the job |
||
57 | * @param Config $config Config |
||
58 | * |
||
59 | * @api |
||
60 | */ |
||
61 | public function __construct($name, Config $config) |
||
66 | |||
67 | /** |
||
68 | * Remove workflow option |
||
69 | * |
||
70 | * @param bool $mergeArgs mergeArgs |
||
71 | * |
||
72 | * @return void |
||
73 | */ |
||
74 | public function mergeApplicationDefinition($mergeArgs = true) |
||
85 | |||
86 | /** |
||
87 | * Merge in job definition |
||
88 | * |
||
89 | * @param bool $short Whether to return short synopsis |
||
90 | * |
||
91 | * @return string |
||
92 | */ |
||
93 | public function getSynopsis($short = false) |
||
104 | |||
105 | /** |
||
106 | * Configures the current command. |
||
107 | * |
||
108 | * @return void |
||
109 | */ |
||
110 | protected function configure() |
||
117 | |||
118 | /** |
||
119 | * Get the description |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | public function getDescription() |
||
133 | |||
134 | /** |
||
135 | * Display the help - doing this here, because in configure() the helpers are not |
||
136 | * yet available. |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | public function getHelp() |
||
149 | |||
150 | /** |
||
151 | * Create and return the job |
||
152 | * |
||
153 | * @return Job |
||
154 | */ |
||
155 | public function getJob() |
||
162 | |||
163 | /** |
||
164 | * Initialize the environment |
||
165 | * |
||
166 | * @param InputInterface $input Input |
||
167 | * @param OutputInterface $output Output |
||
168 | * |
||
169 | * @return void |
||
170 | */ |
||
171 | protected function initialize(InputInterface $input, OutputInterface $output) |
||
200 | |||
201 | /** |
||
202 | * Executes the current command. |
||
203 | * |
||
204 | * This method is not abstract because you can use this class |
||
205 | * as a concrete class. In this case, instead of defining the |
||
206 | * execute() method, you set the code to execute by passing |
||
207 | * a Closure to the setCode() method. |
||
208 | * |
||
209 | * @param InputInterface $input An InputInterface instance |
||
210 | * @param OutputInterface $output An OutputInterface instance |
||
211 | * |
||
212 | * @return null|int null or 0 if everything went fine, or an error code |
||
213 | * |
||
214 | * @throws \LogicException When this abstract method is not implemented |
||
215 | * |
||
216 | * @see setCode() |
||
217 | */ |
||
218 | protected function execute(InputInterface $input, OutputInterface $output) |
||
248 | } |
||
249 | |||
251 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.