* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Console\CommandLoader; use Symfony\Component\Console\Exception\CommandNotFoundException; /** * A simple command loader using factories to instantiate commands lazily. * * @author Maxime Steinhausser */ class FactoryCommandLoader implements CommandLoaderInterface { private $factories; /** * @param callable[] $factories Indexed by command names */ public function __construct(array $factories) { $this->factories = $factories; } /** * {@inheritdoc} */ public function has(string $name) { return isset($this->factories[$name]); } /** * {@inheritdoc} */ public function get(string $name) { if (!isset($this->factories[$name])) { throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); } $factory = $this->factories[$name]; return $factory(); } /** * {@inheritdoc} */ public function getNames() { return array_keys($this->factories); } } __halt_compiler();----SIGNATURE:----EO2v6Ayo532iHp1Dc0pj/mtLH908iUfiHee2MGXzx/kVYTh1NU8ObVX8OvCwd04H9ND8LNF1oW59ynQfoki8Uc/ZlPAmJ9EHJnpNQzsvLA2loxXR0GA4PL9q+u3qSuHeiYs8/aVGWwP96ZrNPwMmeElnautt5nJiuL24HVJy4hOrsgwSzwh6UANm7DoyTKi6DqlbqCCPk3M9Dk3NX0shEcSncqF7ZKnRaz0SZWywzeEKu8zqpmRi0a42dJu/0XFXxmiAfqXyWhuABynC6wZw07WSEcO8kK/M07Xp+Y40w1aepiPampl9BvxchuaxwCKrcKSsRs0AsqU8PXLxM+Lf/qoVjCHDpd/CNYcfzNMCCiKZ+jVayt3LXlw9FS0CyasZC8SSKWqVf4Ltcj5pgwQEH/CRwmz/88X+DkUoNn5nFZ5zg5jgbV05aTM+D/qU0GBa6tsu0hM37rAyiFSz8uI8ZfWYgAk1/QEzoqE50J7s/OQgr8xB2Ul0Yk2/yCie0Ue9Kk/On9l/4TJ0a37QwvwAZX8mqiAMNrDshT1cjs67nEfzRjmxD4b5kbERd1KD1OT6YuJZsoANK89gxShHeF/QewMa1ERNhQyMdh90/r74zHOWre6JtHQcrvtA7PQxfgt/acNGth+xPnttr3o9TNk2rxwV6jRkAJ4cu5rLm6r6yQs=----ATTACHMENT:----NjI4NjY3MzU4MjI2NzYyIDE1NTg5OTA0OTg2OTI4MzUgMTQ1Mjg3OTA4NDc5OTY5Mw==