* * 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:----f+vyk3rezVdCOZrGB2IylzrFy0+nmrUR3yU0ikwMx5Y/OwW/QPq9RIv0WIGUGzpY6fmdvi8lX51OixAS7yGNPHAzHIq8Gop0wLItt0QI6mRhtGn5ztbQoaykqjiIwHNZapCtYFWaci1JuydXGjW2R6krptXJ6xiLD9BLXG/pxTt+83FwUDT5BfsDQGwGhjJhJJZA5Zo2zsKTooud9xAiboa46/2xBjWISg4IusIG/56l1pelWLuJyISow4OhD2TL0aHCtzcmFqbvsrC0SYN4S5srL9U/BXFmcFk0qwO79jAy1FBuKLlWd//UvwrdvKhnrk1oHUTmEXQcyjHtWrd+0xGVJtW1EchnZfsC7QP7g4F9DC+MNFh8QbRg1mOR15xA1MRzu0IvztMX1LIIrKQOs7tbDdTjeiqb53IQL+hRT5cbLaB/B3jDvCouUOPLkbuvY0VNAFyp6XgP9o9b367FI2B33fd51f+GbDTbUmIyRnCKMOtL23e+vtZWrdetDJetqaG7qQ0cxbFnUEU/IkP/jqBuTai9wLoHIDv87NTKHFdEsfaPqXgBeIuTv8f1tW6VWVM44QMTGnFgYmUIZ8FPBdRF5detd7YyO3HgZuntBfCMY6hSZ7F1LVKkAPz5xqYDyCez6JMiHgYU6eLSIgm08/SfmUGc6hj38AUqcHb6GA8=----ATTACHMENT:----Mzk3Mjg4MjQ3ODUxMjU3IDc2NjEwMjE3Mzg3ODUxNDcgOTQ1OTk1NjQzMjE3MzY0OA==