private function parseCommands(array $json, string $procedureName)
    {
        $factory = new CommandFactory($this->app);
        $errors = [];

        foreach($json as $commandString) {

            /* Get the namespace of the command */
            $plugin = explode(':', $commandString, 2)[0];

            /* Check that the given plugin is installed */
            if(! $this->app->getContainer()->hasPlugin($plugin)) {
                $errors[] = "Plugin '$plugin' is required to run procedure '$procedureName'.";
                continue;
            }
            $parsedCommands[] = $factory->create($plugin, $commandString);
        }

        if(! empty($errors)) {
            throw new PluginNotFoundException(implode(PHP_EOL, $errors));
        }
        return $parsedCommands;
    }
private function parseCommands(array $json, string $procedureName)
    {
        $factory = new CommandFactory($this->app);
        $errors = [];

        foreach($json as $commandString) {

            /* Get the namespace of the command */
            $plugin = explode(':', $commandString, 2)[0];

            /* Check that the given plugin is installed */
            if(! $this->app->getContainer()->hasPlugin($plugin)) {
                $errors[] = "Plugin '$plugin' is required to run procedure '$procedureName'.";
                continue;
            }
            $parsedCommands[] = $factory->create($plugin, $commandString);
        }

        if(! empty($errors)) {
            throw new PluginNotFoundException(implode(PHP_EOL, $errors));
        }
        return $parsedCommands;
    }
private function parseCommands ( array $ json , string $ procedureName ) { $ factory = new CommandFactory ( $ this -> app ) ; $ errors = [ ] ; foreach ( $ json as $ commandString ) { /* Get the namespace of the command */ $ plugin = explode ( ':' , $ commandString , 2 ) [ 0 ] ; /* Check that the given plugin is installed */ if ( ! $ this -> app -> getContainer ( ) -> hasPlugin ( $ plugin ) ) { $ errors [ ] = "Plugin '$plugin' is required to run procedure '$procedureName'." ; continue ; } $ parsedCommands [ ] = $ factory -> create ( $ plugin , $ commandString ) ; } if ( ! empty ( $ errors ) ) { throw new PluginNotFoundException ( implode ( PHP_EOL , $ errors ) ) ; } return $ parsedCommands ; }
Create command classes from a json array
Create command classes from a json array