PHP code example of monolyth / cliff

1. Go to this page and download the library: Download monolyth/cliff 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/ */

    

monolyth / cliff example snippets




namespace My\Module;

use Monolyth\Cliff;

class Command extends Cliff\Command
{
}




//...
public function __invoke(string $path, string $filename)
{
    // ...do your thang...
}




//...
#[\Monolyth\Cliff\Alias("o")]
public $foo;



class Command extends \Monolyth\Cliff\Command
{
    public string $is is optional

    public bool $emptyOption = false; // Boolean options are per defintion empty
}




$command = new Foo\Command(['--bar', 'baz']);
$command->execute();