PHP code example of linku / feedback-symfonystyle

1. Go to this page and download the library: Download linku/feedback-symfonystyle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

linku / feedback-symfonystyle example snippets




namespace App\Command;

use Linku\SymfonyStyleFeedback\SymfonyStyleFeedback;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

class MyCommand extends Command
{
    public static $defaultName = 'app:my-command';

    /**
     * @var MyService 
     */
    private $myService;

    public function __construct(MyService $myService)
    {
        parent::__construct();

        $this->myService = $myService;
    }
    
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $io = new SymfonyStyle($input, $output);

        $this->myService->setFeedback(
            new SymfonyStyleFeedback($io)
        );

        $this->myService->run();
    }
}