2017 © Pedro Peláez
 

library console

image

xervice/console

  • Wednesday, July 25, 2018
  • by mibexx
  • Repository
  • 1 Watchers
  • 0 Stars
  • 727 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 1480 % Grown

The README.md

Scrutinizer Code Quality Code Coverage, (*1)

Console service based on symfony console for Xervice., (*2)

Installation

composer require xervice/console

Configuration

There is nothing to configure. But to add your commands, you have to extend the console module and overwrite "getCommandList" method in the dependency provider., (*3)

<?php

namespace App\Console;

use Xervice\Console\ConsoleDependencyProvider as XerviceConsoleDependencyProvider;

class ConsoleDependencyProvider extends XerviceConsoleDependencyProvider
{
    /**
     * @return array
     */
    protected function getCommandList(): array
    {
        return [
            new MyCommand()
        ];
    }
}

Usage

vendor/bin/xervice <command>

New Command

<?php

namespace App\MyModule\Communication\Console\Command;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Xervice\Console\Business\Model\Command\AbstractCommand;

/**
 * @method \App\MyModule\Business\MyModuleFacade getFacade()
 * @method \App\MyModule\Communication\MyModuleCommunicationFactory getFactory()
 */
class MyCommand extends AbstractCommand
{
    /**
     * @throws \Symfony\Component\Console\Exception\InvalidArgumentException
     */
    protected function configure(): void
    {
        $this
            ->setName('mymodule:mycommand')
            ->setDescription('Command description');
    }

    /**
     * @param \Symfony\Component\Console\Input\InputInterface $input
     * @param \Symfony\Component\Console\Output\OutputInterface $output
     *
     * @return int|void
     * @throws \Core\Locator\Dynamic\ServiceNotParseable
     */
    public function run(InputInterface $input, OutputInterface $output)
    {
        $this->getFacade()->runMyCommand($output);
    }

}

The Versions

25/07 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mike Bertram

25/07 2018

1.2.0

1.2.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mike Bertram

17/07 2018

1.1.1

1.1.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mike Bertram

13/07 2018

1.1.0

1.1.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mike Bertram

09/07 2018

1.0.1

1.0.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mike Bertram

05/07 2018

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mike Bertram