PHP code example of wazum / console-output-service

1. Go to this page and download the library: Download wazum/console-output-service 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/ */

    

wazum / console-output-service example snippets


namespace Vendor\Extension\EventListener;

use Symfony\Component\Console\Output\ConsoleOutput;

final class OnSomethingHappened
{
    public function __construct(private readonly ConsoleOutput $output)
    {
    }

    public function __invoke(SomethingHappened $event): void
    {
        $this->output->writeln(
                '<info>Something happened!</info>'
        );
    }
}