Fixed command interfaces
This commit is contained in:
@@ -110,7 +110,7 @@ class ClassCreateCommand extends Command {
|
||||
];
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
if (!CredentialManager::isConfigured())
|
||||
throw new \Exception("The 'cloudobjects' CLI tool must be installed and authorized.");
|
||||
|
||||
@@ -238,6 +238,7 @@ class ClassCreateCommand extends Command {
|
||||
$output->writeln("Calling cloudobjects ...");
|
||||
passthru("cloudobjects configuration-job:create ".$fullName.".xml");
|
||||
}
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace CloudObjects\PhpMAE\Commands;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use CloudObjects\SDK\COIDParser;
|
||||
use CloudObjects\PhpMAE\ClassValidator;
|
||||
|
||||
@@ -20,7 +21,7 @@ class ClassDeployCommand extends AbstractObjectCommand {
|
||||
->addArgument('coid', InputArgument::REQUIRED, 'The COID of the object.');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
$this->requireCloudObjectsCLI();
|
||||
|
||||
$this->parse($input->getArgument('coid'));
|
||||
@@ -67,6 +68,7 @@ class ClassDeployCommand extends AbstractObjectCommand {
|
||||
break;
|
||||
}
|
||||
$output->writeln("");
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use ML\IRI\IRI;
|
||||
use Guzzle\Http\Exception\BadResponseException;
|
||||
use CloudObjects\SDK\COIDParser;
|
||||
@@ -55,7 +56,7 @@ class ClassTestEnvCommand extends AbstractObjectCommand {
|
||||
}
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
$this->requireCloudObjectsCLI();
|
||||
|
||||
$container = $this->getContainer();
|
||||
@@ -93,6 +94,7 @@ class ClassTestEnvCommand extends AbstractObjectCommand {
|
||||
$cmd->upload($output);
|
||||
});
|
||||
}
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use JsonRpc\Client;
|
||||
use CloudObjects\PhpMAE\TestEnvironmentManager;
|
||||
|
||||
@@ -33,7 +34,7 @@ class ClassTestEnvRPCCommand extends AbstractObjectCommand {
|
||||
->addArgument('parameters', InputArgument::IS_ARRAY, 'The parameters for the method.');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
$this->requireCloudObjectsCLI();
|
||||
|
||||
$container = $this->getContainer();
|
||||
@@ -68,6 +69,7 @@ class ClassTestEnvRPCCommand extends AbstractObjectCommand {
|
||||
: json_encode($client->result, JSON_PRETTY_PRINT));
|
||||
else
|
||||
$output->writeln("<error>RPC has failed!</error>");
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use CloudObjects\PhpMAE\ClassValidator;
|
||||
|
||||
class ClassValidateCommand extends AbstractObjectCommand {
|
||||
@@ -22,7 +23,7 @@ class ClassValidateCommand extends AbstractObjectCommand {
|
||||
->addOption('watch', null, InputOption::VALUE_NONE, 'Keep watching for changes of the file and revalidate automatically.');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
$this->parse($input->getArgument('coid'));
|
||||
$this->assertRDF();
|
||||
if (!in_array('coid://phpmae.dev/Class', $this->rdfTypes)
|
||||
@@ -52,6 +53,7 @@ class ClassValidateCommand extends AbstractObjectCommand {
|
||||
}
|
||||
});
|
||||
}
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use CloudObjects\SDK\COIDParser;
|
||||
|
||||
class DependenciesAddAttachmentCommand extends AbstractObjectCommand {
|
||||
@@ -22,7 +23,7 @@ class DependenciesAddAttachmentCommand extends AbstractObjectCommand {
|
||||
->addOption('upload', null, InputOption::VALUE_NONE, 'Calls "cloudobjects" to actually upload the file to CloudObjects.');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
$this->requireCloudObjectsCLI();
|
||||
|
||||
$this->parse($input->getArgument('coid-target'));
|
||||
@@ -58,6 +59,7 @@ class DependenciesAddAttachmentCommand extends AbstractObjectCommand {
|
||||
$output->writeln("Calling cloudobjects ...");
|
||||
passthru("cloudobjects attachment:put ".(string)$this->coid." ".$filename);
|
||||
}
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use CloudObjects\SDK\COIDParser;
|
||||
|
||||
class DependenciesAddClassCommand extends AbstractAddDependenciesCommand {
|
||||
@@ -24,7 +25,7 @@ class DependenciesAddClassCommand extends AbstractAddDependenciesCommand {
|
||||
parent::configure();
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
$this->requireCloudObjectsCLI();
|
||||
|
||||
$this->parse($input->getArgument('coid-target'));
|
||||
@@ -73,6 +74,7 @@ class DependenciesAddClassCommand extends AbstractAddDependenciesCommand {
|
||||
$output->writeln("You can find the documentation for the available class methods on this page:");
|
||||
$output->writeln("➡️ https://cloudobjects.io/".$coidClass->getHost().$coidClass->getPath());
|
||||
$output->writeln("");
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace CloudObjects\PhpMAE\Commands;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use CloudObjects\SDK\COIDParser;
|
||||
|
||||
class DependenciesAddStaticTextCommand extends AbstractAddDependenciesCommand {
|
||||
@@ -23,7 +24,7 @@ class DependenciesAddStaticTextCommand extends AbstractAddDependenciesCommand {
|
||||
parent::configure();
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
$this->requireCloudObjectsCLI();
|
||||
|
||||
$this->parse($input->getArgument('coid-target'));
|
||||
@@ -58,6 +59,7 @@ class DependenciesAddStaticTextCommand extends AbstractAddDependenciesCommand {
|
||||
$output->writeln("");
|
||||
$output->writeln("3) Use \$this->".$key." wherever required.");
|
||||
$output->writeln("");
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use CloudObjects\SDK\COIDParser;
|
||||
|
||||
class DependenciesAddTemplateCommand extends AbstractAddDependenciesCommand {
|
||||
@@ -25,7 +26,7 @@ class DependenciesAddTemplateCommand extends AbstractAddDependenciesCommand {
|
||||
parent::configure();
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
$this->requireCloudObjectsCLI();
|
||||
|
||||
$this->parse($input->getArgument('coid-target'));
|
||||
@@ -70,6 +71,7 @@ class DependenciesAddTemplateCommand extends AbstractAddDependenciesCommand {
|
||||
$output->writeln("");
|
||||
$output->writeln("3) Render your template by calling \$this->".$key."Template->render(\$context).");
|
||||
$output->writeln("");
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace CloudObjects\PhpMAE\Commands;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use CloudObjects\SDK\COIDParser;
|
||||
|
||||
class DependenciesAddWebAPICommand extends AbstractAddDependenciesCommand {
|
||||
@@ -23,7 +24,7 @@ class DependenciesAddWebAPICommand extends AbstractAddDependenciesCommand {
|
||||
parent::configure();
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
$this->requireCloudObjectsCLI();
|
||||
|
||||
$this->parse($input->getArgument('coid-target'));
|
||||
@@ -67,6 +68,7 @@ class DependenciesAddWebAPICommand extends AbstractAddDependenciesCommand {
|
||||
$output->writeln("");
|
||||
$output->writeln("3) Make API requests in your class by calling methods on \$this->".$key."Api.");
|
||||
$output->writeln("");
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ class InterfaceCreateCommand extends Command {
|
||||
->addOption('confjob', null, InputOption::VALUE_OPTIONAL, 'Calls "cloudobjects" to create a configuration job for the new interface.', false);
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
if (!CredentialManager::isConfigured())
|
||||
throw new \Exception("The 'cloudobjects' CLI tool must be installed and authorized.");
|
||||
|
||||
@@ -79,6 +79,7 @@ class InterfaceCreateCommand extends Command {
|
||||
$output->writeln("Calling cloudobjects ...");
|
||||
passthru("cloudobjects configuration-job:create ".$fullName.".xml");
|
||||
}
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace CloudObjects\PhpMAE\Commands;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use CloudObjects\SDK\COIDParser;
|
||||
use CloudObjects\PhpMAE\ClassValidator;
|
||||
|
||||
@@ -20,7 +21,7 @@ class InterfaceDeployCommand extends AbstractObjectCommand {
|
||||
->addArgument('coid', InputArgument::REQUIRED, 'The COID of the object.');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
$this->parse($input->getArgument('coid'));
|
||||
$this->assertRDF();
|
||||
if (!in_array('coid://phpmae.dev/Interface', $this->rdfTypes))
|
||||
@@ -45,6 +46,7 @@ class InterfaceDeployCommand extends AbstractObjectCommand {
|
||||
? $object['coid://cloudobjects.io/isVisibleTo'][0]['value']
|
||||
: 'coid://cloudobjects.io/Vendor';
|
||||
$path = $this->coid->getHost().$this->coid->getPath();
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use CloudObjects\PhpMAE\ClassValidator;
|
||||
|
||||
class InterfaceValidateCommand extends AbstractObjectCommand {
|
||||
@@ -21,7 +22,7 @@ class InterfaceValidateCommand extends AbstractObjectCommand {
|
||||
->addOption('watch', null, InputOption::VALUE_OPTIONAL, 'Keep watching for changes of the file and revalidate automatically.', null);
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
$this->parse($input->getArgument('coid'));
|
||||
$this->assertRDF();
|
||||
if (!in_array('coid://phpmae.dev/Interface', $this->rdfTypes))
|
||||
@@ -47,6 +48,7 @@ class InterfaceValidateCommand extends AbstractObjectCommand {
|
||||
$output->writeln('<error>'.get_class($e).'</error> '.$e->getMessage());
|
||||
}
|
||||
});
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class TestEnvironmentStartCommand extends Command {
|
||||
->addOption('host', null, InputOption::VALUE_OPTIONAL, 'Bind test environment to this host.', '127.0.0.1');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
if (!CredentialManager::isConfigured())
|
||||
throw new \Exception("The 'cloudobjects' CLI tool must be installed and authorized.");
|
||||
|
||||
@@ -49,6 +49,7 @@ class TestEnvironmentStartCommand extends Command {
|
||||
die("THRU!");
|
||||
}
|
||||
}
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user