Skip to content
Snippets Groups Projects
Commit ac72ddbe authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

feature(init): initial version

parent ffce81f3
No related branches found
No related tags found
2 merge requests!2Feature/init,!1Feature/init
Pipeline #10794 passed with warnings with stages
in 1 minute and 25 seconds
<?php
namespace WPDesk\ActivationReminder\Composer;
/**
* Links plugin commands handlers to composer
*
* @package WPDesk\ActivationReminder\Composer
*/
class CommandProvider implements \Composer\Plugin\Capability\CommandProvider
{
public function getCommands()
{
return [
new PrepareActivationReminderCommand(),
];
}
}
\ No newline at end of file
...@@ -67,12 +67,21 @@ class Plugin implements PluginInterface, EventSubscriberInterface { ...@@ -67,12 +67,21 @@ class Plugin implements PluginInterface, EventSubscriberInterface {
$this->io = $io; $this->io = $io;
} }
/**
* @inheritDoc
*/
public function getCapabilities(): array
{
return [
\Composer\Plugin\Capability\CommandProvider::class => CommandProvider::class
];
}
/** /**
* @param Event $event * @param Event $event
*/ */
public function generateReminder(Event $event) { public function generateReminder(Event $event) {
error_log('generate reminder'); passthru("composer prepare-activation-reminder");
} }
} }
<?php
namespace WPDesk\ActivationReminder\Composer;
use Composer\Command\BaseCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Can prepare activation reminder for plugin.
*
* @package WPDesk\Composer\GitPlugin\Command
*/
class PrepareActivationReminderCommand extends BaseCommand
{
protected function configure()
{
$this
->setName('prepare-activation-reminder')
->setDescription('Prepares activation reminder for WP Desk plugin.');
}
/**
* Execute command.
*
* @param InputInterface $input
* @param OutputInterface $output
* @return int|void|null
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln("Activation reminder created.");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment