1: <?php
2: /**
3: * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
4: * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
5: *
6: * Licensed under The MIT License
7: * For full copyright and license information, please see the LICENSE.txt
8: * Redistributions of files must retain the above copyright notice
9: *
10: * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
11: * @since 3.5.0
12: * @license http://www.opensource.org/licenses/mit-license.php MIT License
13: */
14: namespace Cake\TestSuite;
15:
16: use Cake\Console\ConsoleIo;
17:
18: /**
19: * Class that dispatches to the legacy ShellDispatcher using the same signature
20: * as the newer CommandRunner
21: */
22: class LegacyCommandRunner
23: {
24: /**
25: * @var \Cake\Console\ConsoleIo
26: */
27: protected $_io;
28:
29: /**
30: * Mimics functionality of Cake\Console\CommandRunner
31: *
32: * @param array $argv Argument array
33: * @param ConsoleIo $io ConsoleIo
34: * @return int
35: */
36: public function run(array $argv, ConsoleIo $io = null)
37: {
38: $dispatcher = new LegacyShellDispatcher($argv, true, $io);
39:
40: return $dispatcher->dispatch();
41: }
42: }
43: